From f7095bc9b6d53bd0ceb3acd7cccfd84feb92cf95 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:59:43 +0530 Subject: [PATCH 01/27] Update release.yml --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aab3e64..16ed138 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,10 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true + - name: run shell script + run: | + chmod +x ./deploy.sh + ./deploy.sh terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest @@ -79,4 +83,4 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true \ No newline at end of file + tf_actions_comment: true From 08e20e4fab893d576be83a5b2e7907cb146b930c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:02:29 +0530 Subject: [PATCH 02/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16ed138..51ed3af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest From 55328bb1d5b5d68e208ecbc293a344c6c137be45 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:04:30 +0530 Subject: [PATCH 03/27] Update deploy.sh --- deploy.sh | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 541ddaa..4e2baa5 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1 +1,145 @@ -this is madhu +#!/usr/bin/env bash + +# set -x # Un-comment to debug this script + +#TF_LOG=DEBUG; TF_LOG_PATH=~tf.log # Un-comment to debug terraform + +if [ -z "${BASH_VERSINFO[*]}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then + echo "This script requires Bash version >= 4" + exit 1 +fi + +programname=$0 +SCRIPT_REL_DIR=$(dirname "${0}") +ROOT=$(realpath "$SCRIPT_REL_DIR/../") +cd "$ROOT" || exit + +TERRAFORM_OPTS=() + +# echo 'pull latest code ...' +# git pull origin master + +usage() { + echo "usage: $programname [-e environment] [-o operation]" + echo "MANDATORY:" + echo " -e, --environment VAL specify environment [global sandbox staging production management ops new_sandbox]" + echo " -o, --operation VAL specify operation [plan print_output apply]" + echo "OPTIONAL:" + echo " -a, --auto-approve TERRAFORM_OPTS: auto-approve on apply" + exit 1 +} + +parse_params() { + while [ ! $# -eq 0 ]; do + case "$1" in + --help | -h) + usage + exit + ;; + --environment | -e) + ENV=$2 + if [[ $ENV != "global" && $ENV != "sandbox" && $ENV != "staging" && $ENV != "production" && $ENV != "management" && $ENV != "ops" && $ENV != "new_sandbox" ]]; then + echo "Wrong environment: $ENV. Valid options: global sandbox staging production management ops" + exit 1 + fi + ;; + --operation | -o) + OPER=$2 + if [[ $OPER != "plan" && $OPER != "print_output" && $OPER != "apply" ]]; then + echo "Wrong operation: $OPER. Valid options: plan print_output apply" + exit 1 + fi + ;; + --auto-approve | -a) + if [[ $OPER == "apply" ]]; then + TERRAFORM_OPTS+=('-auto-approve') + fi + ;; + esac + shift + done +} + +print_params() { + echo "-------------------------------" + echo "ENV : $ENV" + echo "OPER : $OPER" + echo "-------------------------------" +} + +select_environment() { + ENVS=("global" "sandbox" "staging" "production" "management" "ops") + echo "Select environment:" + select var in "${ENVS[@]}"; do + ENV=$var + break + done +} + +select_oper() { + OPERS=("apply" "plan" "print_output") + echo "Select operation:" + select oper in "${OPERS[@]}"; do + OPER=$oper + break + done +} + +release_notes() { + RELEASE="RELEASES.md" + if ! grep -q "$PROJECT" $RELEASE; then + echo "#$PROJECT" >>$RELEASE + fi + DATE=$(date +%Y-%m-%d) + sed -i "/$PROJECT/a * **$DATE** - $DESCRIPTION" $RELEASE +} + +get_output_var() { + terraform output -json | jq -r ".$1.value" +} + +# Display output +display_output() { + terraform output +} + +do_project() { + # cd to env folder + cd "environments/$ENV" || exit + + # Deploy architecture + if [[ $OPER == "print_output" ]]; then + display_output + else + echo "Performing $OPER" + terraform "$OPER" "${TERRAFORM_OPTS[@]}" || exit 1 + fi +} + +update_shared_json() { + if [[ $ENV == "global" ]]; then + echo "[Skipping] Uploading shared.json to S3 - global env does not expose shared.json" + elif [[ $OPER != "apply" ]]; then + echo "[Skipping] Uploading shared.json to S3 - terraform outputs are updated only on apply" + else + echo 'Uploading shared.json to S3 ...' + + output=$(terraform output -json) + echo "$output" >shared.json + + aws s3 cp shared.json "s3://lambda-$ENV.spire.io/shared.json" + fi +} + +# execution sequence: +[[ $# -eq 0 ]] && usage +parse_params "$@" +print_params +# select_project +# select_environment +# select_oper +do_project +update_shared_json + +echo '' +echo 'done.' From 69eb5b5d36f7d1b1b2f324c5e1bc570aba892401 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:08:05 +0530 Subject: [PATCH 04/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51ed3af..4d8e58e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -e -o plan -a terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest From 21a3e11879b5d53885a5818dc7c287ee9aa82914 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:10:05 +0530 Subject: [PATCH 05/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d8e58e..b6c0beb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e -o plan -a + ./deploy.sh -e sandbox -o plan -a terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest From 457a65ac10a1b8e55da8649afa0944a464a30062 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:14:43 +0530 Subject: [PATCH 06/27] Update release.yml --- .github/workflows/release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6c0beb..94ee3f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,10 +30,7 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest @@ -59,6 +56,12 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/production' tf_actions_comment: true + - name: run shell script + run: | + source $BASH_ENV + chmod +x ./deploy.sh + ./deploy.sh -e production -o plan -a + terraform-sandbox: name: "sandbox-Terraform" runs-on: ubuntu-latest From 261bd62898edb738d769901b14c323639be4934c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:16:45 +0530 Subject: [PATCH 07/27] Update release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94ee3f1..fa15e32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,6 @@ jobs: tf_actions_comment: true - name: run shell script run: | - source $BASH_ENV chmod +x ./deploy.sh ./deploy.sh -e production -o plan -a From 9189ac38f4d9897c17a3b45a495af3be339e06b3 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:48:11 +0530 Subject: [PATCH 08/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa15e32..7bea169 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e production -o plan -a + ./deploy.sh -e sandbox -o plan -a terraform-sandbox: name: "sandbox-Terraform" From 5d6c2c57352da3801f1ebbc42c1cb94accddb16c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:56:43 +0530 Subject: [PATCH 09/27] Update release.yml --- .github/workflows/release.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7bea169..69481df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,10 +56,7 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/production' tf_actions_comment: true - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + terraform-sandbox: name: "sandbox-Terraform" @@ -85,4 +82,8 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true + tf_actions_comment: true + - name: run shell script + run: | + chmod +x ./deploy.sh + ./deploy.sh -e sandbox -o plan -a From 6706a6999dafd7d2e41743cb0e34abb224f031cc Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:37:38 +0530 Subject: [PATCH 10/27] Update release.yml --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69481df..91df5bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,6 +47,7 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' + TERRAFORM_ENVIRONMENT: production tf_actions_working_dir: './environments/production' tf_actions_comment: true - name: 'Terraform plan' @@ -81,6 +82,7 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' + TERRAFORM_ENVIRONMENT: sandbox tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true - name: run shell script From 99032ed70cbbeda4c43cafcd9a9a57a71ec891b7 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:38:48 +0530 Subject: [PATCH 11/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91df5bb..8cc0fe6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,4 +88,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a From e973639d15f1404e15ac936a5e490a4500e09ac3 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:55:33 +0530 Subject: [PATCH 12/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8cc0fe6..7cbb6af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,4 +88,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -a plan From c439db57ddc6872d5fe538aaa5b2945e82c3e83e Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:38:20 +0530 Subject: [PATCH 13/27] Update release.yml --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7cbb6af..435aa09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,8 +84,11 @@ jobs: tf_actions_subcommand: 'plan' TERRAFORM_ENVIRONMENT: sandbox tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true + tf_actions_comment: true + env: + TF_CLI_ARGS_init: '-var="TERRAFORM_ENVIRONMENT=sandbox"' + - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -a plan + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a From 24ba7bafd767dd7f6e86772aabf499f1878aa540 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:44:08 +0530 Subject: [PATCH 14/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 435aa09..eb52ea8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a From 39842d3c051b774736e7dc18df41b4672c1d8a42 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:46:22 +0530 Subject: [PATCH 15/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb52ea8..3348a95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -e 'parameters.TERRAFORM_ENVIRONMENT' -o plan -a From b6250961efcb649352cc29145192f1123438faa5 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:48:14 +0530 Subject: [PATCH 16/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3348a95..dd6a2a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e 'parameters.TERRAFORM_ENVIRONMENT' -o plan -a + ./deploy.sh -e sandbox -o plan -a From 4bd9a39d208b4068cd596f843f60b171bee8f34c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:52:32 +0530 Subject: [PATCH 17/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd6a2a0..e798e68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + ./deploy.sh -e env.TERRAFORM_ENVIRONMENT -o plan -a From ab2717e6cf63fd8fa4d9983f5c93e5c67d26cc54 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:55:14 +0530 Subject: [PATCH 18/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e798e68..daac4fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,7 +86,7 @@ jobs: tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true env: - TF_CLI_ARGS_init: '-var="TERRAFORM_ENVIRONMENT=sandbox"' + ENV: '-var="TERRAFORM_ENVIRONMENT=sandbox"' - name: run shell script run: | From 8df971a3920c112fe2b0b8ec6448f765009b8378 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:11:06 +0530 Subject: [PATCH 19/27] Create deploy.sh --- .github/deploy.sh | 145 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 .github/deploy.sh diff --git a/.github/deploy.sh b/.github/deploy.sh new file mode 100644 index 0000000..4e2baa5 --- /dev/null +++ b/.github/deploy.sh @@ -0,0 +1,145 @@ +#!/usr/bin/env bash + +# set -x # Un-comment to debug this script + +#TF_LOG=DEBUG; TF_LOG_PATH=~tf.log # Un-comment to debug terraform + +if [ -z "${BASH_VERSINFO[*]}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then + echo "This script requires Bash version >= 4" + exit 1 +fi + +programname=$0 +SCRIPT_REL_DIR=$(dirname "${0}") +ROOT=$(realpath "$SCRIPT_REL_DIR/../") +cd "$ROOT" || exit + +TERRAFORM_OPTS=() + +# echo 'pull latest code ...' +# git pull origin master + +usage() { + echo "usage: $programname [-e environment] [-o operation]" + echo "MANDATORY:" + echo " -e, --environment VAL specify environment [global sandbox staging production management ops new_sandbox]" + echo " -o, --operation VAL specify operation [plan print_output apply]" + echo "OPTIONAL:" + echo " -a, --auto-approve TERRAFORM_OPTS: auto-approve on apply" + exit 1 +} + +parse_params() { + while [ ! $# -eq 0 ]; do + case "$1" in + --help | -h) + usage + exit + ;; + --environment | -e) + ENV=$2 + if [[ $ENV != "global" && $ENV != "sandbox" && $ENV != "staging" && $ENV != "production" && $ENV != "management" && $ENV != "ops" && $ENV != "new_sandbox" ]]; then + echo "Wrong environment: $ENV. Valid options: global sandbox staging production management ops" + exit 1 + fi + ;; + --operation | -o) + OPER=$2 + if [[ $OPER != "plan" && $OPER != "print_output" && $OPER != "apply" ]]; then + echo "Wrong operation: $OPER. Valid options: plan print_output apply" + exit 1 + fi + ;; + --auto-approve | -a) + if [[ $OPER == "apply" ]]; then + TERRAFORM_OPTS+=('-auto-approve') + fi + ;; + esac + shift + done +} + +print_params() { + echo "-------------------------------" + echo "ENV : $ENV" + echo "OPER : $OPER" + echo "-------------------------------" +} + +select_environment() { + ENVS=("global" "sandbox" "staging" "production" "management" "ops") + echo "Select environment:" + select var in "${ENVS[@]}"; do + ENV=$var + break + done +} + +select_oper() { + OPERS=("apply" "plan" "print_output") + echo "Select operation:" + select oper in "${OPERS[@]}"; do + OPER=$oper + break + done +} + +release_notes() { + RELEASE="RELEASES.md" + if ! grep -q "$PROJECT" $RELEASE; then + echo "#$PROJECT" >>$RELEASE + fi + DATE=$(date +%Y-%m-%d) + sed -i "/$PROJECT/a * **$DATE** - $DESCRIPTION" $RELEASE +} + +get_output_var() { + terraform output -json | jq -r ".$1.value" +} + +# Display output +display_output() { + terraform output +} + +do_project() { + # cd to env folder + cd "environments/$ENV" || exit + + # Deploy architecture + if [[ $OPER == "print_output" ]]; then + display_output + else + echo "Performing $OPER" + terraform "$OPER" "${TERRAFORM_OPTS[@]}" || exit 1 + fi +} + +update_shared_json() { + if [[ $ENV == "global" ]]; then + echo "[Skipping] Uploading shared.json to S3 - global env does not expose shared.json" + elif [[ $OPER != "apply" ]]; then + echo "[Skipping] Uploading shared.json to S3 - terraform outputs are updated only on apply" + else + echo 'Uploading shared.json to S3 ...' + + output=$(terraform output -json) + echo "$output" >shared.json + + aws s3 cp shared.json "s3://lambda-$ENV.spire.io/shared.json" + fi +} + +# execution sequence: +[[ $# -eq 0 ]] && usage +parse_params "$@" +print_params +# select_project +# select_environment +# select_oper +do_project +update_shared_json + +echo '' +echo 'done.' From 8a9c46c7cbd9655e3c68b04dfb1ccb4ebdb6fa7f Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:16:23 +0530 Subject: [PATCH 20/27] Update release.yml --- .github/workflows/release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index daac4fc..eda5058 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,10 +62,7 @@ jobs: terraform-sandbox: name: "sandbox-Terraform" runs-on: ubuntu-latest - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + environment: sandbox steps: - name: 'Checkout' From 3eaf5a41448897b908f3ed417debd91aee985bbf Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:22:34 +0530 Subject: [PATCH 21/27] Update release.yml --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eda5058..be1d4bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,6 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' - TERRAFORM_ENVIRONMENT: production tf_actions_working_dir: './environments/production' tf_actions_comment: true - name: 'Terraform plan' @@ -79,7 +78,6 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' - TERRAFORM_ENVIRONMENT: sandbox tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true env: @@ -88,4 +86,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e env.TERRAFORM_ENVIRONMENT -o plan -a + ./deploy.sh -e sandbox -o plan -a From d1d6c092576ced91e36df28510765a3efcd68e1f Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:27:19 +0530 Subject: [PATCH 22/27] Update release.yml --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be1d4bf..590ddad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,10 @@ jobs: terraform-sandbox: name: "sandbox-Terraform" runs-on: ubuntu-latest - environment: sandbox + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' @@ -81,7 +84,7 @@ jobs: tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true env: - ENV: '-var="TERRAFORM_ENVIRONMENT=sandbox"' + ENV: '-var="ENV=sandbox"' - name: run shell script run: | From 00393ed8d7547b674843aade6bd997a57be59e0b Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:36:21 +0530 Subject: [PATCH 23/27] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 590ddad..0379efd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,4 +89,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + ./deploy.sh -e echo $sandbox -o plan -a From 5260ba1ba936613a70a19e1afc1e1b012f63aedf Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 12:56:51 +0530 Subject: [PATCH 24/27] adding deploy.sh --- .github/workflows/apply.yml | 80 ++++++++++++++-------------- .github/workflows/release.yml | 52 ++++++++---------- {.github => bin}/deploy.sh | 0 environments/production/variables.tf | 16 +++--- environments/production/vpc.tf | 3 ++ environments/sandbox/variables.tf | 2 +- environments/sandbox/vpc.tf | 1 + modules/core/variables.tf | 0 modules/vpc/main.tf | 2 +- modules/vpc/output.tf | 23 ++++++++ modules/vpc/variables.tf | 2 +- provider.tf | 5 +- 12 files changed, 104 insertions(+), 82 deletions(-) rename {.github => bin}/deploy.sh (100%) create mode 100644 modules/core/variables.tf create mode 100644 modules/vpc/output.tf diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 2416919..d06a5db 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -5,54 +5,52 @@ on: types: [ closed ] jobs: - terraform-management: - name: "Terraform-modules" - runs-on: ubuntu-latest - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + # terraform-module: + # name: "Terraform-modules" + # runs-on: ubuntu-latest + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + # AWS_REGION: 'ap-east-1' - steps: - - name: 'Checkout' - uses: actions/checkout@master - - name: 'Terraform Init' - uses: hashicorp/terraform-github-actions@master - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'init' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - name: 'Terraform plan' - uses: hashicorp/terraform-github-actions@master - - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'plan' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - name: 'Terraform apply' - uses: hashicorp/terraform-github-actions@master - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'apply' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh + # steps: + # - name: 'Checkout' + # uses: actions/checkout@master + # - name: 'Terraform Init' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'init' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true + # - name: 'Terraform plan' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'plan' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true + # - name: 'Terraform apply' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'apply' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true terraform: name: "Terraform" + needs: terraform-sandbox runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'eu-central-1' steps: - name: 'Checkout' uses: actions/checkout@master + - name: set-env + run: echo "tf_actions_working_dir=$(echo $tf_actions_working_dir | cut -c 1-6)" >> $GITHUB_ENV - name: 'Terraform Init' uses: hashicorp/terraform-github-actions@master with: @@ -60,8 +58,11 @@ jobs: tf_actions_subcommand: 'init' tf_actions_working_dir: './environments/production' tf_actions_comment: true + - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master + - name: set env + run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' @@ -76,11 +77,12 @@ jobs: tf_actions_comment: true terraform-sandbox: name: "sandbox-Terraform" + runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'ap-south-1' steps: - name: 'Checkout' @@ -105,4 +107,4 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'apply' tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true + tf_actions_comment: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0379efd..bfce7b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'ap-east-1' steps: - name: 'Checkout' @@ -23,21 +23,21 @@ jobs: tf_actions_subcommand: 'init' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true - - name: 'Terraform plan' - uses: hashicorp/terraform-github-actions@master - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'plan' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - terraform-prod: - name: "Terraform-prod" + # - name: 'Terraform plan' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'plan' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true + terraform-sandbox: + name: "sandbox-Terraform" + needs: terraform-module runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'ap-south-1' steps: - name: 'Checkout' @@ -47,24 +47,23 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' - tf_actions_working_dir: './environments/production' + tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' - tf_actions_working_dir: './environments/production' - tf_actions_comment: true - - - terraform-sandbox: - name: "sandbox-Terraform" + tf_actions_working_dir: './environments/sandbox' + tf_actions_comment: true + terraform-prod: + name: "Terraform-prod" + needs: terraform-sandbox runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'eu-central-1' steps: - name: 'Checkout' @@ -74,19 +73,12 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' - tf_actions_working_dir: './environments/sandbox' + tf_actions_working_dir: './environments/production' tf_actions_comment: true - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' - tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true - env: - ENV: '-var="ENV=sandbox"' - - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh -e echo $sandbox -o plan -a + tf_actions_working_dir: './environments/production' + tf_actions_comment: true \ No newline at end of file diff --git a/.github/deploy.sh b/bin/deploy.sh similarity index 100% rename from .github/deploy.sh rename to bin/deploy.sh diff --git a/environments/production/variables.tf b/environments/production/variables.tf index 1d77dfa..45cdb67 100644 --- a/environments/production/variables.tf +++ b/environments/production/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-2" + default = "eu-central-1" } variable "zones" { @@ -11,21 +11,21 @@ variable "zones" { } variable "vpc_cidr" { - default = "10.0.0.0/16" + default = "10.100.0.0/16" } variable "public_subnet_cidr_blocks" { default = { - zone0 = "10.0.10.0/24" - zone1 = "10.0.20.0/24" - zone2 = "10.0.30.0/24" + zone0 = "10.100.10.0/24" + zone1 = "10.100.20.0/24" + zone2 = "10.100.30.0/24" } } variable "private_subnet_cidr_blocks" { default = { - zone0 = "10.0.11.0/24" - zone1 = "10.0.21.0/24" - zone2 = "10.0.31.0/24" + zone0 = "10.100.11.0/24" + zone1 = "10.100.21.0/24" + zone2 = "10.100.31.0/24" } } diff --git a/environments/production/vpc.tf b/environments/production/vpc.tf index 5ba3782..f58b0cd 100644 --- a/environments/production/vpc.tf +++ b/environments/production/vpc.tf @@ -1,3 +1,4 @@ +# VPC module "vpc" { source = "../../modules/vpc" vpc_cidr = var.vpc_cidr @@ -5,3 +6,5 @@ module "vpc" { region = var.region zones = var.zones } + +## Security groups diff --git a/environments/sandbox/variables.tf b/environments/sandbox/variables.tf index 1d77dfa..d9784ea 100644 --- a/environments/sandbox/variables.tf +++ b/environments/sandbox/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-2" + default = "ap-south-1" } variable "zones" { diff --git a/environments/sandbox/vpc.tf b/environments/sandbox/vpc.tf index 5ba3782..c3108d1 100644 --- a/environments/sandbox/vpc.tf +++ b/environments/sandbox/vpc.tf @@ -1,3 +1,4 @@ +# VPC module "vpc" { source = "../../modules/vpc" vpc_cidr = var.vpc_cidr diff --git a/modules/core/variables.tf b/modules/core/variables.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/vpc/main.tf b/modules/vpc/main.tf index 341708f..ce1d93a 100644 --- a/modules/vpc/main.tf +++ b/modules/vpc/main.tf @@ -5,7 +5,7 @@ # VPC resource "aws_vpc" "default" { cidr_block = var.vpc_cidr - enable_dns_hostnames = false + enable_dns_hostnames = true tags = { Environment = var.env diff --git a/modules/vpc/output.tf b/modules/vpc/output.tf new file mode 100644 index 0000000..846c56e --- /dev/null +++ b/modules/vpc/output.tf @@ -0,0 +1,23 @@ +output "vpc_id" { + value = aws_vpc.default.id +} + +output "vpc_public_subnets" { + value = aws_subnet.public.*.id +} + +output "vpc_private_subnets" { + value = aws_subnet.private.*.id +} + +output "lambda_subnets" { + value = aws_subnet.private.*.id +} + +output "vpc_private_rt" { + value = aws_route_table.main.id +} + +output "vpc_public_rt" { + value = aws_route_table.custom.id +} diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index 1d63aed..83df322 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-west-2" + default = "ap-east-1" } variable "zones" { diff --git a/provider.tf b/provider.tf index 336dd3a..cf0b0db 100644 --- a/provider.tf +++ b/provider.tf @@ -1,4 +1,5 @@ provider "aws" { - region = var.region - version = "~> 2.70.0" + region = "us-east-2" + access_key = "AKIAXDSL7DJCRCBXV7E2" + secret_key = "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" } \ No newline at end of file From 14fe14bbc006724ad085d1fb4fa21a39efcf52fd Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 13:37:02 +0530 Subject: [PATCH 25/27] update apply.yml file --- deploy.sh | 145 ------------------------------------------------------ 1 file changed, 145 deletions(-) delete mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index 4e2baa5..0000000 --- a/deploy.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env bash - -# set -x # Un-comment to debug this script - -#TF_LOG=DEBUG; TF_LOG_PATH=~tf.log # Un-comment to debug terraform - -if [ -z "${BASH_VERSINFO[*]}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then - echo "This script requires Bash version >= 4" - exit 1 -fi - -programname=$0 -SCRIPT_REL_DIR=$(dirname "${0}") -ROOT=$(realpath "$SCRIPT_REL_DIR/../") -cd "$ROOT" || exit - -TERRAFORM_OPTS=() - -# echo 'pull latest code ...' -# git pull origin master - -usage() { - echo "usage: $programname [-e environment] [-o operation]" - echo "MANDATORY:" - echo " -e, --environment VAL specify environment [global sandbox staging production management ops new_sandbox]" - echo " -o, --operation VAL specify operation [plan print_output apply]" - echo "OPTIONAL:" - echo " -a, --auto-approve TERRAFORM_OPTS: auto-approve on apply" - exit 1 -} - -parse_params() { - while [ ! $# -eq 0 ]; do - case "$1" in - --help | -h) - usage - exit - ;; - --environment | -e) - ENV=$2 - if [[ $ENV != "global" && $ENV != "sandbox" && $ENV != "staging" && $ENV != "production" && $ENV != "management" && $ENV != "ops" && $ENV != "new_sandbox" ]]; then - echo "Wrong environment: $ENV. Valid options: global sandbox staging production management ops" - exit 1 - fi - ;; - --operation | -o) - OPER=$2 - if [[ $OPER != "plan" && $OPER != "print_output" && $OPER != "apply" ]]; then - echo "Wrong operation: $OPER. Valid options: plan print_output apply" - exit 1 - fi - ;; - --auto-approve | -a) - if [[ $OPER == "apply" ]]; then - TERRAFORM_OPTS+=('-auto-approve') - fi - ;; - esac - shift - done -} - -print_params() { - echo "-------------------------------" - echo "ENV : $ENV" - echo "OPER : $OPER" - echo "-------------------------------" -} - -select_environment() { - ENVS=("global" "sandbox" "staging" "production" "management" "ops") - echo "Select environment:" - select var in "${ENVS[@]}"; do - ENV=$var - break - done -} - -select_oper() { - OPERS=("apply" "plan" "print_output") - echo "Select operation:" - select oper in "${OPERS[@]}"; do - OPER=$oper - break - done -} - -release_notes() { - RELEASE="RELEASES.md" - if ! grep -q "$PROJECT" $RELEASE; then - echo "#$PROJECT" >>$RELEASE - fi - DATE=$(date +%Y-%m-%d) - sed -i "/$PROJECT/a * **$DATE** - $DESCRIPTION" $RELEASE -} - -get_output_var() { - terraform output -json | jq -r ".$1.value" -} - -# Display output -display_output() { - terraform output -} - -do_project() { - # cd to env folder - cd "environments/$ENV" || exit - - # Deploy architecture - if [[ $OPER == "print_output" ]]; then - display_output - else - echo "Performing $OPER" - terraform "$OPER" "${TERRAFORM_OPTS[@]}" || exit 1 - fi -} - -update_shared_json() { - if [[ $ENV == "global" ]]; then - echo "[Skipping] Uploading shared.json to S3 - global env does not expose shared.json" - elif [[ $OPER != "apply" ]]; then - echo "[Skipping] Uploading shared.json to S3 - terraform outputs are updated only on apply" - else - echo 'Uploading shared.json to S3 ...' - - output=$(terraform output -json) - echo "$output" >shared.json - - aws s3 cp shared.json "s3://lambda-$ENV.spire.io/shared.json" - fi -} - -# execution sequence: -[[ $# -eq 0 ]] && usage -parse_params "$@" -print_params -# select_project -# select_environment -# select_oper -do_project -update_shared_json - -echo '' -echo 'done.' From da05d57131a9a2ebb72e44a63420baa6692f30f4 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 13:40:10 +0530 Subject: [PATCH 26/27] update apply.yml file --- .github/workflows/apply.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index d06a5db..9f142a3 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -62,7 +62,7 @@ jobs: - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master - name: set env - run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan + run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan >> $GITHUB_ENV with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' From ee428716f66b2fbfd2546e64cf7f15f20640ba28 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 13:42:33 +0530 Subject: [PATCH 27/27] updated tf files --- .github/workflows/apply.yml | 2 +- provider.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 9f142a3..f09c4f4 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -62,7 +62,7 @@ jobs: - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master - name: set env - run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan >> $GITHUB_ENV + run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan >> $GITHUB_ENV with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' diff --git a/provider.tf b/provider.tf index cf0b0db..4c75b5a 100644 --- a/provider.tf +++ b/provider.tf @@ -1,5 +1,5 @@ provider "aws" { region = "us-east-2" - access_key = "AKIAXDSL7DJCRCBXV7E2" - secret_key = "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" + access_key = "AKIAXDSL7DJCYKZR6MFU" + secret_key = "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" } \ No newline at end of file