From dc34ccbdfae4ffbc4fff7b56e62596fed7210fd5 Mon Sep 17 00:00:00 2001 From: ofureehis99 <76758532+ofureehis99@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:14:23 -0500 Subject: [PATCH] Revert "hashicorp-certified-terraform-associate" --- .../top-level-blocks-samples.tf | 4 +- .../terraform-block.tf | 32 --- .../terraform-manifests/terraform-block.tf | 6 +- .../terraform-manifests-oldv1/c1-versions.tf | 21 -- .../terraform-manifests-oldv1/c2-vpc.tf | 8 - .../terraform-manifests/c1-versions.tf | 4 +- .../terraform-manifests-oldv1/c1-versions.tf | 25 --- .../c2-vpc-us-east-1.tf | 7 - .../c3-vpc-us-west-1.tf | 14 -- .../terraform-manifests/c1-versions.tf | 4 +- .../.terraform.lock.hcl | 40 ---- .../.terraform.lock.hcl-ORIGINAL | 40 ---- .../terraform-manifests-old-v1/c1-versions.tf | 23 --- .../terraform-manifests-old-v1/c2-s3bucket.tf | 12 -- .../terraform-manifests/c1-versions.tf | 2 +- .../terraform-manifests-oldv1/c1-versions.tf | 15 -- .../c2-ec2-instance.tf | 14 -- .../terraform-manifests/c1-versions.tf | 4 +- .../04-02-Meta-Argument-depends_on/README.md | 8 +- .../apache-install.sh | 7 - .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-vpc.tf | 70 ------- .../c3-ec2-instance.tf | 23 --- .../c4-elastic-ip.tf | 7 - .../terraform-manifests/c1-versions.tf | 4 +- .../04-03-Meta-Argument-count/README.md | 2 +- .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../c2-ec2-instance.tf | 10 - .../terraform-manifests/c1-versions.tf | 4 +- .../04-04-Meta-Argument-for_each/README.md | 19 +- .../v1-for_each-maps/c1-versions.tf | 20 -- .../v1-for_each-maps/c2-s3bucket.tf | 22 --- .../v2-for_each-toset/c1-versions.tf | 20 -- .../v2-for_each-toset/c2-iamuser.tf | 7 - .../v1-for_each-maps/c1-versions.tf | 4 +- .../v1-for_each-maps/c2-s3bucket.tf | 3 +- .../v2-for_each-toset/c1-versions.tf | 4 +- .../v1-create_before_destroy/c1-versions.tf | 20 -- .../c2-ec2-instance.tf | 15 -- .../v2-prevent_destroy/c1-versions.tf | 20 -- .../v2-prevent_destroy/c2-ec2-instance.tf | 12 -- .../v3-ignore_changes/c1-versions.tf | 20 -- .../v3-ignore_changes/c2-ec2-instance.tf | 17 -- .../v1-create_before_destroy/c1-versions.tf | 4 +- .../v2-prevent_destroy/c1-versions.tf | 5 +- .../v3-ignore_changes/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../v1-Input-Variables-Basic/c1-versions.tf | 20 -- .../v1-Input-Variables-Basic/c2-variables.tf | 18 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../c1-versions.tf | 20 -- .../c2-variables.tf | 21 -- .../c3-rds-db.tf | 11 -- .../secrets.tfvars | 2 - .../v11-File-Function/apache-install.sh | 6 - .../v11-File-Function/c1-versions.tf | 20 -- .../v11-File-Function/c2-variables.tf | 24 --- .../v11-File-Function/c3-security-groups.tf | 49 ----- .../v11-File-Function/c4-ec2-instance.tf | 24 --- .../c1-versions.tf | 20 -- .../c2-variables.tf | 24 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../c1-versions.tf | 20 -- .../c2-variables.tf | 24 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../c1-versions.tf | 20 -- .../c2-variables.tf | 24 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../c1-versions.tf | 20 -- .../c2-variables.tf | 24 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../terraform.tfvars | 2 - .../app.tfvars | 1 - .../c1-versions.tf | 20 -- .../c2-variables.tf | 24 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../terraform.tfvars | 1 - .../web.tfvars | 1 - .../c1-versions.tf | 21 -- .../c2-variables.tf | 24 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../terraform.tfvars | 1 - .../web.auto.tfvars | 1 - .../c1-versions.tf | 20 -- .../c2-variables.tf | 24 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../v8-02-Input-Variables-Maps/c1-versions.tf | 20 -- .../c2-variables.tf | 46 ----- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 18 -- .../c1-versions.tf | 20 -- .../c2-variables.tf | 28 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../05-01-Terraform-Input-Variables/README.md | 20 +- .../v1-Input-Variables-Basic/c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../v11-File-Function/c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../v8-02-Input-Variables-Maps/c1-versions.tf | 4 +- .../c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 18 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 23 --- .../terraform-manifests-oldv1/c5-outputs.tf | 24 --- .../terraform-manifests/c1-versions.tf | 4 +- .../05-03-Terraform-Local-Values/README.md | 2 +- .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 21 -- .../terraform-manifests-oldv1/c3-s3-bucket.tf | 26 --- .../terraform-manifests/c1-versions.tf | 4 +- 06-Terraform-Datasources/README.md | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 22 --- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 15 -- .../terraform-manifests-oldv1/c5-outputs.tf | 13 -- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests/c1-versions.tf | 5 +- .../README.md | 2 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 31 --- .../terraform-manifests-oldv1/c2-variables.tf | 13 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 15 -- .../terraform-manifests-oldv1/c5-outputs.tf | 13 -- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 31 --- .../terraform-manifests-oldv1/c2-variables.tf | 13 -- .../c3-security-groups.tf | 58 ------ .../c4-ec2-instance.tf | 29 --- .../terraform-manifests-oldv1/c5-outputs.tf | 13 -- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests/c1-versions.tf | 4 +- .../v1-local-backend/apache-install.sh | 6 - .../v1-local-backend/c1-versions.tf | 20 -- .../v1-local-backend/c2-variables.tf | 13 -- .../v1-local-backend/c3-security-groups.tf | 49 ----- .../v1-local-backend/c4-ec2-instance.tf | 16 -- .../v1-local-backend/c5-outputs.tf | 14 -- .../v1-local-backend/c6-ami-datasource.tf | 21 -- .../v2-remote-backend/apache-install.sh | 6 - .../v2-remote-backend/c1-versions.tf | 29 --- .../v2-remote-backend/c2-variables.tf | 13 -- .../v2-remote-backend/c3-security-groups.tf | 49 ----- .../v2-remote-backend/c4-ec2-instance.tf | 16 -- .../v2-remote-backend/c5-outputs.tf | 14 -- .../v2-remote-backend/c6-ami-datasource.tf | 21 -- .../v1-local-backend/c1-versions.tf | 4 +- .../v2-remote-backend/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../apps/app1/app1-file1.html | 1 - .../apps/app1/app1-file2.html | 1 - .../apps/app2/app2-file1.html | 1 - .../apps/app2/app2-file2.html | 1 - .../app2-folder-1/app2-folder-1-file1.html | 1 - .../apps/file-copy.html | 1 - .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 13 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 64 ------ .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../private-key/terraform-key.pem | 27 --- .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../apps/app1/app1-file1.html | 1 - .../apps/app1/app1-file2.html | 1 - .../apps/app2/app2-file1.html | 1 - .../apps/app2/app2-file2.html | 1 - .../app2-folder-1/app2-folder-1-file1.html | 1 - .../apps/file-copy.html | 1 - .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 13 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 44 ----- .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../private-key/terraform-key.pem | 27 --- .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../apps/app1/app1-file1.html | 1 - .../apps/app1/app1-file2.html | 1 - .../apps/app2/app2-file1.html | 1 - .../apps/app2/app2-file2.html | 1 - .../app2-folder-1/app2-folder-1-file1.html | 1 - .../apps/file-copy.html | 1 - .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 13 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 34 ---- .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../creation-time-private-ip.txt | 1 - .../backup-for-reference/destroy-time.txt | 1 - .../private-key/terraform-key.pem | 27 --- .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../apps/app1/file1.html | 1 - .../apps/app1/file2.html | 1 - .../apps/app1/file3.html | 1 - .../terraform-manifests-oldv1/c1-versions.tf | 28 --- .../terraform-manifests-oldv1/c2-variables.tf | 13 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 53 ----- .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../private-key/terraform-key.pem | 27 --- .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests copy/c1-versions.tf | 20 -- .../terraform-manifests copy/c2-variables.tf | 7 - .../c3-ami-datasource.tf | 21 -- .../c4-ec2instance-module.tf | 23 --- .../terraform-manifests copy/c5-outputs.tf | 16 -- .../terraform-manifests/c1-versions.tf | 4 +- .../index.html | 10 - ...policy-public-read-access-for-website.json | 16 -- .../main.tf | 30 --- .../outputs.tf | 21 -- .../terraform.tfvars | 5 - .../variables.tf | 12 -- .../versions.tf | 20 -- .../c1-versions.tf | 20 -- .../c2-variables.tf | 25 --- .../c3-s3bucket.tf | 7 - .../c4-outputs.tf | 25 --- .../aws-s3-static-website-bucket/LICENSE | 11 -- .../aws-s3-static-website-bucket/README.md | 4 - .../aws-s3-static-website-bucket/main.tf | 30 --- .../aws-s3-static-website-bucket/outputs.tf | 21 -- .../aws-s3-static-website-bucket/variables.tf | 12 -- .../versions.tf | 4 +- .../c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 19 -- .../terraform-manifests-oldv1/c2-variables.tf | 10 - .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests/c1-versions.tf | 4 +- .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 25 --- .../terraform-manifests-oldv1/c3-s3bucket.tf | 8 - .../terraform-manifests-oldv1/c4-outputs.tf | 25 --- .../terraform-manifests/c1-versions.tf | 4 +- .../terraform-manifests-oldv1/c1-versions.tf | 27 --- .../terraform-manifests-oldv1/c2-variables.tf | 26 --- .../terraform-manifests-oldv1/c3-s3bucket.tf | 8 - .../terraform-manifests-oldv1/c4-outputs.tf | 25 --- .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 31 --- .../terraform-manifests-oldv1/c2-variables.tf | 10 - .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests/c1-versions.tf | 4 +- .../terraform-manifests-oldv1/c1-versions.tf | 28 --- .../terraform-manifests-oldv1/c2-variables.tf | 27 --- .../terraform-manifests-oldv1/c3-s3bucket.tf | 40 ---- .../terraform-manifests-oldv1/c4-outputs.tf | 10 - .../static-files/index.html | 10 - .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 19 -- .../terraform-manifests-oldv1/c2-variables.tf | 10 - .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests/c1-versions.tf | 4 +- .../v1-ec2-instance/c1-versions.tf | 21 -- .../v1-ec2-instance/c2-ec2-instance.tf | 14 -- .../Oldv1-backup/v2-s3bucket/c1-versions.tf | 21 -- .../Oldv1-backup/v2-s3bucket/c2-s3bucket.tf | 8 - .../v1-ec2-instance/c1-versions.tf | 4 +- .../v2-s3bucket/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 19 -- .../terraform-manifests-oldv1/c2-variables.tf | 10 - .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 19 -- .../terraform-manifests-oldv1/c5-outputs.tf | 14 -- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests-oldv1/dot-old | 31 --- .../terraform-manifests-oldv1/dot1 | 31 --- .../terraform-manifests-oldv1/graph.svg | 182 ------------------ .../terraform-manifests/c1-versions.tf | 4 +- .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 19 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 26 --- .../terraform-manifests-oldv1/c5-outputs.tf | 23 --- .../c6-ami-datasource.tf | 21 -- .../private-key/terraform-key.pem | 27 --- .../terraform-manifests-oldv1/user_data.tmpl | 4 - .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 24 --- .../terraform-manifests-oldv1/c2-variables.tf | 40 ---- .../c3-security-groups.tf | 50 ----- .../c4-ec2-instance.tf | 31 --- .../terraform-manifests-oldv1/c5-outputs.tf | 26 --- .../c6-ami-datasource.tf | 21 -- .../terraform-manifests-oldv1/c7-elb.tf | 31 --- .../terraform-manifests/c1-versions.tf | 4 +- .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../c2-security-groups-regular.tf | 47 ----- .../c3-dynamic-blocks-for-security-groups.tf | 22 --- .../terraform-manifests/c1-versions.tf | 4 +- .../apache-install.sh | 6 - .../terraform-manifests-oldv1/c1-versions.tf | 20 -- .../terraform-manifests-oldv1/c2-variables.tf | 13 -- .../c3-security-groups.tf | 49 ----- .../c4-ec2-instance.tf | 15 -- .../terraform-manifests-oldv1/c5-outputs.tf | 13 -- .../c6-ami-datasource.tf | 21 -- .../terraform-trace.log_BKUP | 47 ----- .../terraform-manifests/c1-versions.tf | 4 +- 341 files changed, 132 insertions(+), 6038 deletions(-) delete mode 100644 03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests-oldv1/terraform-block.tf delete mode 100644 03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c2-vpc.tf delete mode 100644 03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c2-vpc-us-east-1.tf delete mode 100644 03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c3-vpc-us-west-1.tf delete mode 100644 03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl delete mode 100755 03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl-ORIGINAL delete mode 100644 03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c1-versions.tf delete mode 100644 03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c2-s3bucket.tf delete mode 100644 04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c2-ec2-instance.tf delete mode 100644 04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/apache-install.sh delete mode 100644 04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c2-vpc.tf delete mode 100644 04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c3-ec2-instance.tf delete mode 100644 04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c4-elastic-ip.tf delete mode 100644 04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c2-ec2-instance.tf delete mode 100644 04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c2-s3bucket.tf delete mode 100644 04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c2-iamuser.tf delete mode 100644 04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c2-ec2-instance.tf delete mode 100644 04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c2-ec2-instance.tf delete mode 100644 04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c1-versions.tf delete mode 100644 04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c2-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/apache-install.sh delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c3-rds-db.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/secrets.tfvars delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/apache-install.sh delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/terraform.tfvars delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/app.tfvars delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/terraform.tfvars delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/web.tfvars delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/terraform.tfvars delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/web.auto.tfvars delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/apache-install.sh delete mode 100644 05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c3-s3-bucket.tf delete mode 100644 06-Terraform-Datasources/terraform-manifests-oldv1/apache-install.sh delete mode 100644 06-Terraform-Datasources/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 06-Terraform-Datasources/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 06-Terraform-Datasources/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 06-Terraform-Datasources/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 06-Terraform-Datasources/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 06-Terraform-Datasources/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/apache-install.sh delete mode 100644 07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/apache-install.sh delete mode 100644 07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/apache-install.sh delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c1-versions.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c2-variables.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c3-security-groups.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c4-ec2-instance.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c5-outputs.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c6-ami-datasource.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/apache-install.sh delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c1-versions.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c2-variables.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c3-security-groups.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c4-ec2-instance.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c5-outputs.tf delete mode 100644 08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c6-ami-datasource.tf delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apache-install.sh delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-file1.html delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/file-copy.html delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apache-install.sh delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file1.html delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apache-install.sh delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file1.html delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/creation-time-private-ip.txt delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/destroy-time.txt delete mode 100644 09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apache-install.sh delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file1.html delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file2.html delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file3.html delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/private-key/terraform-key.pem delete mode 100644 10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/apache-install.sh delete mode 100644 10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c1-versions.tf delete mode 100644 10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c2-variables.tf delete mode 100644 10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c3-ami-datasource.tf delete mode 100644 10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c4-ec2instance-module.tf delete mode 100644 10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c5-outputs.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/index.html delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/policy-public-read-access-for-website.json delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/main.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/outputs.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/terraform.tfvars delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/variables.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/versions.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/c1-versions.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/c2-variables.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/c3-s3bucket.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/c4-outputs.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/modules/aws-s3-static-website-bucket/LICENSE delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/modules/aws-s3-static-website-bucket/README.md delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/modules/aws-s3-static-website-bucket/main.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/modules/aws-s3-static-website-bucket/outputs.tf delete mode 100644 10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v3-build-a-module-to-host-static-website-on-aws-s3/modules/aws-s3-static-website-bucket/variables.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/apache-install.sh delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c3-s3bucket.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c4-outputs.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c3-s3bucket.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c4-outputs.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/apache-install.sh delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c3-s3bucket.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c4-outputs.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/static-files/index.html delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/apache-install.sh delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c1-versions.tf delete mode 100644 13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c2-ec2-instance.tf delete mode 100644 13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c1-versions.tf delete mode 100644 13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c2-s3bucket.tf delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/apache-install.sh delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/dot-old delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/dot1 delete mode 100644 14-Terraform-Graph/terraform-manifests-oldv1/graph.svg delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/private-key/terraform-key.pem delete mode 100644 15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/user_data.tmpl delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/apache-install.sh delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c7-elb.tf delete mode 100644 15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c2-security-groups-regular.tf delete mode 100644 15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c3-dynamic-blocks-for-security-groups.tf delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/apache-install.sh delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/c1-versions.tf delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/c2-variables.tf delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/c3-security-groups.tf delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/c4-ec2-instance.tf delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/c5-outputs.tf delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/c6-ami-datasource.tf delete mode 100644 16-Terraform-Debug/terraform-manifests-oldv1/terraform-trace.log_BKUP diff --git a/02-Terraform-Basics/02-03-Terraform-Language-Syntax/terraform-manifests/top-level-blocks-samples.tf b/02-Terraform-Basics/02-03-Terraform-Language-Syntax/terraform-manifests/top-level-blocks-samples.tf index 004c4bb8..da3a8dbf 100644 --- a/02-Terraform-Basics/02-03-Terraform-Language-Syntax/terraform-manifests/top-level-blocks-samples.tf +++ b/02-Terraform-Basics/02-03-Terraform-Language-Syntax/terraform-manifests/top-level-blocks-samples.tf @@ -1,11 +1,11 @@ ##################################################################### # Block-1: Terraform Settings Block terraform { - required_version = "~> 1.4" + required_version = "~> 0.14" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.0" + version = "~> 3.0" } } # Adding Backend as S3 for Remote State Storage with State Locking diff --git a/03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests-oldv1/terraform-block.tf b/03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests-oldv1/terraform-block.tf deleted file mode 100644 index ec9b5055..00000000 --- a/03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests-oldv1/terraform-block.tf +++ /dev/null @@ -1,32 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14.3" - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - random = { - source = "hashicorp/random" - version = "3.0.1" - } - } -} - -/* -Play with Terraform Version - required_version = "~> 0.14.3" - required_version = "= 0.14.4" - required_version = ">= 0.13" - required_version = "= 0.13" - required_version = "~> 0.13" - - -Play with Provider Version - version = "~> 3.0" - version = ">= 3.0.0, < 3.1.0" - version = ">= 3.0.0, <= 3.1.0" - version = "~> 2.0" - version = "~> 3.0" -*/ - diff --git a/03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests/terraform-block.tf b/03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests/terraform-block.tf index eb7d770b..ec9b5055 100644 --- a/03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests/terraform-block.tf +++ b/03-Terraform-Fundamental-Blocks/03-01-Terraform-Block/terraform-manifests/terraform-block.tf @@ -1,14 +1,14 @@ # Terraform Block terraform { - required_version = ">= 1.4.1" + required_version = "~> 0.14.3" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.0" + version = "~> 3.0" } random = { source = "hashicorp/random" - version = "3.4.3" + version = "3.0.1" } } } diff --git a/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c1-versions.tf b/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 35c6c2bf..00000000 --- a/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14.6" - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} - -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c2-vpc.tf b/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c2-vpc.tf deleted file mode 100644 index b45c274d..00000000 --- a/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests-oldv1/c2-vpc.tf +++ /dev/null @@ -1,8 +0,0 @@ -# Resource Block -# Resource-1: Create VPC -resource "aws_vpc" "myvpc" { - cidr_block = "10.0.0.0/16" - tags = { - "Name" = "myvpc" - } -} diff --git a/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests/c1-versions.tf b/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests/c1-versions.tf index 4bbedc4e..35c6c2bf 100644 --- a/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests/c1-versions.tf +++ b/03-Terraform-Fundamental-Blocks/03-02-Provider-Block/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4.1" + required_version = "~> 0.14.6" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.0" + version = "~> 3.0" } } } diff --git a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c1-versions.tf b/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index c53c441c..00000000 --- a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,25 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14.6" - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider-1 for us-east-1 (Default Provider) -provider "aws" { - region = "us-east-1" - profile = "default" -} - -# Provider-2 for us-west-1 -provider "aws" { - region = "us-west-1" - profile = "default" - alias = "aws-west-1" -} - - diff --git a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c2-vpc-us-east-1.tf b/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c2-vpc-us-east-1.tf deleted file mode 100644 index eea9958c..00000000 --- a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c2-vpc-us-east-1.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Resource Block to Create VPC in us-east-1 which uses default provider -resource "aws_vpc" "vpc-us-east-1" { - cidr_block = "10.1.0.0/16" - tags = { - "Name" = "vpc-us-east-1" - } -} diff --git a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c3-vpc-us-west-1.tf b/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c3-vpc-us-west-1.tf deleted file mode 100644 index 8974f5a2..00000000 --- a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests-oldv1/c3-vpc-us-west-1.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Resource Block to Create VPC in us-west-1 -resource "aws_vpc" "vpc-us-west-1" { - cidr_block = "10.1.0.0/16" - provider = aws.aws-west-1 - tags = { - "Name" = "vpc-us-west-1" - } -} - - -/* -Additional Note: -provider = . # This is a Meta-Argument from Resources Section nothing but a Special Argument -*/ \ No newline at end of file diff --git a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests/c1-versions.tf b/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests/c1-versions.tf index ffc2fd1b..c53c441c 100644 --- a/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests/c1-versions.tf +++ b/03-Terraform-Fundamental-Blocks/03-03-Multiple-Provider-Configurations/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4.1" + required_version = "~> 0.14.6" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.0" + version = "~> 3.0" } } } diff --git a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl b/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl deleted file mode 100644 index 33acaed2..00000000 --- a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl +++ /dev/null @@ -1,40 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "2.50.0" - constraints = ">= 2.0.0" - hashes = [ - "h1:aKw4NLrMEAflsl1OXCCz6Ewo4ay9dpgSpkNHujRXXO8=", - "zh:05be40c2d4ec798d6a64bdc9fa9de4c994cf8fe47997368bc0ce40120985b7a0", - "zh:14752329e73c68b63b68f971caaaf5248ceea9f2cdc166b3897d46ce96f25548", - "zh:291121fd0153945f5e21411ee5625b6ec688344af2afef193d1243a0762b3064", - "zh:49488c0d0fd6412f8e877c5b8839da13371dac87491c3bfae484ce9d7be67007", - "zh:5a8f55012dc61cb98ac116b09f2b1fe68a96174ba892ee1bae90e3137b779a5d", - "zh:77b68e5401c4977de5f172005f00dcfa724eb8ca938bd109bc74024c9550cb65", - "zh:8f0b3af9db522f92cdb93eec28c340c00b0679357b715eee70fc3f3777c26747", - "zh:9170bd7ef9a37bc960233bd9957ef46e1495b56bd329be4b0b578bfc744d5f0e", - "zh:a66344e70ad954529c395e2b58fe491d5cc27991654852a66c9a3572a4d48c6f", - "zh:b63e986afec187d6f708a37b64845d8e908c597902efe4eae7148ef07fa8aff5", - "zh:fcc6e9a1f8df9b8cde3d8bcb917294dd9b9283b6bb8db6435ad02fb9ff1fe410", - "zh:fdeaf059f86d0ab59cf68ece2e8cec522b506c47e2cfca7ba6125b1cd06b8680", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.0.0" - constraints = "3.0.0" - hashes = [ - "h1:yhHJpb4IfQQfuio7qjUXuUFTU/s+ensuEpm23A+VWz0=", - "zh:0fcb00ff8b87dcac1b0ee10831e47e0203a6c46aafd76cb140ba2bab81f02c6b", - "zh:123c984c0e04bad910c421028d18aa2ca4af25a153264aef747521f4e7c36a17", - "zh:287443bc6fd7fa9a4341dec235589293cbcc6e467a042ae225fd5d161e4e68dc", - "zh:2c1be5596dd3cca4859466885eaedf0345c8e7628503872610629e275d71b0d2", - "zh:684a2ef6f415287944a3d966c4c8cee82c20e393e096e2f7cdcb4b2528407f6b", - "zh:7625ccbc6ff17c2d5360ff2af7f9261c3f213765642dcd84e84ae02a3768fd51", - "zh:9a60811ab9e6a5bfa6352fbb943bb530acb6198282a49373283a8fa3aa2b43fc", - "zh:c73e0eaeea6c65b1cf5098b101d51a2789b054201ce7986a6d206a9e2dacaefd", - "zh:e8f9ed41ac83dbe407de9f0206ef1148204a0d51ba240318af801ffb3ee5f578", - "zh:fbdd0684e62563d3ac33425b0ac9439d543a3942465f4b26582bcfabcb149515", - ] -} diff --git a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl-ORIGINAL b/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl-ORIGINAL deleted file mode 100755 index f990c81b..00000000 --- a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/.terraform.lock.hcl-ORIGINAL +++ /dev/null @@ -1,40 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "2.50.0" - constraints = ">= 2.0.0" - hashes = [ - "h1:aKw4NLrMEAflsl1OXCCz6Ewo4ay9dpgSpkNHujRXXO8=", - "zh:05be40c2d4ec798d6a64bdc9fa9de4c994cf8fe47997368bc0ce40120985b7a0", - "zh:14752329e73c68b63b68f971caaaf5248ceea9f2cdc166b3897d46ce96f25548", - "zh:291121fd0153945f5e21411ee5625b6ec688344af2afef193d1243a0762b3064", - "zh:49488c0d0fd6412f8e877c5b8839da13371dac87491c3bfae484ce9d7be67007", - "zh:5a8f55012dc61cb98ac116b09f2b1fe68a96174ba892ee1bae90e3137b779a5d", - "zh:77b68e5401c4977de5f172005f00dcfa724eb8ca938bd109bc74024c9550cb65", - "zh:8f0b3af9db522f92cdb93eec28c340c00b0679357b715eee70fc3f3777c26747", - "zh:9170bd7ef9a37bc960233bd9957ef46e1495b56bd329be4b0b578bfc744d5f0e", - "zh:a66344e70ad954529c395e2b58fe491d5cc27991654852a66c9a3572a4d48c6f", - "zh:b63e986afec187d6f708a37b64845d8e908c597902efe4eae7148ef07fa8aff5", - "zh:fcc6e9a1f8df9b8cde3d8bcb917294dd9b9283b6bb8db6435ad02fb9ff1fe410", - "zh:fdeaf059f86d0ab59cf68ece2e8cec522b506c47e2cfca7ba6125b1cd06b8680", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.0.0" - constraints = "3.0.0" - hashes = [ - "h1:yhHJpb4IfQQfuio7qjUXuUFTU/s+ensuEpm23A+VWz0=", - "zh:0fcb00ff8b87dcac1b0ee10831e47e0203a6c46aafd76cb140ba2bab81f02c6b", - "zh:123c984c0e04bad910c421028d18aa2ca4af25a153264aef747521f4e7c36a17", - "zh:287443bc6fd7fa9a4341dec235589293cbcc6e467a042ae225fd5d161e4e68dc", - "zh:2c1be5596dd3cca4859466885eaedf0345c8e7628503872610629e275d71b0d2", - "zh:684a2ef6f415287944a3d966c4c8cee82c20e393e096e2f7cdcb4b2528407f6b", - "zh:7625ccbc6ff17c2d5360ff2af7f9261c3f213765642dcd84e84ae02a3768fd51", - "zh:9a60811ab9e6a5bfa6352fbb943bb530acb6198282a49373283a8fa3aa2b43fc", - "zh:c73e0eaeea6c65b1cf5098b101d51a2789b054201ce7986a6d206a9e2dacaefd", - "zh:e8f9ed41ac83dbe407de9f0206ef1148204a0d51ba240318af801ffb3ee5f578", - "zh:fbdd0684e62563d3ac33425b0ac9439d543a3942465f4b26582bcfabcb149515", - ] -} \ No newline at end of file diff --git a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c1-versions.tf b/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c1-versions.tf deleted file mode 100644 index afd55097..00000000 --- a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c1-versions.tf +++ /dev/null @@ -1,23 +0,0 @@ -# Terraform Settings Block -terraform { - # Terraform Version - required_version = "~> 0.14.6" - required_providers { - # AWS Provider - aws = { - source = "hashicorp/aws" - version = ">= 2.0.0" - } - # Random Provider - random = { - source = "hashicorp/random" - version = "3.0.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" # Defining it for default profile is Optional -} \ No newline at end of file diff --git a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c2-s3bucket.tf b/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c2-s3bucket.tf deleted file mode 100644 index 83e740ba..00000000 --- a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests-old-v1/c2-s3bucket.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Resource Block: Create Random Pet Name -resource "random_pet" "petname" { - length = 5 - separator = "-" -} - -# Resource Block: Create AWS S3 Bucket -resource "aws_s3_bucket" "sample" { - bucket = random_pet.petname.id - acl = "public-read" - region = "us-east-1" # Comment this if we are going to use AWS Provider v3.x version -} diff --git a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests/c1-versions.tf b/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests/c1-versions.tf index 3d24f710..afd55097 100644 --- a/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests/c1-versions.tf +++ b/03-Terraform-Fundamental-Blocks/03-04-Providers-Dependency-Lock-File/terraform-manifests/c1-versions.tf @@ -1,7 +1,7 @@ # Terraform Settings Block terraform { # Terraform Version - required_version = ">= 1.4.1" + required_version = "~> 0.14.6" required_providers { # AWS Provider aws = { diff --git a/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c1-versions.tf b/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index e9cfb257..00000000 --- a/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,15 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" -} diff --git a/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c2-ec2-instance.tf b/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c2-ec2-instance.tf deleted file mode 100644 index 3a0b2a5c..00000000 --- a/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests-oldv1/c2-ec2-instance.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Create EC2 Instance -# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance - -resource "aws_instance" "my-ec2-vm" { - ami = "ami-047a51fa27710816e" - instance_type = "t2.micro" - availability_zone = "us-east-1a" - #availability_zone = "us-east-1b" - tags = { - "Name" = "web" - #"tag1" = "Update-test-1" - } -} - diff --git a/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests/c1-versions.tf b/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests/c1-versions.tf index e0f580f9..e9cfb257 100644 --- a/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests/c1-versions.tf +++ b/04-Terraform-Resources/04-01-Resource-Syntax-and-Behavior/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/README.md b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/README.md index cb69ca6f..c1cac773 100644 --- a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/README.md +++ b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/README.md @@ -25,11 +25,11 @@ ``` # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14.6" required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 4.0" + aws = { + source = "hashicorp/aws" + version = "~> 3.0" } } } diff --git a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/apache-install.sh b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index b30cd785..00000000 --- a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo service httpd start -sudo systemctl enable httpd -#echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html \ No newline at end of file diff --git a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c1-versions.tf b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index c337f26e..00000000 --- a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14.6" # which means >= 0.14.6 and < 0.15 - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c2-vpc.tf b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c2-vpc.tf deleted file mode 100644 index e11befc2..00000000 --- a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c2-vpc.tf +++ /dev/null @@ -1,70 +0,0 @@ -# Resources Block -# Resource-1: Create VPC -resource "aws_vpc" "vpc-dev" { - cidr_block = "10.0.0.0/16" - tags = { - "Name" = "vpc-dev" - } -} - -# Resource-2: Create Subnets -resource "aws_subnet" "vpc-dev-public-subnet-1" { - vpc_id = aws_vpc.vpc-dev.id - cidr_block = "10.0.1.0/24" - availability_zone = "us-east-1a" - map_public_ip_on_launch = true -} - -# Resource-3: Internet Gateway -resource "aws_internet_gateway" "vpc-dev-igw" { - vpc_id = aws_vpc.vpc-dev.id -} - -# Resource-4: Create Route Table -resource "aws_route_table" "vpc-dev-public-route-table" { - vpc_id = aws_vpc.vpc-dev.id -} - -# Resource-5: Create Route in Route Table for Internet Access -resource "aws_route" "vpc-dev-public-route" { - route_table_id = aws_route_table.vpc-dev-public-route-table.id - destination_cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.vpc-dev-igw.id -} - -# Resource-6: Associate the Route Table with the Subnet -resource "aws_route_table_association" "vpc-dev-public-route-table-associate" { - route_table_id = aws_route_table.vpc-dev-public-route-table.id - subnet_id = aws_subnet.vpc-dev-public-subnet-1.id -} - -# Resource-7: Create Security Group -resource "aws_security_group" "dev-vpc-sg" { - name = "dev-vpc-default-sg" - description = "Dev VPC Default Security Group" - vpc_id = aws_vpc.vpc-dev.id - - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports Outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} diff --git a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c3-ec2-instance.tf b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c3-ec2-instance.tf deleted file mode 100644 index c504b90b..00000000 --- a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c3-ec2-instance.tf +++ /dev/null @@ -1,23 +0,0 @@ -# Resource-8: Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = "ami-047a51fa27710816e" # Amazon Linux - instance_type = "t2.micro" - key_name = "terraform-key" - subnet_id = aws_subnet.vpc-dev-public-subnet-1.id - vpc_security_group_ids = [aws_security_group.dev-vpc-sg.id] - #user_data = file("apache-install.sh") - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - tags = { - "Name" = "myec2vm" - } -} - - - diff --git a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c4-elastic-ip.tf b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c4-elastic-ip.tf deleted file mode 100644 index f17ea230..00000000 --- a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests-oldv1/c4-elastic-ip.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Resource-9: Create Elastic IP -resource "aws_eip" "my-eip" { - instance = aws_instance.my-ec2-vm.id - vpc = true - # Meta-Argument - depends_on = [aws_internet_gateway.vpc-dev-igw] -} diff --git a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests/c1-versions.tf b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests/c1-versions.tf index 397e9079..c337f26e 100644 --- a/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests/c1-versions.tf +++ b/04-Terraform-Resources/04-02-Meta-Argument-depends_on/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14.6" # which means >= 0.14.6 and < 0.15 required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/04-Terraform-Resources/04-03-Meta-Argument-count/README.md b/04-Terraform-Resources/04-03-Meta-Argument-count/README.md index 9245775a..a8958ccc 100644 --- a/04-Terraform-Resources/04-03-Meta-Argument-count/README.md +++ b/04-Terraform-Resources/04-03-Meta-Argument-count/README.md @@ -67,7 +67,7 @@ terraform apply ## Step-04: Destroy Terraform Resources -```t +``` # Destroy Terraform Resources terraform destroy diff --git a/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c1-versions.tf b/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index c99fa143..00000000 --- a/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c2-ec2-instance.tf b/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c2-ec2-instance.tf deleted file mode 100644 index 09bd6cc8..00000000 --- a/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests-oldv1/c2-ec2-instance.tf +++ /dev/null @@ -1,10 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "web" { - ami = "ami-047a51fa27710816e" # Amazon Linux - instance_type = "t2.micro" - count = 5 - tags = { - "Name" = "web" - #"Name" = "web-${count.index}" - } -} diff --git a/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests/c1-versions.tf b/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests/c1-versions.tf index 397e9079..c99fa143 100644 --- a/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests/c1-versions.tf +++ b/04-Terraform-Resources/04-03-Meta-Argument-count/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/README.md b/04-Terraform-Resources/04-04-Meta-Argument-for_each/README.md index 9d16d3cb..9a3c3474 100644 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/README.md +++ b/04-Terraform-Resources/04-04-Meta-Argument-for_each/README.md @@ -11,29 +11,24 @@ - **c2-s3bucket.tf** ```t # Create S3 Bucket per environment with for_each and maps -# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket - resource "aws_s3_bucket" "mys3bucket" { - # for_each Meta-Argument for_each = { - dev = "my-dapp-bucket" - qa = "my-qapp-bucket" - stag = "my-sapp-bucket" - prod = "my-papp-bucket" - } + dev = "my-dapp-bucket" + qa = "my-qapp-bucket" + stag = "my-sapp-bucket" + prod = "my-papp-bucket" + } bucket = "${each.key}-${each.value}" - #acl = "private" # This argument is deprecated, so commenting it. - + acl = "private" tags = { + eachvalue = each.value Environment = each.key bucketname = "${each.key}-${each.value}" - eachvalue = each.value } } - ``` ## Step-03: Execute Terraform Commands diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c1-versions.tf b/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c1-versions.tf deleted file mode 100644 index c99fa143..00000000 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c2-s3bucket.tf b/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c2-s3bucket.tf deleted file mode 100644 index 5b898f95..00000000 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v1-for_each-maps/c2-s3bucket.tf +++ /dev/null @@ -1,22 +0,0 @@ -# Create S3 Bucket per environment with for_each and maps -# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket - -resource "aws_s3_bucket" "mys3bucket" { - - # for_each Meta-Argument - for_each = { - dev = "my-dapp-bucket" - qa = "my-qapp-bucket" - stag = "my-sapp-bucket" - prod = "my-papp-bucket" - } - - bucket = "${each.key}-${each.value}" - acl = "private" - - tags = { - Environment = each.key - bucketname = "${each.key}-${each.value}" - eachvalue = each.value - } -} diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c1-versions.tf b/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c1-versions.tf deleted file mode 100644 index c99fa143..00000000 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c2-iamuser.tf b/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c2-iamuser.tf deleted file mode 100644 index 233e507a..00000000 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/oldv1-backup/v2-for_each-toset/c2-iamuser.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Create 4 IAM Users -# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user - -resource "aws_iam_user" "myuser" { - for_each = toset(["TJack", "TJames", "TMadhu", "TDave"]) - name = each.key -} diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c1-versions.tf b/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c1-versions.tf index 397e9079..c99fa143 100644 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c1-versions.tf +++ b/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c2-s3bucket.tf b/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c2-s3bucket.tf index f33f28d5..5b898f95 100644 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c2-s3bucket.tf +++ b/04-Terraform-Resources/04-04-Meta-Argument-for_each/v1-for_each-maps/c2-s3bucket.tf @@ -12,8 +12,7 @@ resource "aws_s3_bucket" "mys3bucket" { } bucket = "${each.key}-${each.value}" - #acl = "private" # This argument is deprecated, so commenting it. - + acl = "private" tags = { Environment = each.key diff --git a/04-Terraform-Resources/04-04-Meta-Argument-for_each/v2-for_each-toset/c1-versions.tf b/04-Terraform-Resources/04-04-Meta-Argument-for_each/v2-for_each-toset/c1-versions.tf index 397e9079..c99fa143 100644 --- a/04-Terraform-Resources/04-04-Meta-Argument-for_each/v2-for_each-toset/c1-versions.tf +++ b/04-Terraform-Resources/04-04-Meta-Argument-for_each/v2-for_each-toset/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c1-versions.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c1-versions.tf deleted file mode 100644 index c99fa143..00000000 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c2-ec2-instance.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c2-ec2-instance.tf deleted file mode 100644 index 4b5539a4..00000000 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v1-create_before_destroy/c2-ec2-instance.tf +++ /dev/null @@ -1,15 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "web" { - ami = "ami-0915bcb5fa77e4892" # Amazon Linux - instance_type = "t2.micro" - availability_zone = "us-east-1a" - #availability_zone = "us-east-1b" - tags = { - "Name" = "web-1" - } - /* - lifecycle { - create_before_destroy = true - } -*/ -} diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c1-versions.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c1-versions.tf deleted file mode 100644 index c99fa143..00000000 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c2-ec2-instance.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c2-ec2-instance.tf deleted file mode 100644 index b296a02b..00000000 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v2-prevent_destroy/c2-ec2-instance.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "web" { - ami = "ami-0915bcb5fa77e4892" # Amazon Linux - instance_type = "t2.micro" - tags = { - "Name" = "web-2" - } - lifecycle { - prevent_destroy = true # Default is false - } -} - diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c1-versions.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c1-versions.tf deleted file mode 100644 index c99fa143..00000000 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c2-ec2-instance.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c2-ec2-instance.tf deleted file mode 100644 index d2828ec2..00000000 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/oldv1-backup/v3-ignore_changes/c2-ec2-instance.tf +++ /dev/null @@ -1,17 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "web" { - ami = "ami-0915bcb5fa77e4892" # Amazon Linux - instance_type = "t2.micro" - tags = { - "Name" = "web-3" - } -/* - lifecycle { - ignore_changes = [ - # Ignore changes to tags, e.g. because a management agent - # updates these based on some ruleset managed elsewhere. - tags, - ] - }*/ -} - diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v1-create_before_destroy/c1-versions.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v1-create_before_destroy/c1-versions.tf index 397e9079..c99fa143 100644 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v1-create_before_destroy/c1-versions.tf +++ b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v1-create_before_destroy/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v2-prevent_destroy/c1-versions.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v2-prevent_destroy/c1-versions.tf index 6b57c6e1..c99fa143 100644 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v2-prevent_destroy/c1-versions.tf +++ b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v2-prevent_destroy/c1-versions.tf @@ -1,13 +1,14 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } + # Provider Block provider "aws" { region = "us-east-1" diff --git a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v3-ignore_changes/c1-versions.tf b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v3-ignore_changes/c1-versions.tf index 397e9079..c99fa143 100644 --- a/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v3-ignore_changes/c1-versions.tf +++ b/04-Terraform-Resources/04-05-Meta-Argument-lifecycle/v3-ignore_changes/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/apache-install.sh b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/apache-install.sh deleted file mode 100644 index 69bcae96..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -sudo yum update -y -sudo yum install httpd -y -sudo systemctl enable httpd -sudo systemctl start httpd -echo "
Welcome to StackSimplify ! AWS Infra created using Terraform
" > /var/www/html/index.html diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c2-variables.tf deleted file mode 100644 index 12cf7706..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c2-variables.tf +++ /dev/null @@ -1,18 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 1 -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c4-ec2-instance.tf deleted file mode 100644 index 3fd9c993..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v1-Input-Variables-Basic/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = "t3.micro" - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c2-variables.tf deleted file mode 100644 index dfe8ba6a..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c2-variables.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "db_username" { - description = "AWS RDS Database Administrator Username" - type = string - sensitive = true -} - -variable "db_password" { - description = "AWS RDS Database Administrator Password" - type = string - sensitive = true -} - - - diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c3-rds-db.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c3-rds-db.tf deleted file mode 100644 index b94dfccf..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/c3-rds-db.tf +++ /dev/null @@ -1,11 +0,0 @@ -# Warning: Never check sensitive values like usernames and passwords into source control. -# Create RDS MySQL Database -resource "aws_db_instance" "db1" { - allocated_storage = 5 - engine = "mysql" - instance_class = "db.t2.micro" - name = "mydb1" - username = var.db_username - password = var.db_password - skip_final_snapshot = true -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/secrets.tfvars b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/secrets.tfvars deleted file mode 100644 index df596ce0..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v10-Sensitive-Input-Variables/secrets.tfvars +++ /dev/null @@ -1,2 +0,0 @@ -db_username = "admin" -db_password = "insecurepassword" \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/apache-install.sh b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c2-variables.tf deleted file mode 100644 index fc370401..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 1 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c4-ec2-instance.tf deleted file mode 100644 index 248366bd..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v11-File-Function/c4-ec2-instance.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = file("apache-install.sh") - /* - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "
Welcome to StackSimplify ! AWS Infra created using Terraform
" > /var/www/html/index.html - EOF - */ - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "web" - } -} - - diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c2-variables.tf deleted file mode 100644 index 2b5006c8..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 1 -} - -# Assign When Prompted using CLI -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c4-ec2-instance.tf deleted file mode 100644 index 41cf3c38..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v2-Input-Variables-Assign-when-prompted/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c2-variables.tf deleted file mode 100644 index 1032f611..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 2 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c4-ec2-instance.tf deleted file mode 100644 index 41cf3c38..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v3-Input-Variables-Override-default-with-cli-var/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c2-variables.tf deleted file mode 100644 index 1032f611..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 2 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c4-ec2-instance.tf deleted file mode 100644 index 41cf3c38..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v4-Input-Variables-Override-with-Environment-Variables/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c2-variables.tf deleted file mode 100644 index 1032f611..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 2 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c4-ec2-instance.tf deleted file mode 100644 index 41cf3c38..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/terraform.tfvars b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/terraform.tfvars deleted file mode 100644 index 0265af26..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v5-Input-Variables-Assign-with-terraform-tfvars/terraform.tfvars +++ /dev/null @@ -1,2 +0,0 @@ -ec2_instance_count = 1 -ec2_instance_type = "t3.small" \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/app.tfvars b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/app.tfvars deleted file mode 100644 index a555fec4..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/app.tfvars +++ /dev/null @@ -1 +0,0 @@ -ec2_instance_type = "t3.xlarge" \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c2-variables.tf deleted file mode 100644 index 1032f611..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 2 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c4-ec2-instance.tf deleted file mode 100644 index 41cf3c38..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/terraform.tfvars b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/terraform.tfvars deleted file mode 100644 index bb77eafa..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/terraform.tfvars +++ /dev/null @@ -1 +0,0 @@ -ec2_instance_count = 1 diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/web.tfvars b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/web.tfvars deleted file mode 100644 index ebb5fe3f..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v6-Input-Variables-Assign-with-tfvars-var-file/web.tfvars +++ /dev/null @@ -1 +0,0 @@ -ec2_instance_type = "t3.large" \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf deleted file mode 100644 index e33a7dd1..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ - diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c2-variables.tf deleted file mode 100644 index 1032f611..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 2 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c4-ec2-instance.tf deleted file mode 100644 index 41cf3c38..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/terraform.tfvars b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/terraform.tfvars deleted file mode 100644 index bb77eafa..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/terraform.tfvars +++ /dev/null @@ -1 +0,0 @@ -ec2_instance_count = 1 diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/web.auto.tfvars b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/web.auto.tfvars deleted file mode 100644 index a555fec4..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v7-Input-Variables-Assign-with-auto-tfvars/web.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -ec2_instance_type = "t3.xlarge" \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c2-variables.tf deleted file mode 100644 index 2955b1f1..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c2-variables.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 2 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = list(string) - default = ["t3.micro", "t3.small", "t3.large"] -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c4-ec2-instance.tf deleted file mode 100644 index 9cb72ad3..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-01-Input-Variables-Lists/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type[0] - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c2-variables.tf deleted file mode 100644 index 791581f6..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c2-variables.tf +++ /dev/null @@ -1,46 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 2 -} - -/* -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = list(string) - default = ["t3.micro", "t3.small", "t3.large"] -} -*/ - - -variable "ec2_instance_tags" { - description = "EC2 Instance Tags" - type = map(string) - default = { - "Name" = "ec2-web" - "Tier" = "Web" - } -} - -variable "ec2_instance_type_map" { - description = "EC2 Instance Type" - type = map(string) - default = { - "small-apps" = "t3.micro" - "medium-apps" = "t3.medium" - "big-apps" = "t3.large" - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c4-ec2-instance.tf deleted file mode 100644 index 6aedd44b..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v8-02-Input-Variables-Maps/c4-ec2-instance.tf +++ /dev/null @@ -1,18 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - #instance_type = var.ec2_instance_type[0] - instance_type = var.ec2_instance_type_map["big-apps"] - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = var.ec2_instance_tags -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c2-variables.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c2-variables.tf deleted file mode 100644 index fbce3a92..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c2-variables.tf +++ /dev/null @@ -1,28 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" # Amazon2 Linux AMI ID - validation { - condition = length(var.ec2_ami_id) > 4 && substr(var.ec2_ami_id, 0, 4) == "ami-" - error_message = "The ec2_ami_id value must be a valid AMI id, starting with \"ami-\"." - } -} - -variable "ec2_instance_count" { - description = "EC2 Instance Count" - type = number - default = 1 -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c3-security-groups.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c4-ec2-instance.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c4-ec2-instance.tf deleted file mode 100644 index 41cf3c38..00000000 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/Oldv1-backup/v9-Input-Variables-Validation-Rules/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - count = var.ec2_instance_count - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" > /var/www/html/index.html - EOF - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "myec2vm" - } -} diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/README.md b/05-Terraform-Variables/05-01-Terraform-Input-Variables/README.md index ac5c7412..bc31697b 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/README.md +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/README.md @@ -61,7 +61,7 @@ rm -rf terraform.tfstate* - Add a new variable in `variables.tf` named `ec2_instance_type` without any default value. - As the variable doesn't have any default value when you execute `terraform plan` or `terraform apply` it will prompt for the variable. -```t +``` # Initialize Terraform terraform init @@ -78,7 +78,7 @@ terraform plan ## Step-03: Input Variables Override default value with cli argument `-var` - **Reference Sub folder:** v3-Input-Variables-Override-default-with-cli - We are going to override the default values defined in `variables.tf` by providing new values using the `-var` argument using CLI -```t +``` # Initialize Terraform terraform init @@ -106,7 +106,7 @@ terraform apply v3out.plan ## Step-04: Input Variables Override with Environment Variables - **Reference Sub folder:** v4-Input-Variables-Override-with-Environment-Variables - Set environment variables and execute `terraform plan` to see if it overrides default values -```t +``` # Sample export TF_VAR_variable_name=value @@ -137,7 +137,7 @@ echo $TF_VAR_ec2_instance_count, $TF_VAR_ec2_instance_type - **Reference Sub folder:** v5-Input-Variables-Assign-with-terraform-tfvars - Create a file named `terraform.tfvars` and define variables - If the file name is `terraform.tfvars`, terraform will auto-load the variables present in this file by overriding the `default` values in `variables.tf` -```t +``` # Initialize Terraform terraform init @@ -165,7 +165,7 @@ http:// - **terraform.tfvars:** ec2_instance_count variable will be picked from this file - **web.tfvars:** ec2_instance_type variable will be picked from this file - **app.tfvars:** ec2_instance_type variable will be picked from this file -```t +``` # Initialize Terraform terraform init @@ -184,7 +184,7 @@ terraform plan -var-file="app.tfvars" - **Reference Sub folder:** v7-Input-Variables-Assign-with-auto-tfvars - We will create a file with extension as `.auto.tfvars`. - With this extension, whatever may be the file name, the variables inside these files will be auto loaded during `terraform plan or apply` -```t +``` # Initialize Terraform terraform init @@ -203,7 +203,7 @@ terraform plan ### Step-08-01: Implement Vairable Type as List - **list (or tuple):** a sequence of values, like ["us-west-1a", "us-west-1c"]. Elements in a list or tuple are identified by consecutive whole numbers, starting with zero. - Implement List function for variable `ec2_instance_type` -```t +``` # Implement List Function in variables.tf variable "ec2_instance_type" { description = "EC2 Instance Type" @@ -232,7 +232,7 @@ terraform plan ### Step-08-02: Implement Vairable Type as Map - **map (or object):** a group of values identified by named labels, like {name = "Mabel", age = 52}. - Implement Map function for variable `ec2_instance_tags` -```t +``` # Implement Map Function for tags variable "ec2_instance_tags" { description = "EC2 Instance Tags" @@ -312,7 +312,7 @@ substr("stack simplify", 0, 10) ``` ### Step-09-03: Implement Validation Rule for ec2_ami_id variable -```t +``` variable "ec2_ami_id" { description = "AMI ID" type = string @@ -348,7 +348,7 @@ terraform plan - Terraform will `redact` these values in command output and log files, and raise an error when it detects that they will be exposed in other ways. - **Important Note-1:** Never check-in `secrets.tfvars` to git repositories - **Important Note-2:** Terraform state file contains values for these sensitive variables `terraform.tfstate`. You must keep your state file secure to avoid exposing this data. -```t +``` # Initialize Terraform terraform init diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v1-Input-Variables-Basic/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v1-Input-Variables-Basic/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v1-Input-Variables-Basic/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v1-Input-Variables-Basic/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v10-Sensitive-Input-Variables/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v10-Sensitive-Input-Variables/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v10-Sensitive-Input-Variables/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v10-Sensitive-Input-Variables/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v11-File-Function/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v11-File-Function/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v11-File-Function/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v11-File-Function/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v2-Input-Variables-Assign-when-prompted/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v2-Input-Variables-Assign-when-prompted/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v2-Input-Variables-Assign-when-prompted/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v2-Input-Variables-Assign-when-prompted/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v3-Input-Variables-Override-default-with-cli-var/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v4-Input-Variables-Override-with-Environment-Variables/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v5-Input-Variables-Assign-with-terraform-tfvars/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v6-Input-Variables-Assign-with-tfvars-var-file/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf index 8a7391a7..e33a7dd1 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v7-Input-Variables-Assign-with-auto-tfvars/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-01-Input-Variables-Lists/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-01-Input-Variables-Lists/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-01-Input-Variables-Lists/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-01-Input-Variables-Lists/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-02-Input-Variables-Maps/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-02-Input-Variables-Maps/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-02-Input-Variables-Maps/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v8-02-Input-Variables-Maps/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v9-Input-Variables-Validation-Rules/c1-versions.tf b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v9-Input-Variables-Validation-Rules/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-01-Terraform-Input-Variables/v9-Input-Variables-Validation-Rules/c1-versions.tf +++ b/05-Terraform-Variables/05-01-Terraform-Input-Variables/v9-Input-Variables-Validation-Rules/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/apache-install.sh b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c1-versions.tf b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c2-variables.tf b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index b05e8b70..00000000 --- a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,18 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" -} - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} diff --git a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c3-security-groups.tf b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index ab637234..00000000 --- a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC Web" - - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all IP and Ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c4-ec2-instance.tf b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index df1ef37f..00000000 --- a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,23 +0,0 @@ -# Create EC2 Instance -resource "aws_instance" "my-ec2-vm" { - ami = var.ec2_ami_id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - user_data = file("apache-install.sh") - /* - user_data = <<-EOF - #!/bin/bash - sudo yum update -y - sudo yum install httpd -y - sudo systemctl enable httpd - sudo systemctl start httpd - echo "
Welcome to StackSimplify ! AWS Infra created using Terraform
" > /var/www/html/index.html - EOF - */ - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "web" - } -} - - diff --git a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c5-outputs.tf b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index aacdb0b6..00000000 --- a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Define Output Values -# Attribute Reference: EC2 Instance Public IP -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.public_ip -} - -# Argument Reference: EC2 Instance Private IP -output "ec2_instance_privateip" { - description = "EC2 Instance Private IP" - value = aws_instance.my-ec2-vm.private_ip -} -# Argument Reference: Security Groups associated to EC2 Instance -output "ec2_security_groups" { - description = "List Security Groups associated with EC2 Instance" - value = aws_instance.my-ec2-vm.security_groups -} - -# Attribute Reference - Create Public DNS URL with http:// appended -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = "http://${aws_instance.my-ec2-vm.public_dns}" - #sensitive = true #Uncomment it during step-04 execution -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests/c1-versions.tf b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests/c1-versions.tf +++ b/05-Terraform-Variables/05-02-Terraform-Output-Values/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/05-Terraform-Variables/05-03-Terraform-Local-Values/README.md b/05-Terraform-Variables/05-03-Terraform-Local-Values/README.md index 0e577d3e..b4e7f1c6 100644 --- a/05-Terraform-Variables/05-03-Terraform-Local-Values/README.md +++ b/05-Terraform-Variables/05-03-Terraform-Local-Values/README.md @@ -32,7 +32,7 @@ Another use case (at least for me) for locals is to shorten references on upstre ## Step-03: Test the Terraform configuration using commands -```t +``` # Initialize Terraform terraform init diff --git a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c1-versions.tf b/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c2-variables.tf b/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index 549df0f8..00000000 --- a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -# App Name S3 Bucket used for -variable "app_name" { - description = "Application Name" - type = string -} - -# Environment Name -variable "environment_name" { - description = "Environment Name" - type = string -} - - - diff --git a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c3-s3-bucket.tf b/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c3-s3-bucket.tf deleted file mode 100644 index 47111b7c..00000000 --- a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests-oldv1/c3-s3-bucket.tf +++ /dev/null @@ -1,26 +0,0 @@ -# Create S3 Bucket - with Input Variables -/* -resource "aws_s3_bucket" "mys3bucket" { - bucket = "${var.app_name}-${var.environment_name}-bucket" - acl = "private" - tags = { - Name = "${var.app_name}-${var.environment_name}-bucket" - Environment = var.environment_name - } -} -*/ - -# Define Local Values -locals { - bucket-name = "${var.app_name}-${var.environment_name}-bucket" # Complex expression -} - -# Create S3 Bucket - with Input Variables & Local Values -resource "aws_s3_bucket" "mys3bucket" { - bucket = local.bucket-name - acl = "private" - tags = { - Name = local.bucket-name - Environment = var.environment_name - } -} \ No newline at end of file diff --git a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests/c1-versions.tf b/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests/c1-versions.tf +++ b/05-Terraform-Variables/05-03-Terraform-Local-Values/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/06-Terraform-Datasources/README.md b/06-Terraform-Datasources/README.md index 1d969eff..14e6b082 100644 --- a/06-Terraform-Datasources/README.md +++ b/06-Terraform-Datasources/README.md @@ -18,12 +18,12 @@ - Accordingly using this information build your filters in datasource ## Step-03: Reference the datasource in ec2-instance.tf -```t +``` ami = data.aws_ami.amzlinux.id ``` ## Step-04: Test using Terraform commands -```t +``` # Initialize Terraform terraform init diff --git a/06-Terraform-Datasources/terraform-manifests-oldv1/apache-install.sh b/06-Terraform-Datasources/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/06-Terraform-Datasources/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/06-Terraform-Datasources/terraform-manifests-oldv1/c1-versions.tf b/06-Terraform-Datasources/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/06-Terraform-Datasources/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/06-Terraform-Datasources/terraform-manifests-oldv1/c2-variables.tf b/06-Terraform-Datasources/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index 02504d42..00000000 --- a/06-Terraform-Datasources/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,22 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -/* -# Commented as we are going to get AMI ID from Datasource aws_ami -variable "ec2_ami_id" { - description = "AMI ID" - type = string - default = "ami-0915bcb5fa77e4892" -} -*/ - -variable "ec2_instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} - diff --git a/06-Terraform-Datasources/terraform-manifests-oldv1/c3-security-groups.tf b/06-Terraform-Datasources/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 1ca810d6..00000000 --- a/06-Terraform-Datasources/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/06-Terraform-Datasources/terraform-manifests-oldv1/c4-ec2-instance.tf b/06-Terraform-Datasources/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index 1ff6a348..00000000 --- a/06-Terraform-Datasources/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,15 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.ec2_instance_type - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "amz-linux-vm" - } -} - - - - diff --git a/06-Terraform-Datasources/terraform-manifests-oldv1/c5-outputs.tf b/06-Terraform-Datasources/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index b94beeb7..00000000 --- a/06-Terraform-Datasources/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.public_ip -} - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.public_dns -} diff --git a/06-Terraform-Datasources/terraform-manifests-oldv1/c6-ami-datasource.tf b/06-Terraform-Datasources/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/06-Terraform-Datasources/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/06-Terraform-Datasources/terraform-manifests/c1-versions.tf b/06-Terraform-Datasources/terraform-manifests/c1-versions.tf index ac68536e..a305835c 100644 --- a/06-Terraform-Datasources/terraform-manifests/c1-versions.tf +++ b/06-Terraform-Datasources/terraform-manifests/c1-versions.tf @@ -1,15 +1,14 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } - # Provider Block provider "aws" { region = var.aws_region diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/README.md b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/README.md index 362e9bce..d9bc7530 100644 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/README.md +++ b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/README.md @@ -25,7 +25,7 @@ - **Reference Sub-folder:** terraform-manifests - [Terraform Backend as S3](https://www.terraform.io/docs/language/settings/backends/s3.html) - Add the below listed Terraform backend block in `Terrafrom Settings` block in `main.tf` -```t +``` # Terraform Backend Block backend "s3" { bucket = "terraform-stacksimplify" diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/apache-install.sh b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c1-versions.tf b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 4acfe756..00000000 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,31 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } - # Adding Backend as S3 for Remote State Storage - backend "s3" { - bucket = "terraform-stacksimplify" - key = "dev/terraform.tfstate" - region = "us-east-1" -/* - # Enable during Step-09 - # For State Locking - dynamodb_table = "terraform-dev-state-table" -*/ - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c2-variables.tf b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index c3596e08..00000000 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - #default = "t2.micro" - default = "t2.small" -} \ No newline at end of file diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c3-security-groups.tf b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 1ca810d6..00000000 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c4-ec2-instance.tf b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index 8839bb42..00000000 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,15 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "amz-linux-vm" - } -} - - - - diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c5-outputs.tf b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index b94beeb7..00000000 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.public_ip -} - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.public_dns -} diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c6-ami-datasource.tf b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests/c1-versions.tf b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests/c1-versions.tf index 1be1512b..4acfe756 100644 --- a/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests/c1-versions.tf +++ b/07-Terraform-State/07-01-Terraform-Remote-State-Storage-and-Locking/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } # Adding Backend as S3 for Remote State Storage diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/apache-install.sh b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c1-versions.tf b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index f59fe455..00000000 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,31 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } - # Adding Backend as S3 for Remote State Storage - backend "s3" { - bucket = "terraform-stacksimplify" - key = "statecommands/terraform.tfstate" - region = "us-east-1" - - # Enable during Step-09 - # For State Locking - dynamodb_table = "terraform-dev-state-table" - - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c2-variables.tf b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index c3596e08..00000000 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - #default = "t2.micro" - default = "t2.small" -} \ No newline at end of file diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c3-security-groups.tf b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index bd0899a0..00000000 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,58 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } -/* - # Enable during Step-08 - ingress { - description = "Allow Port 8080" - from_port = 8080 - to_port = 8080 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } -*/ - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c4-ec2-instance.tf b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index 52f2a141..00000000 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,29 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - #instance_type = "t2.micro" - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "amz-linux-vm" - #"demotag" = "refreshtest" # Enable during Step-04-05 - #"target" = "Target-Test-1" # Enable during step-08 - } -} - -/* -# Enable during step-08 -# New VM -resource "aws_instance" "my-demo-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - tags = { - "Name" = "demo-vm1" - } -} -*/ - - - diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c5-outputs.tf b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index b94beeb7..00000000 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.public_ip -} - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.public_dns -} diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c6-ami-datasource.tf b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests/c1-versions.tf b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests/c1-versions.tf index 0e1af35b..f59fe455 100644 --- a/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests/c1-versions.tf +++ b/07-Terraform-State/07-02-Terraform-State-Commands/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } # Adding Backend as S3 for Remote State Storage diff --git a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/apache-install.sh b/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c1-versions.tf b/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c2-variables.tf b/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c2-variables.tf deleted file mode 100644 index f55f87b6..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - default = "t2.micro" - #default = "t2.small" -} \ No newline at end of file diff --git a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c3-security-groups.tf b/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c4-ec2-instance.tf b/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c4-ec2-instance.tf deleted file mode 100644 index 458caf16..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c4-ec2-instance.tf +++ /dev/null @@ -1,16 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - count = terraform.workspace == "default" ? 2 : 1 - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "vm-${terraform.workspace}-${count.index}" - } -} - - - - diff --git a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c5-outputs.tf b/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c5-outputs.tf deleted file mode 100644 index ad086758..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c6-ami-datasource.tf b/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v1-local-backend/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/apache-install.sh b/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c1-versions.tf b/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c1-versions.tf deleted file mode 100644 index b7e50ad0..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c1-versions.tf +++ /dev/null @@ -1,29 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } - # Adding Backend as S3 for Remote State Storage - backend "s3" { - bucket = "terraform-stacksimplify" - key = "workspaces/terraform.tfstate" - region = "us-east-1" - - # For State Locking - dynamodb_table = "terraform-dev-state-table" - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c2-variables.tf b/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c2-variables.tf deleted file mode 100644 index f55f87b6..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - default = "t2.micro" - #default = "t2.small" -} \ No newline at end of file diff --git a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c3-security-groups.tf b/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c4-ec2-instance.tf b/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c4-ec2-instance.tf deleted file mode 100644 index 458caf16..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c4-ec2-instance.tf +++ /dev/null @@ -1,16 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - count = terraform.workspace == "default" ? 2 : 1 - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "vm-${terraform.workspace}-${count.index}" - } -} - - - - diff --git a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c5-outputs.tf b/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c5-outputs.tf deleted file mode 100644 index 1e4f766f..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c6-ami-datasource.tf b/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/08-Terraform-Workspaces/Oldv1-backup/v2-remote-backend/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/08-Terraform-Workspaces/v1-local-backend/c1-versions.tf b/08-Terraform-Workspaces/v1-local-backend/c1-versions.tf index cffef5ab..a305835c 100644 --- a/08-Terraform-Workspaces/v1-local-backend/c1-versions.tf +++ b/08-Terraform-Workspaces/v1-local-backend/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/08-Terraform-Workspaces/v2-remote-backend/c1-versions.tf b/08-Terraform-Workspaces/v2-remote-backend/c1-versions.tf index 91a40346..b7e50ad0 100644 --- a/08-Terraform-Workspaces/v2-remote-backend/c1-versions.tf +++ b/08-Terraform-Workspaces/v2-remote-backend/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } # Adding Backend as S3 for Remote State Storage diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apache-install.sh b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html deleted file mode 100644 index dee8257b..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html +++ /dev/null @@ -1 +0,0 @@ -

