diff --git a/terraform/aws/simple-ec2/output.tf b/terraform/aws/simple-ec2/output.tf new file mode 100644 index 0000000..68eca57 --- /dev/null +++ b/terraform/aws/simple-ec2/output.tf @@ -0,0 +1,3 @@ +output "instance_ip_address" { + value = "${aws_instance.test-01.public_ip}" +} diff --git a/terraform/aws/simple-ec2/provider.tf b/terraform/aws/simple-ec2/provider.tf index 0c28776..d7c130e 100644 --- a/terraform/aws/simple-ec2/provider.tf +++ b/terraform/aws/simple-ec2/provider.tf @@ -1,3 +1,3 @@ provider "aws" { - region = "us-west-2" + region = "${var.user_region}" } diff --git a/terraform/aws/simple-ec2/vars.tf b/terraform/aws/simple-ec2/variables.tf similarity index 74% rename from terraform/aws/simple-ec2/vars.tf rename to terraform/aws/simple-ec2/variables.tf index c5aa2ec..128b929 100644 --- a/terraform/aws/simple-ec2/vars.tf +++ b/terraform/aws/simple-ec2/variables.tf @@ -1,17 +1,19 @@ +variable "user_region" { + type = "string" + description = "AWS region in which to create all resources" +} + variable "keypair" { type = "string" description = "AWS SSH keypair to use to connect to instances" - default = "aws_rsa" } variable "flavor" { type = "string" description = "AWS type to use when creating instances" - default = "t2.micro" } variable "sec-group" { type = "string" description = "AWS security group to apply to instances" - default = "sg-7099b514" }