NEW: code to lookup latest amzn2 AMI from amazon
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
variable "aws_access_key" {}
|
||||
variable "aws_secret_key" {}
|
||||
variable "aws_region" {}
|
||||
|
||||
provider "aws" {
|
||||
access_key = var.aws_access_key
|
||||
secret_key = var.aws_secret_key
|
||||
region = var.aws_region
|
||||
version = ">= 2.28.1"
|
||||
}
|
||||
|
||||
variable "default-tags" {}
|
||||
variable "vpc-cidr" {
|
||||
default = "172.16.0.0/16"
|
||||
}
|
||||
Reference in New Issue
Block a user