App1 File-1

diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html deleted file mode 100644 index 1036144a..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html +++ /dev/null @@ -1 +0,0 @@ -

>App1 File2

App2 File1 \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html deleted file mode 100644 index 80b269f0..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html +++ /dev/null @@ -1 +0,0 @@ -

App2 File2

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html deleted file mode 100644 index 2439bbe3..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html +++ /dev/null @@ -1 +0,0 @@ -

App2 Folder-1 File-1

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/file-copy.html b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/file-copy.html deleted file mode 100644 index 11a77278..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/apps/file-copy.html +++ /dev/null @@ -1 +0,0 @@ -

Simple file copy using Terraform File Provisioner

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c1-versions.tf b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c2-variables.tf b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index f55f87b6..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - default = "t2.micro" - #default = "t2.small" -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c3-security-groups.tf b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index 0770ed1a..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,64 +0,0 @@ -# Create EC2 Instance - Amazon2 Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - #count = terraform.workspace == "default" ? 1 : 1 - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "vm-${terraform.workspace}-0" - } -# PLAY WITH /tmp folder in EC2 Instance with File Provisioner - # Connection Block for Provisioners to connect to EC2 Instance - connection { - type = "ssh" - host = self.public_ip # Understand what is "self" - user = "ec2-user" - password = "" - private_key = file("private-key/terraform-key.pem") - } - - # Copies the file-copy.html file to /tmp/file-copy.html - provisioner "file" { - source = "apps/file-copy.html" - destination = "/tmp/file-copy.html" - } - - # Copies the string in content into /tmp/file.log - provisioner "file" { - content = "ami used: ${self.ami}" # Understand what is "self" - destination = "/tmp/file.log" - } - - # Copies the app1 folder to /tmp - FOLDER COPY - provisioner "file" { - source = "apps/app1" - destination = "/tmp" - } - - # Copies all files and folders in apps/app2 to /tmp - CONTENTS of FOLDER WILL BE COPIED - provisioner "file" { - source = "apps/app2/" # when "/" at the end is added - CONTENTS of FOLDER WILL BE COPIED - destination = "/tmp" - } - - -/* -# Enable this during Section 09-01 Step-05 - # Copies the file-copy.html file to /var/www/html/file-copy.html where ec2-user don't have permission to copy - # This provisioner will fail but we don't want to taint the resource, we want to continue on_failure - provisioner "file" { - source = "apps/file-copy.html" - destination = "/var/www/html/file-copy.html" - #on_failure = continue # Enable this during Test-2 - } -*/ -} - - - - - - - diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c5-outputs.tf b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index ad086758..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem deleted file mode 100644 index fab1eb2a..00000000 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAnzQtbXStFNU4znotckbPpAbQvymSYBvIRhObDObmhZLzs/Qm -lm57HBU18NcdAeEmKjHyu/2CI4Wwor3TJ+LTKHIldHmCt+26dSN5889Km99Af674 -nuPg9fTt8IXhY83aO0AeEnFivC+lk9+6Xezv7J7Llsmyx3kvUGE4uUEPNPuNcjdU -OrSlQ/Th9FPWBsTL8wLQCfQaPIQhZT8fXnvNGViTpZ/YqcoKGmkXcMl/+Pi0Xccs -ID3Egl18sV5uWr6T1DSMqhhwWYbl+IagZYUeKQ6Lg5znAtnX2/OHhDep6pGcf+aE -jbRkhQWgfLIVYhNXkAGxdxBEA2fQO0wvnaKI6wIDAQABAoIBABmUZqApmQ253LDA -TMEJw58VQUEVyuEKVbl8uPLvvqZDoEiPuAt/oOQ4PDyAM7bzmBA7ikbOSrSubF0Z -pu3HsinTfVUjmO84kTb1Bkk4S0KUMmbRlDzjXGfofLqiqD5C+wd+G9bWxQh7l10V -G3qv8TTRpuCJc+I9BG8jz9tkKq9WYtnGKXktVIAmEXK+ein8A5yj+szV1CyP0y6Y -6D1KApk+o1hLEXCBxaK6JgD4elJWgU0jCIhRFZzae93yozNIfJc2WZfPc8Ro6GBa -8H57q3E241P7S65VewhZlln9AUcRFYc587ohcCIW8mOWQ8NA3IMP+oVxa2p334Ll -duhR2jECgYEAyf7a1/+/c82B+ENyo53Y5CK2UM28oOJjiyCaWG2Dxj6V2+ZSXPrS -YTo43L9XiqT0Ry2eHjb4pJDsEeW5FnaDFO6NVUP+vfzaqWtozQmVAl3GQybbSh6g -+KJoEQff2Obadp9ZVhLFTiBedvGqPD43hs7jtmk5RfMjpLOvidfe+/UCgYEAycSJ -etYYHMMQm2NgX1/4dcbgOiu33N+x1H7LaXuvJMaZw0wB7fUyu65CAexEanDtiKs3 -jVG4tAzdMmHg7VxKR7eiCvQaSlxdWdcWtL2eFVq2TaQeowbpJUtsR0h6W0vpaN9A -VYW/oAH4fzQskwmWSlBMxB/Ie14hBCBckTXSRV8CgYEAql6WXpCK/jVbZfYdfvrn -sKPGeijM7DWGGBaLmAHmnxKyeyKsXVgAkZj11NpeD8ZJcq97Kajb1pGVSxMjJVsX -/FOoST5sYfoew76gSi/GypQlYQYo9z8WLh9s/tBRcTRlFqAYTYzPdbG/ezshhmZD -lyRw0620bNdCPOyBJhY5MPECgYA/3tFOazuSz0UQi3LUfkLetagBghlf+AgJJmIp -8BdPYvcF1ae+tiHrO4x1o188+qaW3uxk9fusM25KJqXXPaHd9gl7wi4YYAjFCcuM -R4IlbGPNTCjOnr9rKOcL4aup/uvSYOmyqPYyJq2NRuzdVumWeLj0VMNYGkIFVmE3 -LnxzrQKBgG5loEjdSKt40YOMXtYvUYUKDGvWgoQEb0hj3OqiBXz+w4YD3/iX7dbQ -qra1gCxE42Z9beiBiti6zi6zGcoVj/pfNUoyxTLMSwaytbF+g1u6ksXcmC9PXcmk -kJDR0DJcm/rcL8tp3PKo22GDB7sobm9gk5je6y8z+dQs3SQbWzb0 ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests/c1-versions.tf b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests/c1-versions.tf +++ b/09-Terraform-Provisioners/09-01-File-Provisioner/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apache-install.sh b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html deleted file mode 100644 index dee8257b..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html +++ /dev/null @@ -1 +0,0 @@ -

