Can someone please help with below  question.

how to put AMI name in packer manifest 
<https://stackoverflow.com/questions/69674747/how-to-put-ami-name-in-packer-manifest>

*Just for easy access pasting the same question here.*

I would like to get the AMI name into the packer manifest. I understand how 
to get this for the AMI id but its different for the name. I have:
```
data "amazon-ami" "ubuntu" {
  filters = {
     name = 
"ubuntu-minimal/images/hvm-ssd/ubuntu-focal-20.04-amd64-minimal-*"
     root-device-type    = "ebs"
     virtualization-type = "hvm"
  }
  most_recent = true
  region      = "us-east-1"
}
source "amazon-ebs" "ui" {
  ami_name      = "my-ami-${formatdate("YYYY-MM-DD-hhmmss", timestamp())}"
  instance_type = "t3.small"
  region        = "us-east-1"
  source_ami    = "${data.amazon-ami.ubuntu.id}"
  ssh_pty       = true
  ssh_username  = "ubuntu"
}
build {
  sources = ["source.amazon-ebs.ui"]
  
  post-processor "manifest" {
    output = "manifest.json"
    strip_path = true
    custom_data = {
      version = "${source.ami_name}"
    }
  }
}
```

The error I am getting is Unsupported attribute; This object does not have 
an attribute named "ami_name".

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/04e4e897-40e4-40fe-880e-b24229922141n%40googlegroups.com.

Reply via email to