DEV Community

drewmullen
drewmullen

Posted on • Updated on

Terraform: Common aws_ami Searches

Searching for AMI's is not fun. Here are some you might be searching for:

Amazon Linux 2 (latest):

data "aws_ami" "amazon_linux_2" {
  most_recent = true
  owners      = ["amazon"]

  filter {
    name   = "name"
    values = ["amzn2-ami-hvm-*-x86_64-ebs"]
  }
}
Enter fullscreen mode Exit fullscreen mode

Graviton 2

RHEL 7 (latest)

Thanks: @wsarwariamzn

data "aws_ami" "rhel_7" {
  most_recent = true
  owners      = ["309956199498"]

  filter {
    name = "name"
    values = ["RHEL-7.9_HVM_GA*-x86_64-0-Hourly2-GP2"]
  }
}
Enter fullscreen mode Exit fullscreen mode

Please send me more and I'll include them in this post!

Top comments (0)