App1 File-1

diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html deleted file mode 100644 index 1036144a..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html +++ /dev/null @@ -1 +0,0 @@ -

>App1 File2

App2 File1 \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html deleted file mode 100644 index 80b269f0..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html +++ /dev/null @@ -1 +0,0 @@ -

App2 File2

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html deleted file mode 100644 index 2439bbe3..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html +++ /dev/null @@ -1 +0,0 @@ -

App2 Folder-1 File-1

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html deleted file mode 100644 index 11a77278..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html +++ /dev/null @@ -1 +0,0 @@ -

Simple file copy using Terraform File Provisioner

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index f55f87b6..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - default = "t2.micro" - #default = "t2.small" -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index b70cf60c..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,44 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - #count = terraform.workspace == "default" ? 1 : 1 - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "vm-${terraform.workspace}-0" - } - - # Connection Block for Provisioners to connect to EC2 Instance - connection { - type = "ssh" - host = self.public_ip # Understand what is "self" - user = "ec2-user" - password = "" - private_key = file("private-key/terraform-key.pem") - } - - # Copies the file-copy.html file to /tmp/file-copy.html - provisioner "file" { - source = "apps/file-copy.html" - destination = "/tmp/file-copy.html" - } - -# Copies the file to Apache Webserver /var/www/html directory - provisioner "remote-exec" { - inline = [ - "sleep 120", # Will sleep for 120 seconds to ensure Apache webserver is provisioned using user_data - "sudo cp /tmp/file-copy.html /var/www/html" - ] - } - - -} - - - - - - - diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index 1e4f766f..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem deleted file mode 100644 index fab1eb2a..00000000 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAnzQtbXStFNU4znotckbPpAbQvymSYBvIRhObDObmhZLzs/Qm -lm57HBU18NcdAeEmKjHyu/2CI4Wwor3TJ+LTKHIldHmCt+26dSN5889Km99Af674 -nuPg9fTt8IXhY83aO0AeEnFivC+lk9+6Xezv7J7Llsmyx3kvUGE4uUEPNPuNcjdU -OrSlQ/Th9FPWBsTL8wLQCfQaPIQhZT8fXnvNGViTpZ/YqcoKGmkXcMl/+Pi0Xccs -ID3Egl18sV5uWr6T1DSMqhhwWYbl+IagZYUeKQ6Lg5znAtnX2/OHhDep6pGcf+aE -jbRkhQWgfLIVYhNXkAGxdxBEA2fQO0wvnaKI6wIDAQABAoIBABmUZqApmQ253LDA -TMEJw58VQUEVyuEKVbl8uPLvvqZDoEiPuAt/oOQ4PDyAM7bzmBA7ikbOSrSubF0Z -pu3HsinTfVUjmO84kTb1Bkk4S0KUMmbRlDzjXGfofLqiqD5C+wd+G9bWxQh7l10V -G3qv8TTRpuCJc+I9BG8jz9tkKq9WYtnGKXktVIAmEXK+ein8A5yj+szV1CyP0y6Y -6D1KApk+o1hLEXCBxaK6JgD4elJWgU0jCIhRFZzae93yozNIfJc2WZfPc8Ro6GBa -8H57q3E241P7S65VewhZlln9AUcRFYc587ohcCIW8mOWQ8NA3IMP+oVxa2p334Ll -duhR2jECgYEAyf7a1/+/c82B+ENyo53Y5CK2UM28oOJjiyCaWG2Dxj6V2+ZSXPrS -YTo43L9XiqT0Ry2eHjb4pJDsEeW5FnaDFO6NVUP+vfzaqWtozQmVAl3GQybbSh6g -+KJoEQff2Obadp9ZVhLFTiBedvGqPD43hs7jtmk5RfMjpLOvidfe+/UCgYEAycSJ -etYYHMMQm2NgX1/4dcbgOiu33N+x1H7LaXuvJMaZw0wB7fUyu65CAexEanDtiKs3 -jVG4tAzdMmHg7VxKR7eiCvQaSlxdWdcWtL2eFVq2TaQeowbpJUtsR0h6W0vpaN9A -VYW/oAH4fzQskwmWSlBMxB/Ie14hBCBckTXSRV8CgYEAql6WXpCK/jVbZfYdfvrn -sKPGeijM7DWGGBaLmAHmnxKyeyKsXVgAkZj11NpeD8ZJcq97Kajb1pGVSxMjJVsX -/FOoST5sYfoew76gSi/GypQlYQYo9z8WLh9s/tBRcTRlFqAYTYzPdbG/ezshhmZD -lyRw0620bNdCPOyBJhY5MPECgYA/3tFOazuSz0UQi3LUfkLetagBghlf+AgJJmIp -8BdPYvcF1ae+tiHrO4x1o188+qaW3uxk9fusM25KJqXXPaHd9gl7wi4YYAjFCcuM -R4IlbGPNTCjOnr9rKOcL4aup/uvSYOmyqPYyJq2NRuzdVumWeLj0VMNYGkIFVmE3 -LnxzrQKBgG5loEjdSKt40YOMXtYvUYUKDGvWgoQEb0hj3OqiBXz+w4YD3/iX7dbQ -qra1gCxE42Z9beiBiti6zi6zGcoVj/pfNUoyxTLMSwaytbF+g1u6ksXcmC9PXcmk -kJDR0DJcm/rcL8tp3PKo22GDB7sobm9gk5je6y8z+dQs3SQbWzb0 ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests/c1-versions.tf b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests/c1-versions.tf +++ b/09-Terraform-Provisioners/09-02-remote-exec-provisioner/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apache-install.sh b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html deleted file mode 100644 index dee8257b..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file1.html +++ /dev/null @@ -1 +0,0 @@ -

