From 7049e4aa73e4172584f04fc4c9f01511598f0cf7 Mon Sep 17 00:00:00 2001 From: chri carelli <50923511+chris-carelli@users.noreply.github.com> Date: Sat, 8 Jan 2022 16:09:18 -0500 Subject: [PATCH] set environment tag to staging --- 01_05_base/terraform.tfvars.backup | 13 ------------- 02_10_count/main.tf | 11 ++++++++--- 03_07_custommodule/terraform.tfvars.backup | 5 ----- 04_05_terraform_cloud_vcs/variables.tf | 2 +- 4 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 01_05_base/terraform.tfvars.backup delete mode 100644 03_07_custommodule/terraform.tfvars.backup diff --git a/01_05_base/terraform.tfvars.backup b/01_05_base/terraform.tfvars.backup deleted file mode 100644 index b2e0363..0000000 --- a/01_05_base/terraform.tfvars.backup +++ /dev/null @@ -1,13 +0,0 @@ -# MAC/LINUX -# aws ec2 create-key-pair --key-name tf_key --query 'KeyMaterial' --output text > tf_key.pem -### -# WINDOWS -# aws ec2 create-key-pair --key-name tf_key --query 'KeyMaterial' --output text | out-file -encoding ascii -filepath tf_key.pem - -aws_access_key = "" - -aws_secret_key = "" - -ssh_key_name = "" - -private_key_path = "" \ No newline at end of file diff --git a/02_10_count/main.tf b/02_10_count/main.tf index f96932b..f05b1e5 100644 --- a/02_10_count/main.tf +++ b/02_10_count/main.tf @@ -143,8 +143,8 @@ resource "aws_security_group" "sg-nodejs-instance" { } # INSTANCE -resource "aws_instance" "nodejs1" { - //count = 4 +resource "aws_instance" "node_instances" { + count = 4 ami = data.aws_ami.aws-linux.id instance_type = var.environment_instance_settings["PROD"].instance_type @@ -156,6 +156,11 @@ resource "aws_instance" "nodejs1" { tags = {Environment = var.environment_list[0]} } +resource "aws_iam_user" "iam-users" { + for_each = var.iam_accounts + + name = each.key +} # ////////////////////////////// # DATA @@ -186,5 +191,5 @@ data "aws_ami" "aws-linux" { # OUTPUT # ////////////////////////////// output "instance-dns" { - value = aws_instance.nodejs1.public_dns + value = aws_instance.node_instances.*.public_dns } \ No newline at end of file diff --git a/03_07_custommodule/terraform.tfvars.backup b/03_07_custommodule/terraform.tfvars.backup deleted file mode 100644 index d4e057a..0000000 --- a/03_07_custommodule/terraform.tfvars.backup +++ /dev/null @@ -1,5 +0,0 @@ -aws_access_key = "" - -aws_secret_key = "" - -region = "" \ No newline at end of file diff --git a/04_05_terraform_cloud_vcs/variables.tf b/04_05_terraform_cloud_vcs/variables.tf index 06a0e24..003d79d 100644 --- a/04_05_terraform_cloud_vcs/variables.tf +++ b/04_05_terraform_cloud_vcs/variables.tf @@ -17,7 +17,7 @@ variable "instance_count" { variable "instance_tags" { type = map default = { - "environment" = "dev" + "environment" = "staging" } } # //////////////////////////////