Skip to content

Commit 0451c7f

Browse files
VIA-598 AJ/DB WIP fixing IAM permission issue by a workaround
1 parent 0f120ce commit 0451c7f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/actions/deploy/action.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,17 @@ runs:
7676
run: |
7777
echo "TF_VAR_is_github_action=true" >> $GITHUB_ENV
7878
echo "TF_VAR_alarms_slack_channel_id=${{ inputs.secret_aws_slack_channel_id }}" >> $GITHUB_ENV
79-
echo "TF_VAR_app_version=${{ steps.tag-or-sha.outputs.value }}" >> $GITHUB_ENV
79+
echo "TF_VAR_app_version=${{ inputs.tag_or_sha_to_deploy }}" >> $GITHUB_ENV
80+
81+
# Rationale:
82+
# - why? given we reuse preprod for R1.0 and R2.0, when IAM permission change across releases, then deployment fails
83+
# - constraint? make sure IAM permissions in R2.0 is a superset of R1.0
84+
# - what? deploy IAM from R2.0 as it is a superset and will succeed R1.0 deployments as well
85+
- name: "Checkout code"
86+
uses: actions/checkout@v5
87+
with:
88+
fetch-depth: 0
89+
ref: 'main'
8090

8191
- name: "Terraform init (iam)"
8292
shell: bash
@@ -90,6 +100,11 @@ runs:
90100
shell: bash
91101
run: TF_ENV=${{ inputs.environment }}/iam make terraform-apply opts="-auto-approve" opts="terraform-iam.tfplan"
92102

103+
- name: "Checkout code"
104+
uses: actions/checkout@v5
105+
with:
106+
ref: ${{ inputs.tag_or_sha_to_deploy }}
107+
93108
- name: "Terraform init (app)"
94109
shell: bash
95110
run: TF_ENV=${{ inputs.environment }} make terraform-init

0 commit comments

Comments
 (0)