App1 File-1

diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html deleted file mode 100644 index 1036144a..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app1/app1-file2.html +++ /dev/null @@ -1 +0,0 @@ -

>App1 File2

App2 File1 \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html deleted file mode 100644 index 80b269f0..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-file2.html +++ /dev/null @@ -1 +0,0 @@ -

App2 File2

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html deleted file mode 100644 index 2439bbe3..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/app2/app2-folder-1/app2-folder-1-file1.html +++ /dev/null @@ -1 +0,0 @@ -

App2 Folder-1 File-1

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html deleted file mode 100644 index 11a77278..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/apps/file-copy.html +++ /dev/null @@ -1 +0,0 @@ -

Simple file copy using Terraform File Provisioner

\ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index f55f87b6..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - default = "t2.micro" - #default = "t2.small" -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index 99e22323..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,34 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - #count = terraform.workspace == "default" ? 1 : 1 - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "vm-${terraform.workspace}-0" - } - - # local-exec provisioner (Creation-Time Provisioner - Triggered during Create Resource) - provisioner "local-exec" { - command = "echo ${aws_instance.my-ec2-vm.private_ip} >> creation-time-private-ip.txt" - working_dir = "local-exec-output-files/" - #on_failure = continue - } - - # local-exec provisioner - (Destroy-Time Provisioner - Triggered during Destroy Resource) - provisioner "local-exec" { - when = destroy - command = "echo Destroy-time provisioner Instanace Destroyed at `date` >> destroy-time.txt" - working_dir = "local-exec-output-files/" - } - -} - - - - - - - diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index 1e4f766f..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/creation-time-private-ip.txt b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/creation-time-private-ip.txt deleted file mode 100644 index 340b049a..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/creation-time-private-ip.txt +++ /dev/null @@ -1 +0,0 @@ -172.31.93.3 diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/destroy-time.txt b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/destroy-time.txt deleted file mode 100644 index 0a847daa..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/local-exec-output-files/backup-for-reference/destroy-time.txt +++ /dev/null @@ -1 +0,0 @@ -Destroy-time provisioner Instanace Destroyed at Fri Mar 5 18:07:52 IST 2021 diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem deleted file mode 100644 index fab1eb2a..00000000 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests-oldv1/private-key/terraform-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAnzQtbXStFNU4znotckbPpAbQvymSYBvIRhObDObmhZLzs/Qm -lm57HBU18NcdAeEmKjHyu/2CI4Wwor3TJ+LTKHIldHmCt+26dSN5889Km99Af674 -nuPg9fTt8IXhY83aO0AeEnFivC+lk9+6Xezv7J7Llsmyx3kvUGE4uUEPNPuNcjdU -OrSlQ/Th9FPWBsTL8wLQCfQaPIQhZT8fXnvNGViTpZ/YqcoKGmkXcMl/+Pi0Xccs -ID3Egl18sV5uWr6T1DSMqhhwWYbl+IagZYUeKQ6Lg5znAtnX2/OHhDep6pGcf+aE -jbRkhQWgfLIVYhNXkAGxdxBEA2fQO0wvnaKI6wIDAQABAoIBABmUZqApmQ253LDA -TMEJw58VQUEVyuEKVbl8uPLvvqZDoEiPuAt/oOQ4PDyAM7bzmBA7ikbOSrSubF0Z -pu3HsinTfVUjmO84kTb1Bkk4S0KUMmbRlDzjXGfofLqiqD5C+wd+G9bWxQh7l10V -G3qv8TTRpuCJc+I9BG8jz9tkKq9WYtnGKXktVIAmEXK+ein8A5yj+szV1CyP0y6Y -6D1KApk+o1hLEXCBxaK6JgD4elJWgU0jCIhRFZzae93yozNIfJc2WZfPc8Ro6GBa -8H57q3E241P7S65VewhZlln9AUcRFYc587ohcCIW8mOWQ8NA3IMP+oVxa2p334Ll -duhR2jECgYEAyf7a1/+/c82B+ENyo53Y5CK2UM28oOJjiyCaWG2Dxj6V2+ZSXPrS -YTo43L9XiqT0Ry2eHjb4pJDsEeW5FnaDFO6NVUP+vfzaqWtozQmVAl3GQybbSh6g -+KJoEQff2Obadp9ZVhLFTiBedvGqPD43hs7jtmk5RfMjpLOvidfe+/UCgYEAycSJ -etYYHMMQm2NgX1/4dcbgOiu33N+x1H7LaXuvJMaZw0wB7fUyu65CAexEanDtiKs3 -jVG4tAzdMmHg7VxKR7eiCvQaSlxdWdcWtL2eFVq2TaQeowbpJUtsR0h6W0vpaN9A -VYW/oAH4fzQskwmWSlBMxB/Ie14hBCBckTXSRV8CgYEAql6WXpCK/jVbZfYdfvrn -sKPGeijM7DWGGBaLmAHmnxKyeyKsXVgAkZj11NpeD8ZJcq97Kajb1pGVSxMjJVsX -/FOoST5sYfoew76gSi/GypQlYQYo9z8WLh9s/tBRcTRlFqAYTYzPdbG/ezshhmZD -lyRw0620bNdCPOyBJhY5MPECgYA/3tFOazuSz0UQi3LUfkLetagBghlf+AgJJmIp -8BdPYvcF1ae+tiHrO4x1o188+qaW3uxk9fusM25KJqXXPaHd9gl7wi4YYAjFCcuM -R4IlbGPNTCjOnr9rKOcL4aup/uvSYOmyqPYyJq2NRuzdVumWeLj0VMNYGkIFVmE3 -LnxzrQKBgG5loEjdSKt40YOMXtYvUYUKDGvWgoQEb0hj3OqiBXz+w4YD3/iX7dbQ -qra1gCxE42Z9beiBiti6zi6zGcoVj/pfNUoyxTLMSwaytbF+g1u6ksXcmC9PXcmk -kJDR0DJcm/rcL8tp3PKo22GDB7sobm9gk5je6y8z+dQs3SQbWzb0 ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests/c1-versions.tf b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests/c1-versions.tf +++ b/09-Terraform-Provisioners/09-03-local-exec-provisioner/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apache-install.sh b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file1.html b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file1.html deleted file mode 100644 index d21aa808..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file1.html +++ /dev/null @@ -1 +0,0 @@ -

