NEW: code to lookup latest amzn2 AMI from amazon

This commit is contained in:
xpk
2020-08-11 09:10:08 +08:00
parent 6ed7506305
commit c6928fff02
2 changed files with 33 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
data "aws_ami" "latest-amzn2" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-hvm-2.0*gp2"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
}
output ami_id {
value = data.aws_ami.latest-amzn2.id
}