From dbd3552fcde446a5f1b8dafcb2473865f5533ed2 Mon Sep 17 00:00:00 2001 From: Michael Pond Date: Wed, 25 Sep 2024 10:52:48 -0400 Subject: [PATCH] updates for create dev --- .../terragrunt_create_dev_environment.yml | 171 +++++++++++------- 1 file changed, 109 insertions(+), 62 deletions(-) diff --git a/.github/workflows/terragrunt_create_dev_environment.yml b/.github/workflows/terragrunt_create_dev_environment.yml index beb784783..268f5a8c0 100644 --- a/.github/workflows/terragrunt_create_dev_environment.yml +++ b/.github/workflows/terragrunt_create_dev_environment.yml @@ -37,11 +37,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - - name: terragrunt apply common + - name: terragrunt apply COMMON run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/common terragrunt apply --terragrunt-non-interactive -auto-approve @@ -83,11 +85,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply ECR run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/ecr terragrunt apply --terragrunt-non-interactive -auto-approve @@ -112,11 +116,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb - + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars + - name: terragrunt apply ses_receiving_emails run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/ses_receiving_emails terragrunt apply --terragrunt-non-interactive -auto-approve @@ -141,11 +147,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply dns run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/dns terragrunt apply --terragrunt-non-interactive -auto-approve @@ -170,11 +178,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply ses_validation_dns_entries run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/ses_validation_dns_entries terragrunt apply --terragrunt-non-interactive -auto-approve @@ -200,13 +210,15 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply cloudfront run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/cloudfront - terragrunt apply --terragrunt-non-interactive -auto-approve + terragrunt apply --terragrunt-non-interactive -auto-approve terragrunt-apply-eks: if: | @@ -229,12 +241,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply eks - continue-on-error: true run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/eks terragrunt apply --terragrunt-non-interactive -auto-approve @@ -259,11 +272,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply elasticache run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/elasticache terragrunt apply --terragrunt-non-interactive -auto-approve @@ -288,11 +303,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply rds run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/rds terragrunt apply --terragrunt-non-interactive -auto-approve @@ -314,16 +331,18 @@ jobs: # role_to_assume: arn:aws:iam::${{env.ACCOUNT_ID}}:role/notification-terraform-apply # role_session_name: NotifyTerraformApply - # - name: Install 1Pass CLI - # run: | - # curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - # sudo dpkg -i 1pass.deb + # - name: Install 1Pass CLI + # run: | + # curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb + # sudo dpkg -i 1pass.deb + # sudo mkdir -p aws + # cd aws + # op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - # - name: terragrunt apply lambda-api - # run: | - # op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars - # cd env/${{env.ENVIRONMENT}}/lambda-api - # terragrunt apply --terragrunt-non-interactive -auto-approve + # - name: terragrunt apply lambda-api + # run: | + # cd env/${{env.ENVIRONMENT}}/lambda-api + # terragrunt apply --terragrunt-non-interactive -auto-approve terragrunt-apply-lambda-admin-pr: if: | @@ -346,11 +365,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply lambda-admin-pr run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/lambda-admin-pr terragrunt apply --terragrunt-non-interactive -auto-approve @@ -375,11 +396,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply performance-test run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/performance-test terragrunt apply --terragrunt-non-interactive -auto-approve @@ -404,11 +427,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply heartbeat run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/heartbeat terragrunt apply --terragrunt-non-interactive -auto-approve @@ -433,7 +458,10 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: Configure credentials to Notify Private ECR using OIDC uses: aws-actions/configure-aws-credentials@master @@ -444,11 +472,10 @@ jobs: - name: Login to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 + uses: aws-actions/amazon-ecr-login@v2 - name: terragrunt apply database-tools run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/database-tools terragrunt apply --terragrunt-non-interactive -auto-approve @@ -473,11 +500,13 @@ jobs: # - name: Install 1Pass CLI # run: | # curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - # sudo dpkg -i 1pass.deb + # sudo dpkg -i 1pass.deb + # sudo mkdir -p aws + # cd aws + # op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars # - name: terragrunt apply quicksight # run: | - # op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars # cd env/${{env.ENVIRONMENT}}/quicksight # terragrunt apply --terragrunt-non-interactive -auto-approve @@ -502,11 +531,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb - + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars + - name: terragrunt apply lambda-google-cidr run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/lambda-google-cidr terragrunt apply --terragrunt-non-interactive -auto-approve @@ -531,11 +562,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply ses_to_sqs_email_callbacks run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/ses_to_sqs_email_callbacks terragrunt apply --terragrunt-non-interactive -auto-approve @@ -560,13 +593,15 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply sns_to_sqs_sms_callbacks run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/sns_to_sqs_sms_callbacks - terragrunt apply --terragrunt-non-interactive -auto-approve -refresh=false + terragrunt apply --terragrunt-non-interactive -auto-approve terragrunt-apply-pinpoint_to_sqs_sms_callbacks: if: | @@ -589,11 +624,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply pinpoint_to_sqs_sms_callbacks run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/pinpoint_to_sqs_sms_callbacks terragrunt apply --terragrunt-non-interactive -auto-approve @@ -618,11 +655,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - name: terragrunt apply system_status run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/system_status terragrunt apply --terragrunt-non-interactive -auto-approve @@ -647,11 +686,13 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - - name: terragrunt apply aws/system_status_static_site + - name: terragrunt apply system_status_static_site run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars cd env/${{env.ENVIRONMENT}}/system_status_static_site terragrunt apply --terragrunt-non-interactive -auto-approve @@ -676,12 +717,14 @@ jobs: - name: Install 1Pass CLI run: | curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb - sudo dpkg -i 1pass.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars - - name: terragrunt apply aws/newrelic + - name: terragrunt apply newrelic run: | cd env/${{env.ENVIRONMENT}}/newrelic - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars terragrunt apply --terragrunt-non-interactive -auto-approve deploy-application: @@ -754,8 +797,12 @@ jobs: - name: terragrunt apply k8s-fix continue-on-error: true run: | - op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > /var/tmp/${{env.ENVIRONMENT}}.tfvars - cd env/${{env.ENVIRONMENT}}/${{env.ENVIRONMENT}}_only_kubernetes_fix + curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb + sudo dpkg -i 1pass.deb + sudo mkdir -p aws + cd aws + op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - ${{env.ENVIRONMENT}}"/notesPlain > ${{env.ENVIRONMENT}}.tfvars + cd ../env/${{env.ENVIRONMENT}}/${{env.ENVIRONMENT}}_only_kubernetes_fix export TF_VAR_role_name=$(aws iam list-roles | jq -r '.Roles[] | select(.RoleName|match("AWSReservedSSO_AWSAdministratorAccess_*")) | .RoleName') terragrunt apply --terragrunt-non-interactive -auto-approve