From 0f8f230d813b487548ed977951f45140bb5270d9 Mon Sep 17 00:00:00 2001 From: chiggins Date: Wed, 15 May 2019 15:18:45 -0500 Subject: [PATCH] Fixes #284 Changes the AWS profile to be a user-supplied variable, opposed to statically being just `terraform`. --- Terraform/main.tf | 2 +- Terraform/terraform.tfvars.example | 1 + Terraform/variables.tf | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Terraform/main.tf b/Terraform/main.tf index f1234d2..a2cc2ea 100644 --- a/Terraform/main.tf +++ b/Terraform/main.tf @@ -2,7 +2,7 @@ provider "aws" { shared_credentials_file = "${var.shared_credentials_file}" region = "${var.region}" - profile = "terraform" + profile = "${var.profile}" } # Create a VPC to launch our instances into diff --git a/Terraform/terraform.tfvars.example b/Terraform/terraform.tfvars.example index f8c02dc..c09a891 100644 --- a/Terraform/terraform.tfvars.example +++ b/Terraform/terraform.tfvars.example @@ -1,4 +1,5 @@ region = "us-west-1" +profile = "terraform" shared_credentials_file = "/home/user/.aws/credentials" public_key_name = "id_logger" public_key_path = "/home/user/.ssh/id_logger.pub" diff --git a/Terraform/variables.tf b/Terraform/variables.tf index c501bb8..1fb59ad 100644 --- a/Terraform/variables.tf +++ b/Terraform/variables.tf @@ -1,6 +1,9 @@ variable "region" { default = "us-west-1" } +variable "profile" { + default = "terraform" +} variable "availability_zone" { description = "https://www.terraform.io/docs/providers/aws/d/availability_zone.html" default = ""