Difference between revisions of "Terraform data source: aws ami"

From wikieduonline
Jump to navigation Jump to search
Line 29: Line 29:
 
  }
 
  }
  
 +
 +
== [[RHEL]] ==
 
  data "aws_ami" "rhel_7" {
 
  data "aws_ami" "rhel_7" {
 
   most_recent = true
 
   most_recent = true
 
   [[owners]]      = ["309956199498"]
 
   [[owners]]      = ["309956199498"]
 
+
 
   filter {
 
   filter {
 
     name = "name"
 
     name = "name"

Revision as of 14:01, 2 April 2023

data "aws_ami" "my_ubuntu" {
  most_recent = true

  filter {
    name   = "name"
    values = ["ubuntu/images/hvm-ssd/ubuntu-hirsute-21.04-amd64-server-*"]
  } 

  filter {
    name   = "virtualization-type"
    values = ["hvm"]
  } 

  owners = ["099720109477"] # Canonical
} 


data "aws_ami" "amzlinux2" {
  most_recent = true
  owners      = ["amazon"]
 
  filter {
    name   = "name"
    values = ["amzn2-ami-hvm-*-x86_64-ebs"]
  }
}


RHEL

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

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


Related

     values = ["ubuntu/images/hvm-ssd/ubuntu-kinetic-22.10-amd64-server-*"]

See also

Advertising: