From 802c392066a4553b1b94a84808fd2cfafd1ea677 Mon Sep 17 00:00:00 2001 From: Austin Workman Date: Thu, 18 Jul 2019 10:56:38 -0500 Subject: [PATCH] Updating module for terraform 0.12 --- main.tf | 3 ++- outputs.tf | 4 +++- variables.tf | 1 + versions.tf | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 versions.tf diff --git a/main.tf b/main.tf index 83bbeeb..b6f11af 100644 --- a/main.tf +++ b/main.tf @@ -15,10 +15,11 @@ data "aws_ami" "ubuntu" { } resource "aws_instance" "this" { - ami = "${data.aws_ami.ubuntu.id}" + ami = data.aws_ami.ubuntu.id instance_type = "t2.micro" tags = { Owner = "Consumer" } } + diff --git a/outputs.tf b/outputs.tf index 9973d79..2f0933a 100644 --- a/outputs.tf +++ b/outputs.tf @@ -2,7 +2,9 @@ locals { #this_id = "${compact(concat(coalescelist(aws_instance.this.*.id, list("")))}"} #this_id = "${compact(concat(coalescelist(aws_instance.this.*.id, aws_instance.this_t2.*.id), list("")))}"} } + output "id" { description = "List of IDs of instances" - value = ["${aws_instance.this.*.id}"] + value = [aws_instance.this.*.id] } + diff --git a/variables.tf b/variables.tf index 5201a1f..f0a8432 100644 --- a/variables.tf +++ b/variables.tf @@ -5,3 +5,4 @@ variable "name" { variable "instance_count" { description = "Number of EC2 instances" } + diff --git a/versions.tf b/versions.tf new file mode 100644 index 0000000..ac97c6a --- /dev/null +++ b/versions.tf @@ -0,0 +1,4 @@ + +terraform { + required_version = ">= 0.12" +}