Last active
April 3, 2019 11:20
-
-
Save petersellars/d0ac8c19568dff44264682fd957efa19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "region" { | |
default = "ap-southeast-2" | |
} | |
variable "version" { | |
default = "trusty-14.04" | |
} | |
variable "architecture" { | |
default = "amd64" | |
} | |
provider "aws" { | |
region = "${var.region}" | |
} | |
data "aws_ami" "ubuntu_trusty" { | |
most_recent = true | |
filter { | |
name = "name" | |
values = ["ubuntu/images/hvm-ssd/ubuntu-${var.version}-${var.architecture}-server-*"] | |
} | |
filter { | |
name = "virtualization-type" | |
values = ["hvm"] | |
} | |
owners = ["099720109477"] # Canonical | |
} | |
output "ami_id" { | |
value = "${data.aws_ami.ubuntu_trusty.id}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment