AMI lookup

This commit is contained in:
Ubuntu
2016-10-07 14:17:27 +00:00
parent 4e078036af
commit 83f0fc4317
2 changed files with 9 additions and 7 deletions
+1 -7
View File
@@ -1,10 +1,4 @@
provider "aws" {
access_key = "ACCESS_KEY_HERE"
secret_key = "SECRET_KEY_HERE"
region = "us-east-1"
}
resource "aws_instance" "example" {
ami = "ami-0d729a60"
ami = "${lookup(var.AMIS, var.AWS_REGION)}"
instance_type = "t2.micro"
}
+8
View File
@@ -3,3 +3,11 @@ variable "AWS_SECRET_KEY" {}
variable "AWS_REGION" {
default = "eu-west-1"
}
variable "AMIS" {
type = "map"
default = {
us-east-1 = "ami-13be557e"
us-west-2 = "ami-06b94666"
eu-west-1 = "ami-0d729a60"
}
}