@@ -102,7 +102,7 @@ jobs:
102102 ACCOUNT_NAME : ${{ vars.ACCOUNT_NAME }}
103103 run : |
104104 terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} show -no-color tfplan > terraform/account-wide-infrastructure/$ACCOUNT_NAME/tfplan.txt
105- ls terraform/account-wide-infrastructure/$ACCOUNT_NAME/
105+
106106 aws s3 cp terraform/account-wide-infrastructure/$ACCOUNT_NAME/tfplan s3://nhsd-nrlf--mgmt--github-ci-logging/acc-$ACCOUNT_NAME/${{ github.run_id }}/tfplan
107107 aws s3 cp terraform/account-wide-infrastructure/$ACCOUNT_NAME/tfplan.txt s3://nhsd-nrlf--mgmt--github-ci-logging/acc-$ACCOUNT_NAME/${{ github.run_id }}/tfplan.txt
108108
@@ -149,22 +149,21 @@ jobs:
149149 terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} workspace new ${ACCOUNT_NAME} || \
150150 terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} workspace select ${ACCOUNT_NAME}
151151
152- # - name: Terraform Apply
153- # env:
154- # AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
155- # run: |
156- # terraform -chdir=terraform/account-wide-infrastructure apply tfplan \
157- # -var 'assume_account=AWS_ACCOUNT_ID' \
158- # -var 'assume_role=terraform'
159-
160- # TODO: fix this
161- # # Is this where we'd burn commit & datetime into state?
162- # - name: Update environment config version
163- # env:
164- # ENVIRONMENT: ${{ 'account-dev' }}
165- # run: |
166- # deployed_version=$(terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} output --raw version)
167- # poetry run python ./scripts/set_env_config.py inactive-version ${deployed_version} $ENVIRONMENT
152+ - name : Terraform Apply
153+ env :
154+ ACCOUNT_NAME : ${{ vars.ACCOUNT_NAME }}
155+ ACCOUNT_ID : ${{ secrets.AWS_ACCOUNT_ID }}
156+ run : |
157+ terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} tfplan \
158+ -var assume_account=${ACCOUNT_ID} \
159+ -var assume_role=terraform
160+
161+ - name : Update environment config version
162+ env :
163+ ACCOUNT_NAME : ${{ vars.ACCOUNT_NAME }}
164+ run : |
165+ deployed_version=$(terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} output --raw version)
166+ echo $deployed_version
168167
169168 # Slack notif: starting deploy of account-wide infra <branch deets>
170169 # tf-plan: ensure output is visible in job output
0 commit comments