App1 File-1 Updated by Kalyan Reddy

diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file2.html b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file2.html deleted file mode 100644 index 3aa17bbc..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/apps/app1/file2.html +++ /dev/null @@ -1 +0,0 @@ -

>App1 File2 Updated by Kalyan Reddy

App1 File-3 diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c1-versions.tf b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 3cf00138..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,28 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - null = { - source = "hashicorp/null" - version = "~> 3.0.0" - } - time = { - source = "hashicorp/time" - version = "~> 0.6.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c2-variables.tf b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index f55f87b6..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - default = "t2.micro" - #default = "t2.small" -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c3-security-groups.tf b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c4-ec2-instance.tf b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index deca3b32..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,53 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - #count = terraform.workspace == "default" ? 1 : 1 - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "vm-${terraform.workspace}-0" - } -} - -# Wait for 90 seconds after creating the above EC2 Instance -resource "time_sleep" "wait_90_seconds" { - depends_on = [aws_instance.my-ec2-vm] - create_duration = "90s" -} - -# Sync App1 Static Content to Webserver using Provisioners -resource "null_resource" "sync_app1_static" { - depends_on = [ time_sleep.wait_90_seconds ] - triggers = { - always-update = timestamp() - } - - # Connection Block for Provisioners to connect to EC2 Instance - connection { - type = "ssh" - host = aws_instance.my-ec2-vm.public_ip - user = "ec2-user" - password = "" - private_key = file("private-key/terraform-key.pem") - } - - # Copies the app1 folder to /tmp - provisioner "file" { - source = "apps/app1" - destination = "/tmp" - } - -# Copies the /tmp/app1 folder to Apache Webserver /var/www/html directory - provisioner "remote-exec" { - inline = [ - "sudo cp -r /tmp/app1 /var/www/html" - ] - } -} - - - - - diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c5-outputs.tf b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index 1e4f766f..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c6-ami-datasource.tf b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/private-key/terraform-key.pem b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/private-key/terraform-key.pem deleted file mode 100644 index fab1eb2a..00000000 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests-oldv1/private-key/terraform-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAnzQtbXStFNU4znotckbPpAbQvymSYBvIRhObDObmhZLzs/Qm -lm57HBU18NcdAeEmKjHyu/2CI4Wwor3TJ+LTKHIldHmCt+26dSN5889Km99Af674 -nuPg9fTt8IXhY83aO0AeEnFivC+lk9+6Xezv7J7Llsmyx3kvUGE4uUEPNPuNcjdU -OrSlQ/Th9FPWBsTL8wLQCfQaPIQhZT8fXnvNGViTpZ/YqcoKGmkXcMl/+Pi0Xccs -ID3Egl18sV5uWr6T1DSMqhhwWYbl+IagZYUeKQ6Lg5znAtnX2/OHhDep6pGcf+aE -jbRkhQWgfLIVYhNXkAGxdxBEA2fQO0wvnaKI6wIDAQABAoIBABmUZqApmQ253LDA -TMEJw58VQUEVyuEKVbl8uPLvvqZDoEiPuAt/oOQ4PDyAM7bzmBA7ikbOSrSubF0Z -pu3HsinTfVUjmO84kTb1Bkk4S0KUMmbRlDzjXGfofLqiqD5C+wd+G9bWxQh7l10V -G3qv8TTRpuCJc+I9BG8jz9tkKq9WYtnGKXktVIAmEXK+ein8A5yj+szV1CyP0y6Y -6D1KApk+o1hLEXCBxaK6JgD4elJWgU0jCIhRFZzae93yozNIfJc2WZfPc8Ro6GBa -8H57q3E241P7S65VewhZlln9AUcRFYc587ohcCIW8mOWQ8NA3IMP+oVxa2p334Ll -duhR2jECgYEAyf7a1/+/c82B+ENyo53Y5CK2UM28oOJjiyCaWG2Dxj6V2+ZSXPrS -YTo43L9XiqT0Ry2eHjb4pJDsEeW5FnaDFO6NVUP+vfzaqWtozQmVAl3GQybbSh6g -+KJoEQff2Obadp9ZVhLFTiBedvGqPD43hs7jtmk5RfMjpLOvidfe+/UCgYEAycSJ -etYYHMMQm2NgX1/4dcbgOiu33N+x1H7LaXuvJMaZw0wB7fUyu65CAexEanDtiKs3 -jVG4tAzdMmHg7VxKR7eiCvQaSlxdWdcWtL2eFVq2TaQeowbpJUtsR0h6W0vpaN9A -VYW/oAH4fzQskwmWSlBMxB/Ie14hBCBckTXSRV8CgYEAql6WXpCK/jVbZfYdfvrn -sKPGeijM7DWGGBaLmAHmnxKyeyKsXVgAkZj11NpeD8ZJcq97Kajb1pGVSxMjJVsX -/FOoST5sYfoew76gSi/GypQlYQYo9z8WLh9s/tBRcTRlFqAYTYzPdbG/ezshhmZD -lyRw0620bNdCPOyBJhY5MPECgYA/3tFOazuSz0UQi3LUfkLetagBghlf+AgJJmIp -8BdPYvcF1ae+tiHrO4x1o188+qaW3uxk9fusM25KJqXXPaHd9gl7wi4YYAjFCcuM -R4IlbGPNTCjOnr9rKOcL4aup/uvSYOmyqPYyJq2NRuzdVumWeLj0VMNYGkIFVmE3 -LnxzrQKBgG5loEjdSKt40YOMXtYvUYUKDGvWgoQEb0hj3OqiBXz+w4YD3/iX7dbQ -qra1gCxE42Z9beiBiti6zi6zGcoVj/pfNUoyxTLMSwaytbF+g1u6ksXcmC9PXcmk -kJDR0DJcm/rcL8tp3PKo22GDB7sobm9gk5je6y8z+dQs3SQbWzb0 ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests/c1-versions.tf b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests/c1-versions.tf index a4e79135..3cf00138 100644 --- a/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests/c1-versions.tf +++ b/09-Terraform-Provisioners/09-04-Null-Resource/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } null = { source = "hashicorp/null" diff --git a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/apache-install.sh b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c1-versions.tf b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c2-variables.tf b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c2-variables.tf deleted file mode 100644 index d81ef3b9..00000000 --- a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c2-variables.tf +++ /dev/null @@ -1,7 +0,0 @@ -# Input Variables - -variable "aws_region" { - description = "AWS Region" - type = string - default = "us-east-1" -} \ No newline at end of file diff --git a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c3-ami-datasource.tf b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c3-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c3-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c4-ec2instance-module.tf b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c4-ec2instance-module.tf deleted file mode 100644 index 1cff1215..00000000 --- a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c4-ec2instance-module.tf +++ /dev/null @@ -1,23 +0,0 @@ -# AWS EC2 Instance Module -module "ec2_cluster" { - source = "terraform-aws-modules/ec2-instance/aws" - version = "~> 2.0" - - name = "my-modules-demo" - instance_count = 2 - - ami = data.aws_ami.amzlinux.id - instance_type = "t2.micro" - key_name = "terraform-key" - monitoring = true - vpc_security_group_ids = ["sg-b8406afc"] # Get Default VPC Security Group ID and replace - subnet_id = "subnet-4ee95470" # Get one public subnet id from default vpc and replace - user_data = file("apache-install.sh") - - tags = { - Name = "Modules-Demo" - Terraform = "true" - Environment = "dev" - } -} - diff --git a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c5-outputs.tf b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c5-outputs.tf deleted file mode 100644 index bd466eac..00000000 --- a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests copy/c5-outputs.tf +++ /dev/null @@ -1,16 +0,0 @@ -# Output variable definitions - -output "ec2_instance_public_ip" { - description = "Public IP Addressess of EC2 Instances" - value = module.ec2_cluster.*.public_ip -} - -output "ec2_instance_public_dns" { - description = "Public DNS for EC2 Instances" - value = module.ec2_cluster.*.public_dns -} - -output "ec2_instance_private_ip" { - description = "Private IP Addresses for EC2 Instances" - value = module.ec2_cluster.*.private_ip -} \ No newline at end of file diff --git a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests/c1-versions.tf b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests/c1-versions.tf +++ b/10-Terraform-Modules/10-01-Terraform-Modules-Basics/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/index.html b/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/index.html deleted file mode 100644 index 3c12553c..00000000 --- a/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - Welcome to Stack Simplify - - -

Welcome to Stack Simplify - Terraform Modules Demo

-

Build Terraform Modules

-

Terraform Modules - Step by Step

- - \ No newline at end of file diff --git a/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/policy-public-read-access-for-website.json b/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/policy-public-read-access-for-website.json deleted file mode 100644 index 1b47fe4f..00000000 --- a/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v1-create-static-website-on-s3-using-aws-mgmt-console/policy-public-read-access-for-website.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "PublicReadGetObject", - "Effect": "Allow", - "Principal": "*", - "Action": [ - "s3:GetObject" - ], - "Resource": [ - "arn:aws:s3:::mybucket-1045/*" - ] - } - ] -} \ No newline at end of file diff --git a/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/main.tf b/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/main.tf deleted file mode 100644 index 00b2bfcf..00000000 --- a/10-Terraform-Modules/10-02-Terraform-Build-a-Module/Oldv1- backup/v2-host-static-website-on-s3-using-terraform-manifests/main.tf +++ /dev/null @@ -1,30 +0,0 @@ -# Create S3 Bucket Resource -resource "aws_s3_bucket" "s3_bucket" { - bucket = var.bucket_name - acl = "public-read" - policy = <Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 9a8bf6ce..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c2-variables.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index bba754b9..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,10 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string -} \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c3-security-groups.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c4-ec2-instance.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index d759412e..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance - Amazon2 Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - count = 1 - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "Terraform-Cloud-${count.index}" - } -} - - - - - - - diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c5-outputs.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index ad086758..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c6-ami-datasource.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests/c1-versions.tf index c540c0da..9a8bf6ce 100644 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests/c1-versions.tf +++ b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-01-Terraform-Cloud-Github-Integration/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c2-variables.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index 08ad15d2..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,25 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -## Create Variable for S3 Bucket Name -variable "my_s3_bucket" { - description = "S3 Bucket name that we pass to S3 Custom Module" - type = string - default = "mybucket-1051" -} - -## Create Variable for S3 Bucket Tags -variable "my_s3_tags" { - description = "Tags to set on the bucket" - type = map(string) - default = { - Terraform = "true" - Environment = "dev" - newtag1 = "tag1" - newtag2 = "tag2" - } -} diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c3-s3bucket.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c3-s3bucket.tf deleted file mode 100644 index d33af476..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c3-s3bucket.tf +++ /dev/null @@ -1,8 +0,0 @@ -# Call our Custom Terraform Module which we built earlier -module "website_s3_bucket123" { - source = "app.terraform.io/hcta-demo1/s3-website/aws" - version = "1.0.1" - # insert required variables here - bucket_name = var.my_s3_bucket - tags = var.my_s3_tags -} \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c4-outputs.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c4-outputs.tf deleted file mode 100644 index ac095c12..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests-oldv1/c4-outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -# Output definitions - -## S3 Bucket ARN -output "website_bucket_arn" { - description = "ARN of the bucket" - value = module.website_s3_bucket.arn -} - -## S3 Bucket Name -output "website_bucket_name" { - description = "Name (id) of the bucket" - value = module.website_s3_bucket.name -} - -## S3 Bucket Domain -output "website_bucket_domain" { - description = "Name (id) of the bucket" - value = module.website_s3_bucket.domain -} - -## S3 Bucket Endpoint -output "website_bucket_endpoint" { - description = "Name (id) of the bucket" - value = module.website_s3_bucket.endpoint -} diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests/c1-versions.tf +++ b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-02-Share-Modules-in-Private-Module-Registry/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 562ecd36..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,27 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } - # Update Terraform Cloud Backend Block Information below - backend "remote" { - organization = "hcta-demo1" - - workspaces { - name = "cli-driven-demo" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c2-variables.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index ec7c12c2..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,26 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -## Create Variable for S3 Bucket Name -variable "my_s3_bucket" { - description = "S3 Bucket name that we pass to S3 Custom Module" - type = string - default = "mybucket-1051" -} - -## Create Variable for S3 Bucket Tags -variable "my_s3_tags" { - description = "Tags to set on the bucket" - type = map(string) - default = { - Terraform = "true" - Environment = "dev" - newtag1 = "tag1" - newtag2 = "tag2" - newtag3 = "tag3" # Enable during Step-10 - } -} diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c3-s3bucket.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c3-s3bucket.tf deleted file mode 100644 index 3a308e0f..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c3-s3bucket.tf +++ /dev/null @@ -1,8 +0,0 @@ -# Call our Custom Terraform Module which we built earlier -module "website_s3_bucket" { - source = "app.terraform.io/hcta-demo1/s3-website/aws" - version = "1.0.1" - # insert required variables here - bucket_name = var.my_s3_bucket - tags = var.my_s3_tags -} diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c4-outputs.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c4-outputs.tf deleted file mode 100644 index ac095c12..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests-oldv1/c4-outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -# Output definitions - -## S3 Bucket ARN -output "website_bucket_arn" { - description = "ARN of the bucket" - value = module.website_s3_bucket.arn -} - -## S3 Bucket Name -output "website_bucket_name" { - description = "Name (id) of the bucket" - value = module.website_s3_bucket.name -} - -## S3 Bucket Domain -output "website_bucket_domain" { - description = "Name (id) of the bucket" - value = module.website_s3_bucket.domain -} - -## S3 Bucket Endpoint -output "website_bucket_endpoint" { - description = "Name (id) of the bucket" - value = module.website_s3_bucket.endpoint -} diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests/c1-versions.tf index 64de9125..562ecd36 100644 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests/c1-versions.tf +++ b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-03-Terraform-Cloud-CLI-Driven-Workflow/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } # Update Terraform Cloud Backend Block Information below diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/apache-install.sh b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 0c635725..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,31 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -# Update remote backend information - backend "remote" { - hostname = "app.terraform.io" - organization = "hcta-demo1" # Organization should already exists in Terraform Cloud - - workspaces { - name = "state-migration-demo" - # Two cases: - # Case-1: If workspace already exists, should not have any state files in states tab - # Case-2: If workspace not exists, during migration it will get created - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c2-variables.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index bba754b9..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,10 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string -} \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c3-security-groups.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c4-ec2-instance.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index 550e12c2..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance - Amazon2 Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - count = 1 - #key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "Terraform-Cloud-${count.index}" - } -} - - - - - - - diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c5-outputs.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index ad086758..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c6-ami-datasource.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests/c1-versions.tf b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests/c1-versions.tf index 433cbb0a..0c635725 100644 --- a/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests/c1-versions.tf +++ b/11-Terraform-Cloud-and-Enterprise-Capabilities/11-04-Migrate-State-to-Terraform-Cloud/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } # Update remote backend information diff --git a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf b/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 1c52c2f4..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,28 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } - # Update backend information as Terraform Cloud - backend "remote" { - organization = "hcta-demo1" - - workspaces { - name = "sentinel-demo1" - } - } - -} - -# Provider Block -provider "aws" { - region = var.aws_region -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf b/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index d476f6d8..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,27 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -# Input variable definitions - -variable "bucket_name" { - description = "Name of the S3 bucket. Must be Unique across AWS" - type = string - default = "mybucket-1061" -} - -variable "tags" { - description = "Tages to set on the bucket" - type = map(string) - default = { - Terraform = "true" - #abcdef = "true" - Environment = "dev" - newtag1 = "tag1" - newtag2 = "tag2" - } -} - diff --git a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c3-s3bucket.tf b/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c3-s3bucket.tf deleted file mode 100644 index 547af95c..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests-oldv1/c3-s3bucket.tf +++ /dev/null @@ -1,40 +0,0 @@ -# Create S3 Bucket Resource -resource "aws_s3_bucket" "s3_bucket" { - bucket = var.bucket_name - acl = "public-read" - policy = < - - Welcome to Stack Simplify - - -

Welcome to Stack Simplify - Terraform & Sentinel Demo

-

Sentinel Demo

-

Terraform Sentinel - Demo - V2

- - \ No newline at end of file diff --git a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests/c1-versions.tf b/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests/c1-versions.tf index c943d4c1..1c52c2f4 100644 --- a/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests/c1-versions.tf +++ b/12-Terraform-Cloud-and-Sentinel/12-01-Terraform-Cloud-and-Sentinel-Policies/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } # Update backend information as Terraform Cloud diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/apache-install.sh b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 9a8bf6ce..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index bba754b9..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,10 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string -} \ No newline at end of file diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c3-security-groups.tf b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c4-ec2-instance.tf b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index d759412e..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance - Amazon2 Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - count = 1 - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "Terraform-Cloud-${count.index}" - } -} - - - - - - - diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c5-outputs.tf b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index ad086758..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c6-ami-datasource.tf b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests/c1-versions.tf b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests/c1-versions.tf index 1f7096ed..9a8bf6ce 100644 --- a/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests/c1-versions.tf +++ b/12-Terraform-Cloud-and-Sentinel/12-02-Control-Costs-with-Sentinel-Policies/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c1-versions.tf b/13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c1-versions.tf deleted file mode 100644 index 22fb00a0..00000000 --- a/13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c1-versions.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - - -# Provider Block -provider "aws" { - region = "us-east-1" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ - diff --git a/13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c2-ec2-instance.tf b/13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c2-ec2-instance.tf deleted file mode 100644 index 5c34f54b..00000000 --- a/13-Terraform-State-Import/Oldv1-backup/v1-ec2-instance/c2-ec2-instance.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Create EC2 Instnace Resource -resource "aws_instance" "myec2vm" { - - /* - ami = "ami-038f1ca1bd58a5790" - #instance_type = "t2.micro" - instance_type = "t2.small" # Enabling it as part of Step-06 - availability_zone = "us-east-1e" - key_name = "terraform-key" - tags = { - "Name" = "State-Import-Demo" - } - */ -} diff --git a/13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c1-versions.tf b/13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c1-versions.tf deleted file mode 100644 index 22fb00a0..00000000 --- a/13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c1-versions.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - - -# Provider Block -provider "aws" { - region = "us-east-1" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ - diff --git a/13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c2-s3bucket.tf b/13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c2-s3bucket.tf deleted file mode 100644 index a5edaec9..00000000 --- a/13-Terraform-State-Import/Oldv1-backup/v2-s3bucket/c2-s3bucket.tf +++ /dev/null @@ -1,8 +0,0 @@ -# Create S3 Bucket -resource "aws_s3_bucket" "mybucket" { - bucket = "state-import-bucket" - acl = "private" - force_destroy = false -} - -# terraform import aws_s3_bucket.mybucket state-import-bucket \ No newline at end of file diff --git a/13-Terraform-State-Import/v1-ec2-instance/c1-versions.tf b/13-Terraform-State-Import/v1-ec2-instance/c1-versions.tf index 1ef7bfd0..22fb00a0 100644 --- a/13-Terraform-State-Import/v1-ec2-instance/c1-versions.tf +++ b/13-Terraform-State-Import/v1-ec2-instance/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/13-Terraform-State-Import/v2-s3bucket/c1-versions.tf b/13-Terraform-State-Import/v2-s3bucket/c1-versions.tf index 1ef7bfd0..22fb00a0 100644 --- a/13-Terraform-State-Import/v2-s3bucket/c1-versions.tf +++ b/13-Terraform-State-Import/v2-s3bucket/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/apache-install.sh b/14-Terraform-Graph/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/c1-versions.tf b/14-Terraform-Graph/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 9a8bf6ce..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/c2-variables.tf b/14-Terraform-Graph/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index bba754b9..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,10 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string -} \ No newline at end of file diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/c3-security-groups.tf b/14-Terraform-Graph/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/c4-ec2-instance.tf b/14-Terraform-Graph/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index d759412e..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Create EC2 Instance - Amazon2 Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - count = 1 - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "Terraform-Cloud-${count.index}" - } -} - - - - - - - diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/c5-outputs.tf b/14-Terraform-Graph/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index ad086758..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/c6-ami-datasource.tf b/14-Terraform-Graph/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/dot-old b/14-Terraform-Graph/terraform-manifests-oldv1/dot-old deleted file mode 100644 index 489fb9a0..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/dot-old +++ /dev/null @@ -1,31 +0,0 @@ -digraph { - compound = "true" - newrank = "true" - subgraph "root" { - "[root] aws_instance.my-ec2-vm (expand)" [label = "aws_instance.my-ec2-vm", shape = "box"] - "[root] aws_security_group.vpc-ssh (expand)" [label = "aws_security_group.vpc-ssh", shape = "box"] - "[root] aws_security_group.vpc-web (expand)" [label = "aws_security_group.vpc-web", shape = "box"] - "[root] data.aws_ami.amzlinux (expand)" [label = "data.aws_ami.amzlinux", shape = "box"] - "[root] output.ec2_instance_publicip" [label = "output.ec2_instance_publicip", shape = "note"] - "[root] output.ec2_publicdns" [label = "output.ec2_publicdns", shape = "note"] - "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" [label = "provider[\"registry.terraform.io/hashicorp/aws\"]", shape = "diamond"] - "[root] var.aws_region" [label = "var.aws_region", shape = "note"] - "[root] var.instance_type" [label = "var.instance_type", shape = "note"] - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] aws_security_group.vpc-ssh (expand)" - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] aws_security_group.vpc-web (expand)" - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] data.aws_ami.amzlinux (expand)" - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] var.instance_type" - "[root] aws_security_group.vpc-ssh (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" - "[root] aws_security_group.vpc-web (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" - "[root] data.aws_ami.amzlinux (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" - "[root] meta.count-boundary (EachMode fixup)" -> "[root] output.ec2_instance_publicip" - "[root] meta.count-boundary (EachMode fixup)" -> "[root] output.ec2_publicdns" - "[root] output.ec2_instance_publicip" -> "[root] aws_instance.my-ec2-vm (expand)" - "[root] output.ec2_publicdns" -> "[root] aws_instance.my-ec2-vm (expand)" - "[root] provider[\"registry.terraform.io/hashicorp/aws\"] (close)" -> "[root] aws_instance.my-ec2-vm (expand)" - "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" -> "[root] var.aws_region" - "[root] root" -> "[root] meta.count-boundary (EachMode fixup)" - "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"] (close)" - } -} - diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/dot1 b/14-Terraform-Graph/terraform-manifests-oldv1/dot1 deleted file mode 100644 index 489fb9a0..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/dot1 +++ /dev/null @@ -1,31 +0,0 @@ -digraph { - compound = "true" - newrank = "true" - subgraph "root" { - "[root] aws_instance.my-ec2-vm (expand)" [label = "aws_instance.my-ec2-vm", shape = "box"] - "[root] aws_security_group.vpc-ssh (expand)" [label = "aws_security_group.vpc-ssh", shape = "box"] - "[root] aws_security_group.vpc-web (expand)" [label = "aws_security_group.vpc-web", shape = "box"] - "[root] data.aws_ami.amzlinux (expand)" [label = "data.aws_ami.amzlinux", shape = "box"] - "[root] output.ec2_instance_publicip" [label = "output.ec2_instance_publicip", shape = "note"] - "[root] output.ec2_publicdns" [label = "output.ec2_publicdns", shape = "note"] - "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" [label = "provider[\"registry.terraform.io/hashicorp/aws\"]", shape = "diamond"] - "[root] var.aws_region" [label = "var.aws_region", shape = "note"] - "[root] var.instance_type" [label = "var.instance_type", shape = "note"] - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] aws_security_group.vpc-ssh (expand)" - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] aws_security_group.vpc-web (expand)" - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] data.aws_ami.amzlinux (expand)" - "[root] aws_instance.my-ec2-vm (expand)" -> "[root] var.instance_type" - "[root] aws_security_group.vpc-ssh (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" - "[root] aws_security_group.vpc-web (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" - "[root] data.aws_ami.amzlinux (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" - "[root] meta.count-boundary (EachMode fixup)" -> "[root] output.ec2_instance_publicip" - "[root] meta.count-boundary (EachMode fixup)" -> "[root] output.ec2_publicdns" - "[root] output.ec2_instance_publicip" -> "[root] aws_instance.my-ec2-vm (expand)" - "[root] output.ec2_publicdns" -> "[root] aws_instance.my-ec2-vm (expand)" - "[root] provider[\"registry.terraform.io/hashicorp/aws\"] (close)" -> "[root] aws_instance.my-ec2-vm (expand)" - "[root] provider[\"registry.terraform.io/hashicorp/aws\"]" -> "[root] var.aws_region" - "[root] root" -> "[root] meta.count-boundary (EachMode fixup)" - "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/aws\"] (close)" - } -} - diff --git a/14-Terraform-Graph/terraform-manifests-oldv1/graph.svg b/14-Terraform-Graph/terraform-manifests-oldv1/graph.svg deleted file mode 100644 index 553dd2ae..00000000 --- a/14-Terraform-Graph/terraform-manifests-oldv1/graph.svg +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - -[root] aws_instance.my-ec2-vm (expand) - -aws_instance.my-ec2-vm - - - -[root] aws_security_group.vpc-ssh (expand) - -aws_security_group.vpc-ssh - - - -[root] aws_instance.my-ec2-vm (expand)->[root] aws_security_group.vpc-ssh (expand) - - - - - -[root] aws_security_group.vpc-web (expand) - -aws_security_group.vpc-web - - - -[root] aws_instance.my-ec2-vm (expand)->[root] aws_security_group.vpc-web (expand) - - - - - -[root] data.aws_ami.amzlinux (expand) - -data.aws_ami.amzlinux - - - -[root] aws_instance.my-ec2-vm (expand)->[root] data.aws_ami.amzlinux (expand) - - - - - -[root] var.instance_type - - - -var.instance_type - - - -[root] aws_instance.my-ec2-vm (expand)->[root] var.instance_type - - - - - -[root] provider["registry.terraform.io/hashicorp/aws"] - -provider["registry.terraform.io/hashicorp/aws"] - - - -[root] aws_security_group.vpc-ssh (expand)->[root] provider["registry.terraform.io/hashicorp/aws"] - - - - - -[root] aws_security_group.vpc-web (expand)->[root] provider["registry.terraform.io/hashicorp/aws"] - - - - - -[root] data.aws_ami.amzlinux (expand)->[root] provider["registry.terraform.io/hashicorp/aws"] - - - - - -[root] output.ec2_instance_publicip - - - -output.ec2_instance_publicip - - - -[root] output.ec2_instance_publicip->[root] aws_instance.my-ec2-vm (expand) - - - - - -[root] output.ec2_publicdns - - - -output.ec2_publicdns - - - -[root] output.ec2_publicdns->[root] aws_instance.my-ec2-vm (expand) - - - - - -[root] var.aws_region - - - -var.aws_region - - - -[root] provider["registry.terraform.io/hashicorp/aws"]->[root] var.aws_region - - - - - -[root] meta.count-boundary (EachMode fixup) - -[root] meta.count-boundary (EachMode fixup) - - - -[root] meta.count-boundary (EachMode fixup)->[root] output.ec2_instance_publicip - - - - - -[root] meta.count-boundary (EachMode fixup)->[root] output.ec2_publicdns - - - - - -[root] provider["registry.terraform.io/hashicorp/aws"] (close) - -[root] provider["registry.terraform.io/hashicorp/aws"] (close) - - - -[root] provider["registry.terraform.io/hashicorp/aws"] (close)->[root] aws_instance.my-ec2-vm (expand) - - - - - -[root] root - -[root] root - - - -[root] root->[root] meta.count-boundary (EachMode fixup) - - - - - -[root] root->[root] provider["registry.terraform.io/hashicorp/aws"] (close) - - - - - diff --git a/14-Terraform-Graph/terraform-manifests/c1-versions.tf b/14-Terraform-Graph/terraform-manifests/c1-versions.tf index c540c0da..9a8bf6ce 100644 --- a/14-Terraform-Graph/terraform-manifests/c1-versions.tf +++ b/14-Terraform-Graph/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c1-versions.tf b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 092ff81f..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c2-variables.tf b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index 5881be51..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - default = "t2.micro" - #default = "t2.small" -} - -variable "package_name" { - description = "Provide Package that need to be installed with user_data" - type = string - default = "httpd" -} \ No newline at end of file diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c3-security-groups.tf b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 98fe5ff7..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh-${terraform.workspace}" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web-${terraform.workspace}" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c4-ec2-instance.tf b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index fefe9e07..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,26 +0,0 @@ -# Create EC2 Instance - Amazon2 Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - #user_data = file("apache-install.sh") - user_data = templatefile("user_data.tmpl", {package_name = var.package_name}) - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "TF-Functions-Demo-1" - } -} - - - - - - - - - - - - - - diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c5-outputs.tf b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index 2cd9150b..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,23 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.*.public_ip -} - - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.*.public_dns -} - -# Concat Security Group IDs in Output -output "security_group_ids" { - description = "This will return the IDs of the security groups attached to your web instance as a list. You can use these lists as inputs in submodules" - value = concat([aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id]) -} -/* Note: This will return the IDs of the security groups attached to your web -instance as a list. You can use these lists as inputs in submodules.*/ - diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c6-ami-datasource.tf b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/private-key/terraform-key.pem b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/private-key/terraform-key.pem deleted file mode 100644 index fab1eb2a..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/private-key/terraform-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAnzQtbXStFNU4znotckbPpAbQvymSYBvIRhObDObmhZLzs/Qm -lm57HBU18NcdAeEmKjHyu/2CI4Wwor3TJ+LTKHIldHmCt+26dSN5889Km99Af674 -nuPg9fTt8IXhY83aO0AeEnFivC+lk9+6Xezv7J7Llsmyx3kvUGE4uUEPNPuNcjdU -OrSlQ/Th9FPWBsTL8wLQCfQaPIQhZT8fXnvNGViTpZ/YqcoKGmkXcMl/+Pi0Xccs -ID3Egl18sV5uWr6T1DSMqhhwWYbl+IagZYUeKQ6Lg5znAtnX2/OHhDep6pGcf+aE -jbRkhQWgfLIVYhNXkAGxdxBEA2fQO0wvnaKI6wIDAQABAoIBABmUZqApmQ253LDA -TMEJw58VQUEVyuEKVbl8uPLvvqZDoEiPuAt/oOQ4PDyAM7bzmBA7ikbOSrSubF0Z -pu3HsinTfVUjmO84kTb1Bkk4S0KUMmbRlDzjXGfofLqiqD5C+wd+G9bWxQh7l10V -G3qv8TTRpuCJc+I9BG8jz9tkKq9WYtnGKXktVIAmEXK+ein8A5yj+szV1CyP0y6Y -6D1KApk+o1hLEXCBxaK6JgD4elJWgU0jCIhRFZzae93yozNIfJc2WZfPc8Ro6GBa -8H57q3E241P7S65VewhZlln9AUcRFYc587ohcCIW8mOWQ8NA3IMP+oVxa2p334Ll -duhR2jECgYEAyf7a1/+/c82B+ENyo53Y5CK2UM28oOJjiyCaWG2Dxj6V2+ZSXPrS -YTo43L9XiqT0Ry2eHjb4pJDsEeW5FnaDFO6NVUP+vfzaqWtozQmVAl3GQybbSh6g -+KJoEQff2Obadp9ZVhLFTiBedvGqPD43hs7jtmk5RfMjpLOvidfe+/UCgYEAycSJ -etYYHMMQm2NgX1/4dcbgOiu33N+x1H7LaXuvJMaZw0wB7fUyu65CAexEanDtiKs3 -jVG4tAzdMmHg7VxKR7eiCvQaSlxdWdcWtL2eFVq2TaQeowbpJUtsR0h6W0vpaN9A -VYW/oAH4fzQskwmWSlBMxB/Ie14hBCBckTXSRV8CgYEAql6WXpCK/jVbZfYdfvrn -sKPGeijM7DWGGBaLmAHmnxKyeyKsXVgAkZj11NpeD8ZJcq97Kajb1pGVSxMjJVsX -/FOoST5sYfoew76gSi/GypQlYQYo9z8WLh9s/tBRcTRlFqAYTYzPdbG/ezshhmZD -lyRw0620bNdCPOyBJhY5MPECgYA/3tFOazuSz0UQi3LUfkLetagBghlf+AgJJmIp -8BdPYvcF1ae+tiHrO4x1o188+qaW3uxk9fusM25KJqXXPaHd9gl7wi4YYAjFCcuM -R4IlbGPNTCjOnr9rKOcL4aup/uvSYOmyqPYyJq2NRuzdVumWeLj0VMNYGkIFVmE3 -LnxzrQKBgG5loEjdSKt40YOMXtYvUYUKDGvWgoQEb0hj3OqiBXz+w4YD3/iX7dbQ -qra1gCxE42Z9beiBiti6zi6zGcoVj/pfNUoyxTLMSwaytbF+g1u6ksXcmC9PXcmk -kJDR0DJcm/rcL8tp3PKo22GDB7sobm9gk5je6y8z+dQs3SQbWzb0 ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/user_data.tmpl b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/user_data.tmpl deleted file mode 100644 index c81c9b0b..00000000 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests-oldv1/user_data.tmpl +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y ${package_name} -sudo yum list installed | grep ${package_name} >> /tmp/package-installed-list.txt diff --git a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests/c1-versions.tf b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests/c1-versions.tf index 095fba43..092ff81f 100644 --- a/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests/c1-versions.tf +++ b/15-Terraform-Expressions/15-01-Terraform-Functions/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/apache-install.sh b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c1-versions.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 106e5a73..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,24 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c2-variables.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index ce4afc38..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,40 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type" - type = string - default = "t3.micro" -} - -variable "availability_zones" { - description = "List of Availability Zones resources will be created" - type = list(string) - default = ["us-east-1a", "us-east-1b", "us-east-1c"] -} - -variable "high_availability" { - type = bool - description = "If this is a multiple instance deployment, choose `true` to deploy 2 instances" - default = false - #default = true -} - - -variable "name" { - description = "The username assigned to the infrastructure" - type = string - default = "ec2-user" - #default = "" -} - -variable "team" { - description = "The team responsible for the infrastructure" - type = string - default = "stacksimplify" -} - diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c3-security-groups.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index c11e0991..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,50 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - tags = local.common_tags -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - tags = local.common_tags -} \ No newline at end of file diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c4-ec2-instance.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index af64a192..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,31 +0,0 @@ -# Define Random ID Resource -resource "random_id" "id" { - byte_length = 8 -} - -# Create Locals -locals { - # name = var.name - name = (var.name != "" ? var.name : random_id.id.hex) - owner = var.team - common_tags = { - Owner = local.owner - nametag = local.name - } -} - - -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - # Dynamic Expressions - count = (var.high_availability == true ? 2 : 1) - tags = local.common_tags - availability_zone = var.availability_zones[count.index] -} - - diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c5-outputs.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index d096c2d9..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,26 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm[*].public_ip -} - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm[*].public_dns -} - - -# Common Tags -output "tags" { - description = "Common Tags" - value = aws_instance.my-ec2-vm[*].tags -} - -# ELB DNS Name -output "elb_dns_name" { - description = "ELB DNS Name" - value = aws_elb.elb[*].dns_name -} \ No newline at end of file diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c6-ami-datasource.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c7-elb.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c7-elb.tf deleted file mode 100644 index 104e2f36..00000000 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests-oldv1/c7-elb.tf +++ /dev/null @@ -1,31 +0,0 @@ -# AWS ELB -resource "aws_elb" "elb" { - name = "my-elb" - listener { - instance_port = 80 - instance_protocol = "http" - lb_port = 80 - lb_protocol = "http" - } - - health_check { - healthy_threshold = 2 - unhealthy_threshold = 2 - timeout = 3 - target = "HTTP:80/" - interval = 30 - } - - idle_timeout = 400 - connection_draining = true - connection_draining_timeout = 400 - - # Splat Expression - instances = aws_instance.my-ec2-vm[*].id - - # Dynamic Expressions - count = (var.high_availability == true ? 1 : 0) - availability_zones = var.availability_zones - tags = local.common_tags -} - diff --git a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests/c1-versions.tf b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests/c1-versions.tf index 00436b5b..106e5a73 100644 --- a/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests/c1-versions.tf +++ b/15-Terraform-Expressions/15-02-Terraform-Dynamic-Expressions/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } random = { source = "hashicorp/random" diff --git a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c1-versions.tf b/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index 62f781cb..00000000 --- a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = "us-east-1" - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c2-security-groups-regular.tf b/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c2-security-groups-regular.tf deleted file mode 100644 index de4fe074..00000000 --- a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c2-security-groups-regular.tf +++ /dev/null @@ -1,47 +0,0 @@ -resource "aws_security_group" "sg-regular" { - name = "demo-regular" - description = "demo-regular" - - ingress { - description = "description 0" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - ingress { - description = "description 1" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - ingress { - description = "description 2" - from_port = 8080 - to_port = 8080 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - ingress { - description = "description 3" - from_port = 8081 - to_port = 8081 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - ingress { - description = "description 4" - from_port = 7080 - to_port = 7080 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - ingress { - description = "description 5" - from_port = 7081 - to_port = 7081 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } -} \ No newline at end of file diff --git a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c3-dynamic-blocks-for-security-groups.tf b/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c3-dynamic-blocks-for-security-groups.tf deleted file mode 100644 index 42f6cc72..00000000 --- a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests-oldv1/c3-dynamic-blocks-for-security-groups.tf +++ /dev/null @@ -1,22 +0,0 @@ -# Define Ports as a list in locals block -locals { - ports = [80, 443, 8080, 8081, 7080, 7081] -} - -# Create Security Group using Terraform Dynamic Block -resource "aws_security_group" "sg-dynamic" { - name = "dynamic-block-demo" - description = "dynamic-block-demo" - - dynamic "ingress" { - for_each = local.ports - content { - description = "description ${ingress.key}" - from_port = ingress.value - to_port = ingress.value - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - } -} - diff --git a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests/c1-versions.tf b/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests/c1-versions.tf index f16fce1d..62f781cb 100644 --- a/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests/c1-versions.tf +++ b/15-Terraform-Expressions/15-03-Terraform-Dynamic-Blocks/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } } diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/apache-install.sh b/16-Terraform-Debug/terraform-manifests-oldv1/apache-install.sh deleted file mode 100644 index 8362972b..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/apache-install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -sudo yum update -y -sudo yum install -y httpd -sudo systemctl enable httpd -sudo service httpd start -echo "

Welcome to StackSimplify ! AWS Infra created using Terraform in us-east-1 Region

" | sudo tee /var/www/html/index.html \ No newline at end of file diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/c1-versions.tf b/16-Terraform-Debug/terraform-manifests-oldv1/c1-versions.tf deleted file mode 100644 index a305835c..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/c1-versions.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Terraform Block -terraform { - required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 3.0" - } - } -} - -# Provider Block -provider "aws" { - region = var.aws_region - profile = "default" -} -/* -Note-1: AWS Credentials Profile (profile = "default") configured on your local desktop terminal -$HOME/.aws/credentials -*/ diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/c2-variables.tf b/16-Terraform-Debug/terraform-manifests-oldv1/c2-variables.tf deleted file mode 100644 index c3596e08..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/c2-variables.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Input Variables -variable "aws_region" { - description = "Region in which AWS Resources to be created" - type = string - default = "us-east-1" -} - -variable "instance_type" { - description = "EC2 Instance Type - Instance Sizing" - type = string - #default = "t2.micro" - default = "t2.small" -} \ No newline at end of file diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/c3-security-groups.tf b/16-Terraform-Debug/terraform-manifests-oldv1/c3-security-groups.tf deleted file mode 100644 index 1ca810d6..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/c3-security-groups.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Create Security Group - SSH Traffic -resource "aws_security_group" "vpc-ssh" { - name = "vpc-ssh" - description = "Dev VPC SSH" - ingress { - description = "Allow Port 22" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - egress { - description = "Allow all ip and ports outboun" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -# Create Security Group - Web Traffic -resource "aws_security_group" "vpc-web" { - name = "vpc-web" - description = "Dev VPC web" - ingress { - description = "Allow Port 80" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "Allow Port 443" - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "Allow all ip and ports outbound" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} \ No newline at end of file diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/c4-ec2-instance.tf b/16-Terraform-Debug/terraform-manifests-oldv1/c4-ec2-instance.tf deleted file mode 100644 index 8839bb42..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/c4-ec2-instance.tf +++ /dev/null @@ -1,15 +0,0 @@ -# Create EC2 Instance - Amazon Linux -resource "aws_instance" "my-ec2-vm" { - ami = data.aws_ami.amzlinux.id - instance_type = var.instance_type - key_name = "terraform-key" - user_data = file("apache-install.sh") - vpc_security_group_ids = [aws_security_group.vpc-ssh.id, aws_security_group.vpc-web.id] - tags = { - "Name" = "amz-linux-vm" - } -} - - - - diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/c5-outputs.tf b/16-Terraform-Debug/terraform-manifests-oldv1/c5-outputs.tf deleted file mode 100644 index b94beeb7..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/c5-outputs.tf +++ /dev/null @@ -1,13 +0,0 @@ -# Define Output Values - -# Attribute Reference -output "ec2_instance_publicip" { - description = "EC2 Instance Public IP" - value = aws_instance.my-ec2-vm.public_ip -} - -# Attribute Reference - Create Public DNS URL -output "ec2_publicdns" { - description = "Public DNS URL of an EC2 Instance" - value = aws_instance.my-ec2-vm.public_dns -} diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/c6-ami-datasource.tf b/16-Terraform-Debug/terraform-manifests-oldv1/c6-ami-datasource.tf deleted file mode 100644 index 4d0a0102..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/c6-ami-datasource.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Get latest AMI ID for Amazon Linux2 OS -data "aws_ami" "amzlinux" { - most_recent = true - owners = [ "amazon" ] - filter { - name = "name" - values = [ "amzn2-ami-hvm-*-gp2" ] - } - filter { - name = "root-device-type" - values = [ "ebs" ] - } - filter { - name = "virtualization-type" - values = [ "hvm" ] - } - filter { - name = "architecture" - values = [ "x86_64" ] - } -} \ No newline at end of file diff --git a/16-Terraform-Debug/terraform-manifests-oldv1/terraform-trace.log_BKUP b/16-Terraform-Debug/terraform-manifests-oldv1/terraform-trace.log_BKUP deleted file mode 100644 index 42eb74cc..00000000 --- a/16-Terraform-Debug/terraform-manifests-oldv1/terraform-trace.log_BKUP +++ /dev/null @@ -1,47 +0,0 @@ -2021/03/16 13:42:18 [INFO] Terraform version: 0.14.8 -2021/03/16 13:42:18 [INFO] Go runtime version: go1.15.6 -2021/03/16 13:42:18 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init"} -2021/03/16 13:42:18 [DEBUG] Attempting to open CLI config file: /Users/kdaida/.terraformrc -2021/03/16 13:42:18 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. -2021/03/16 13:42:18 Loading CLI configuration from /Users/kdaida/.terraform.d/credentials.tfrc.json -2021/03/16 13:42:18 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins -2021/03/16 13:42:18 [DEBUG] ignoring non-existing provider search directory /Users/kdaida/.terraform.d/plugins -2021/03/16 13:42:18 [DEBUG] ignoring non-existing provider search directory /Users/kdaida/Library/Application Support/io.terraform/plugins -2021/03/16 13:42:18 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins -2021/03/16 13:42:18 [INFO] CLI command args: []string{"init"} -2021/03/16 13:42:18 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config -2021/03/16 13:42:18 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory -2021/03/16 13:42:18 [DEBUG] New state was assigned lineage "c795fb8f-2eb6-e842-427d-de1dc6657f4d" -2021/03/16 13:42:18 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend) -2021/03/16 13:42:18 [TRACE] Meta.Backend: instantiated backend of type -2021/03/16 13:42:18 [DEBUG] checking for provisioner in "." -2021/03/16 13:42:18 [DEBUG] checking for provisioner in "/usr/local/bin" -2021/03/16 13:42:18 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory -2021/03/16 13:42:18 [TRACE] Meta.Backend: backend does not support operations, so wrapping it in a local backend -2021/03/16 13:42:18 [TRACE] backend/local: state manager for workspace "default" will: - - read initial snapshot from terraform.tfstate - - write new snapshots to terraform.tfstate - - create any backup at terraform.tfstate.backup -2021/03/16 13:42:18 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate -2021/03/16 13:42:18 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay -2021/03/16 13:42:18 [TRACE] statemgr.Filesystem: read nil snapshot -2021/03/16 13:42:18 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json -2021/03/16 13:42:18 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json -2021/03/16 13:42:18 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/aws/versions -2021/03/16 13:42:18 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/hashicorp/aws/versions -2021/03/16 13:42:18 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers -2021/03/16 13:42:18 [TRACE] getproviders.SearchLocalDirectory: failed to resolve symlinks for .terraform/providers: lstat .terraform: no such file or directory -2021/03/16 13:42:18 [TRACE] providercache.fillMetaCache: error while scanning directory .terraform/providers: cannot search .terraform/providers: lstat .terraform/providers: no such file or directory -2021/03/16 13:42:18 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/aws/3.32.0/download/darwin/amd64 -2021/03/16 13:42:18 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/hashicorp/aws/3.32.0/download/darwin/amd64 -2021/03/16 13:42:19 [DEBUG] GET https://releases.hashicorp.com/terraform-provider-aws/3.32.0/terraform-provider-aws_3.32.0_SHA256SUMS -2021/03/16 13:42:19 [TRACE] HTTP client GET request to https://releases.hashicorp.com/terraform-provider-aws/3.32.0/terraform-provider-aws_3.32.0_SHA256SUMS -2021/03/16 13:42:19 [DEBUG] GET https://releases.hashicorp.com/terraform-provider-aws/3.32.0/terraform-provider-aws_3.32.0_SHA256SUMS.sig -2021/03/16 13:42:19 [TRACE] HTTP client GET request to https://releases.hashicorp.com/terraform-provider-aws/3.32.0/terraform-provider-aws_3.32.0_SHA256SUMS.sig -2021/03/16 13:42:19 [TRACE] providercache.Dir.InstallPackage: installing registry.terraform.io/hashicorp/aws v3.32.0 from https://releases.hashicorp.com/terraform-provider-aws/3.32.0/terraform-provider-aws_3.32.0_darwin_amd64.zip -2021/03/16 13:42:19 [TRACE] HTTP client GET request to https://releases.hashicorp.com/terraform-provider-aws/3.32.0/terraform-provider-aws_3.32.0_darwin_amd64.zip -2021/03/16 13:42:23 [DEBUG] Provider signed by 51852D87348FFC4C HashiCorp Security -2021/03/16 13:42:24 [TRACE] providercache.fillMetaCache: scanning directory .terraform/providers -2021/03/16 13:42:24 [TRACE] getproviders.SearchLocalDirectory: .terraform/providers is a symlink to .terraform/providers -2021/03/16 13:42:24 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/aws v3.32.0 for darwin_amd64 at .terraform/providers/registry.terraform.io/hashicorp/aws/3.32.0/darwin_amd64 -2021/03/16 13:42:24 [TRACE] providercache.fillMetaCache: including .terraform/providers/registry.terraform.io/hashicorp/aws/3.32.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/aws 3.32.0 diff --git a/16-Terraform-Debug/terraform-manifests/c1-versions.tf b/16-Terraform-Debug/terraform-manifests/c1-versions.tf index cffef5ab..a305835c 100644 --- a/16-Terraform-Debug/terraform-manifests/c1-versions.tf +++ b/16-Terraform-Debug/terraform-manifests/c1-versions.tf @@ -1,10 +1,10 @@ # Terraform Block terraform { - required_version = ">= 1.4" + required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.0" + version = "~> 3.0" } } }