From bc391dbfe02ca00d4c96ec4427d375eb14c61fe7 Mon Sep 17 00:00:00 2001 From: sondraschroder Date: Wed, 20 Sep 2023 10:01:21 -0400 Subject: [PATCH 1/4] Version bumping --- .gitignore | 2 +- main.tf | 2 ++ variables.tf | 18 ++++++++++++++++++ versions.tf | 12 ++++++------ 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index cba1d468..c76aa9e1 100644 --- a/.gitignore +++ b/.gitignore @@ -26,5 +26,5 @@ override.tf.json # !example_override.tf # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan -# example: *tfplan* +*tfplan* diff --git a/main.tf b/main.tf index 08a64928..467953e4 100644 --- a/main.tf +++ b/main.tf @@ -3,6 +3,8 @@ provider "aws" { region = var.region + access_key = var.AWS_ACCESS_KEY_ID + secret_key = var.AWS_SECRET_ACCESS_KEY } data "aws_ami" "ubuntu" { diff --git a/variables.tf b/variables.tf index e80c3e1c..f5571ebd 100644 --- a/variables.tf +++ b/variables.tf @@ -16,3 +16,21 @@ variable "instance_name" { default = "Provisioned by Terraform" } +// DO NOT put your AWS credentials in code +//DO NOT run AWS CLI locally +//DO NOT RUN TERRAFORM LOCALLY +//Because credentials are stored in plain text locally +//And anyone with access to your comnmputer can have your level of access +//to company resources. + +variable "AWS_ACCESS_KEY_ID" { + description = "Temp AWS creds" + default = "" +} + +variable "AWS_SECRET_ACCESS_KEY" { + description = "Temp AWS creds" + default = "" +} + +//Keep the values in code stored blank diff --git a/versions.tf b/versions.tf index 35d3078c..1b17f703 100644 --- a/versions.tf +++ b/versions.tf @@ -5,14 +5,14 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 3.28.0" } - random = { - source = "hashicorp/random" - version = "3.0.0" - } +# random = { +# source = "hashicorp/random" +# version = "3.0.0" +# } } - required_version = ">= 0.14.0" + required_version = ">= 1.5.6" } + From 3b76846c66064051e9d30c9a519af7cbb55c817c Mon Sep 17 00:00:00 2001 From: sondraschroder Date: Wed, 20 Sep 2023 10:25:45 -0400 Subject: [PATCH 2/4] Version bumping --- .gitignore | 1 - versions.tf | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c76aa9e1..6ff2db2b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ override.tf.json *_override.tf.json # Include override files you do wish to add to version control using negated pattern -# # !example_override.tf # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan diff --git a/versions.tf b/versions.tf index 1b17f703..8d9da5ff 100644 --- a/versions.tf +++ b/versions.tf @@ -13,6 +13,6 @@ terraform { # } } - required_version = ">= 1.5.6" + # required_version = ">= 1.5.6" } From 06f72895bd21ea773ed4dabd547eb0403b76dc61 Mon Sep 17 00:00:00 2001 From: sondraschroder Date: Wed, 20 Sep 2023 10:30:45 -0400 Subject: [PATCH 3/4] Version bumping --- versions.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/versions.tf b/versions.tf index 8d9da5ff..26eddda7 100644 --- a/versions.tf +++ b/versions.tf @@ -5,6 +5,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" + version = ">=5.17.0" } # random = { @@ -13,6 +14,6 @@ terraform { # } } - # required_version = ">= 1.5.6" + required_version = ">= 1.5.7" } From 2372cba06bb3398721b7c69f68a4b4a8c05d8460 Mon Sep 17 00:00:00 2001 From: sondraschroder Date: Wed, 20 Sep 2023 10:32:10 -0400 Subject: [PATCH 4/4] Ensure environments use the same versions for all devs --- .terraform.lock.hcl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .terraform.lock.hcl diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl new file mode 100644 index 00000000..640bcf12 --- /dev/null +++ b/.terraform.lock.hcl @@ -0,0 +1,25 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "5.17.0" + constraints = ">= 5.17.0" + hashes = [ + "h1:U+EDfeUqefebA1h7KyBMD1xH0h311LMi7wijPDPkC/0=", + "zh:0087b9dd2c9c638fd63e527e5b9b70988008e263d480a199f180efe5a4f070f0", + "zh:0fd532a4fd03ddef11f0502ff9fe4343443e1ae805cb088825a71d6d48906ec7", + "zh:16411e731100cd15f7e165f53c23be784b2c86c2fcfd34781e0642d17090d342", + "zh:251d520927e77f091e2ec6302e921d839a2430ac541c6a461aed7c08fb5eae12", + "zh:4919e69682dc2a8c32d44f6ebc038a52c9f40af9c61cb574b64e322800d6a794", + "zh:5334c60759d5f76bdc51355d1a3ebcc451d4d20f632f5c73b6e55c52b5dc9e52", + "zh:7341a2b7247572eba0d0486094a870b872967702ec0ac7af728c2df2c30af4e5", + "zh:81d1b1cb2cac6b3922a05adab69543b678f344a01debd54500263700dad7a288", + "zh:882bc8e15ef6d4020a07321ec4c056977c5c1d96934118032922561d29504d43", + "zh:8cd4871ef2b03fd916de1a6dc7eb8a81a354c421177d4334a2e3308e50215e41", + "zh:97e12fe6529b21298adf1046c5e20ac35d0569c836a6f385ff041e257e00cfd2", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9f5baf5d59b9f3cf5504d1fa975f10f27da3791896a9e18ece47c258bac17634", + "zh:dffafba6731ac1db1c540bdbd6a8c878486b71de9d0ca1d23c5c00a6c3c14d80", + "zh:fa7440c3c15a42fc5731444d324ced75407d417bfe3184661ae47d40a9718dce", + ] +}