How to filters Amazon Linux 3 with Graviton and GP3 Type

Hello,

I’m starting to use Packer in my projects and trying to create something images for AWS AMI, using the example of documentation to create ami of Ubuntu, and worked very well.

But I trying to create an ami of Amazon Linux 3 and try to understand how this filter works. My code bellow don’t find the IAM:

data "amazon-ami" "amazon-linux-3" {
  filters = {
    name                = "amzn3-ami-hvm-3.*-arm64-gp2"
    root-device-type    = "ebs"
    virtualization-type = "hvm"
  }

  most_recent = true
  owners      = ["amazon"]
}

I don’t know is correct, but this return:

**Error: Datasource.Execute failed: No AMI was found matching filters: {**

And another problem, is how do I create the image using the gp3 partition?

Thank all!

Hello everyone!

I found the solution, I test with some comands aws cli and I discovery how image is on Amazon Linux 3, follow my data for example:

data "amazon-ami" "amazon-linux-3" {
  filters = {
    name                = "al2023-ami-2023.*.*-kernel-6.1-arm64"
    root-device-type    = "ebs"
    virtualization-type = "hvm"
  }

  most_recent = true
  owners      = ["amazon"]
}

And I can use with gp3 partition during the source.

Thank all!