Skip to content

Commit 21014f9

Browse files
committed
NRL-1595 attempt to fix bad apply command
1 parent 18609da commit 21014f9

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

.github/workflows/deploy-account-wide-infra.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Deploy Account-wide infrastructure
2-
run-name: Account-wide infra deployment to ${{ inputs.environment }} of ${{ github.ref_name }} by ${{ github.actor }}
2+
run-name: Account-wide infra deployment to ${{ 'account-dev' }} of ${{ github.ref_name }} by ${{ github.actor }}
3+
4+
# Tidy up your commit history gurl!!
5+
6+
# Put together better PR desceriptuion https://github.com/NHSDigital/NRLF/pull/1098
37

48
on:
59
workflow_dispatch:
@@ -28,7 +32,7 @@ jobs:
2832
steps:
2933
- name: Validate environment
3034
env:
31-
IS_VALID_ENV: ${{ startsWith(inputs.environment, 'account-') }}
35+
IS_VALID_ENV: ${{ startsWith('account-dev', 'account-') }}
3236
run: |
3337
echo "valid workflow environment selected:" $IS_VALID_ENV
3438
if [[ $IS_VALID_ENV == true ]]; then
@@ -37,8 +41,8 @@ jobs:
3741
exit 1
3842
3943
terraform-plan:
40-
name: Terraform Plan - ${{ inputs.environment }}
41-
environment: ${{ inputs.environment }}
44+
name: Terraform Plan - ${{ 'account-dev' }}
45+
environment: ${{ 'account-dev' }}
4246
needs: [check-selected-environment]
4347
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
4448

@@ -58,7 +62,7 @@ jobs:
5862
with:
5963
aws-region: eu-west-2
6064
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
61-
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id }}
65+
role-session-name: github-actions-ci-${{ 'account-dev' }}-${{ github.run_id }}
6266

6367
- name: Retrieve Server Certificates
6468
env:
@@ -94,10 +98,10 @@ jobs:
9498
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
9599
96100
terraform-apply:
97-
name: Terraform Apply - ${{ inputs.environment }}
101+
name: Terraform Apply - ${{ 'account-dev' }}
98102
needs: [terraform-plan]
99103
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
100-
environment: ${{ inputs.environment }}
104+
environment: ${{ 'account-dev' }}
101105

102106
steps:
103107
- name: Git clone - ${{ github.ref_name }}
@@ -115,12 +119,12 @@ jobs:
115119
with:
116120
aws-region: eu-west-2
117121
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
118-
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}
122+
role-session-name: github-actions-ci-${{ 'account-dev' }}-${{ github.run_id}}
119123

120124
- name: Download Terraform Plan artifact
121125
env:
122126
ACCOUNT_NAME: ${{ vars.ACCOUNT_NAME }}
123-
run: aws s3 cp s3://nhsd-nrlf--mgmt--github-ci-logging/acc-$ACCOUNT_NAME/${{ github.run_id }}/tfplan terraform/account-wide-infrastructure/tfplan
127+
run: aws s3 cp s3://nhsd-nrlf--mgmt--github-ci-logging/acc-$ACCOUNT_NAME/${{ github.run_id }}/tfplan terraform/account-wide-infrastructure/${ACCOUNT_NAME}/tfplan
124128

125129
- name: Retrieve Server Certificates
126130
env:
@@ -141,9 +145,7 @@ jobs:
141145
ACCOUNT_NAME: ${{ vars.ACCOUNT_NAME }}
142146
ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
143147
run: |
144-
terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} apply tfplan \
145-
-var assume_account=${ACCOUNT_ID} \
146-
-var assume_role=terraform
148+
terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} apply tfplan
147149
148150
- name: Update environment config version
149151
env:

0 commit comments

Comments
 (0)