I am trying to use packer to create a new AMI. I want to use the base image as "ami-03ededff12e34e59e" ( Amazon Linux 2)
I am using the following filters :
data "amazon-ami" "amzn2" {
owners = ["099720109477"]
most_recent=true
region = "us-east-1"
filters = {
virtualization-type = "hvm"
architecture = "x86_64"
root-device-type = "ebs"
owner-alias = "amazon"
name = "amzn2-ami-hvm-*"
}
}
However, I am getting the following error :
Error: Datasource.Execute failed: No AMI was found matching filters: {
Any thoughts on where I am making a mistake ?
I believe the issue is the
owner
attribute. For Amazon Linux 2 it should beamazon
.I tend to use the following syntax that grabs the latest AMI: