From 3ca8e39fc4dfe91b6e30d8911d99b2cd1122a821 Mon Sep 17 00:00:00 2001 From: maureen barasa Date: Mon, 18 Sep 2023 14:28:47 +0000 Subject: [PATCH 1/5] Added remote backend --- .terraform.lock.hcl | 59 ++++++++++++++++++++++++++++++++++++++++ remote_backend.tf | 9 ++++++ terraform.tfvars.example | 5 ---- 3 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 .terraform.lock.hcl create mode 100644 remote_backend.tf delete mode 100644 terraform.tfvars.example diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl new file mode 100644 index 000000000..038146ce8 --- /dev/null +++ b/.terraform.lock.hcl @@ -0,0 +1,59 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "3.42.0" + constraints = "3.42.0" + hashes = [ + "h1:quV6hK7ewiHWBznGWCb/gJ6JAPm6UtouBUrhAjv6oRY=", + "zh:126c856a6eedddd8571f161a826a407ba5655a37a6241393560a96b8c4beca1a", + "zh:1a4868e6ac734b5fc2e79a4a889d176286b66664aad709435aa6acee5871d5b0", + "zh:40fed7637ab8ddeb93bef06aded35d970f0628025b97459ae805463e8aa0a58a", + "zh:68def3c0a5a1aac1db6372c51daef858b707f03052626d3427ac24cba6f2014d", + "zh:6db7ec9c8d1803a0b6f40a664aa892e0f8894562de83061fa7ac1bc51ff5e7e5", + "zh:7058abaad595930b3f97dc04e45c112b2dbf37d098372a849081f7081da2fb52", + "zh:8c25adb15a19da301c478aa1f4a4d8647cabdf8e5dae8331d4490f80ea718c26", + "zh:8e129b847401e39fcbc54817726dab877f36b7f00ff5ed76f7b43470abe99ff9", + "zh:d268bb267a2d6b39df7ddee8efa7c1ef7a15cf335dfa5f2e64c9dae9b623a1b8", + "zh:d6eeb3614a0ab50f8e9ab5666ae5754ea668ce327310e5b21b7f04a18d7611a8", + "zh:f5d3c58055dff6e38562b75d3edc908cb2f1e45c6914f6b00f4773359ce49324", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.1" + hashes = [ + "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", + "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", + "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", + "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", + "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", + "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", + "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", + "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", + "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", + "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", + "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", + ] +} + +provider "registry.terraform.io/hashicorp/tls" { + version = "4.0.4" + hashes = [ + "h1:pe9vq86dZZKCm+8k1RhzARwENslF3SXb9ErHbQfgjXU=", + "zh:23671ed83e1fcf79745534841e10291bbf34046b27d6e68a5d0aab77206f4a55", + "zh:45292421211ffd9e8e3eb3655677700e3c5047f71d8f7650d2ce30242335f848", + "zh:59fedb519f4433c0fdb1d58b27c210b27415fddd0cd73c5312530b4309c088be", + "zh:5a8eec2409a9ff7cd0758a9d818c74bcba92a240e6c5e54b99df68fff312bbd5", + "zh:5e6a4b39f3171f53292ab88058a59e64825f2b842760a4869e64dc1dc093d1fe", + "zh:810547d0bf9311d21c81cc306126d3547e7bd3f194fc295836acf164b9f8424e", + "zh:824a5f3617624243bed0259d7dd37d76017097dc3193dac669be342b90b2ab48", + "zh:9361ccc7048be5dcbc2fafe2d8216939765b3160bd52734f7a9fd917a39ecbd8", + "zh:aa02ea625aaf672e649296bce7580f62d724268189fe9ad7c1b36bb0fa12fa60", + "zh:c71b4cd40d6ec7815dfeefd57d88bc592c0c42f5e5858dcc88245d371b4b8b1e", + "zh:dabcd52f36b43d250a3d71ad7abfa07b5622c69068d989e60b79b2bb4f220316", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/remote_backend.tf b/remote_backend.tf new file mode 100644 index 000000000..eadc8e22c --- /dev/null +++ b/remote_backend.tf @@ -0,0 +1,9 @@ +terraform { + backend "remote" { + hostname = "app.terraform.io" + organization = "maureenbarasa-training" + workspaces { + name = "hashicat-aws" + } + } +} diff --git a/terraform.tfvars.example b/terraform.tfvars.example deleted file mode 100644 index 0d7ce6eb6..000000000 --- a/terraform.tfvars.example +++ /dev/null @@ -1,5 +0,0 @@ -# Rename or copy this file to terraform.tfvars -# Prefix must be all lowercase letters, digits, and hyphens. -# Make sure it is at least 5 characters long. - -# prefix = "yourname" From fb5f50f56d0598c64f35281df94f49ff184495b7 Mon Sep 17 00:00:00 2001 From: maureen barasa Date: Mon, 18 Sep 2023 14:34:18 +0000 Subject: [PATCH 2/5] modified text --- files/deploy_app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/deploy_app.sh b/files/deploy_app.sh index 1a1a7db07..1ad32b4ef 100644 --- a/files/deploy_app.sh +++ b/files/deploy_app.sh @@ -11,7 +11,7 @@ cat << EOM > /var/www/html/index.html

Meow World!

- Welcome to ${PREFIX}'s app. Replace this text with your own. + Welcome to HashiCorp MaureenBarasa. From b35b5c8291cc1fe3591cde80336f4de256854fb0 Mon Sep 17 00:00:00 2001 From: maureen barasa Date: Mon, 18 Sep 2023 14:45:02 +0000 Subject: [PATCH 3/5] Added the first tag --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index aa5ee2725..46733b118 100644 --- a/main.tf +++ b/main.tf @@ -128,6 +128,7 @@ resource "aws_instance" "hashicat" { tags = { Name = "${var.prefix}-hashicat-instance" + Department = "devops" } } From 392b8f645ddfc6a5364c93eeea3bc0a545ee612f Mon Sep 17 00:00:00 2001 From: maureen barasa Date: Mon, 18 Sep 2023 14:47:03 +0000 Subject: [PATCH 4/5] Added the second tag --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index 46733b118..65f4d8163 100644 --- a/main.tf +++ b/main.tf @@ -129,6 +129,7 @@ resource "aws_instance" "hashicat" { tags = { Name = "${var.prefix}-hashicat-instance" Department = "devops" + Billable = "true" } } From eb3d2ef69488e402125342cb7599b627f6ea00b4 Mon Sep 17 00:00:00 2001 From: Maureen Barasa <47135007+MaureenBarasa@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:57:54 +0200 Subject: [PATCH 5/5] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 65f4d8163..e5e8c48ee 100644 --- a/main.tf +++ b/main.tf @@ -128,7 +128,7 @@ resource "aws_instance" "hashicat" { tags = { Name = "${var.prefix}-hashicat-instance" - Department = "devops" + Department = "DevOps" Billable = "true" } }