'packer unable use filter to pick the correct image-id (amzn-Linux2)

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 ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source