diff --git a/infrastructure-as-code/aws-ec2-instance/main.tf b/infrastructure-as-code/aws-ec2-instance/main.tf index 7c002a141..22fe3b907 100644 --- a/infrastructure-as-code/aws-ec2-instance/main.tf +++ b/infrastructure-as-code/aws-ec2-instance/main.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 0.11.0" + required_version = ">= 0.11.7" } provider "aws" { @@ -9,7 +9,7 @@ provider "aws" { resource "aws_instance" "ubuntu" { ami = "${var.ami_id}" instance_type = "${var.instance_type}" - availability_zone = "${var.aws_region}a" + availability_zone = "${var.aws_region}" tags { Name = "${var.name}" diff --git a/infrastructure-as-code/aws-ec2-instance/variables.tf b/infrastructure-as-code/aws-ec2-instance/variables.tf index 5a8cb11c5..0b4e14692 100644 --- a/infrastructure-as-code/aws-ec2-instance/variables.tf +++ b/infrastructure-as-code/aws-ec2-instance/variables.tf @@ -1,19 +1,25 @@ +resource "null_resource" "example1" { + provisioner "local-exec" { + command = "tree" + } +} + variable "aws_region" { description = "AWS region" - default = "us-west-1" + default = "eu-west-2" } variable "ami_id" { - description = "ID of the AMI to provision. Default is Ubuntu 14.04 Base Image" - default = "ami-2e1ef954" + description = "ID of the AMI to provision. Default is CentOS Hashistack Base Image" + default = "ami-03a0ef6f0d2067f46" } variable "instance_type" { description = "type of EC2 instance to provision." - default = "t2.micro" + default = "m4.large" } variable "name" { description = "name to pass to Name tag" - default = "Provisioned by Terraform" + default = "demo-vm-jboero" }