File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 88 tag_or_sha_to_deploy :
99 description : " Commit sha or tag to deploy"
1010 required : true
11+ secret_aws_iam_role :
12+ description : " AWS IAM role"
13+ required : true
14+ secret_aws_account_id :
15+ description : " AWS account id"
16+ required : true
17+ secret_aws_slack_channel_id :
18+ description : " AWS slack channel id"
19+ required : true
1120
1221runs :
1322 using : composite
@@ -38,17 +47,17 @@ runs:
3847 uses : aws-actions/configure-aws-credentials@v5
3948 with :
4049 role-session-name : GitHubActionsSession
41- role-to-assume : ${{ secrets.IAM_ROLE }}
50+ role-to-assume : ${{ inputs.secret_aws_account_id }}
4251 aws-region : eu-west-2
4352
4453 - name : " Download artefacts from S3 bucket"
4554 shell : bash
4655 run : |
4756 if [[ "${{ inputs.environment }}" == "dev" ]]; then
48- bucket_name="vita-${{ secrets.AWS_ACCOUNT_ID }}-artefacts-${{ inputs.environment }}"
57+ bucket_name="vita-${{ inputs.secret_aws_account_id }}-artefacts-${{ inputs.environment }}"
4958 folder_name="sha"
5059 else
51- bucket_name="vita-${{ secrets.AWS_ACCOUNT_ID }}-releases-${{ inputs.environment }}"
60+ bucket_name="vita-${{ inputs.secret_aws_account_id }}-releases-${{ inputs.environment }}"
5261 folder_name="tag"
5362
5463 s3_artefacts_path="s3://${bucket_name}/${folder_name}/${{ steps.tag-or-sha.outputs.value }}"
6574 shell : bash
6675 run : |
6776 echo "TF_VAR_is_github_action=true" >> $GITHUB_ENV
68- echo "TF_VAR_alarms_slack_channel_id=${{ secrets.ALARMS_SLACK_CHANNEL_ID }}" >> $GITHUB_ENV
77+ echo "TF_VAR_alarms_slack_channel_id=${{ inputs.secret_aws_slack_channel_id }}" >> $GITHUB_ENV
6978 echo "TF_VAR_app_version=${{ steps.tag-or-sha.outputs.value }}" >> $GITHUB_ENV
7079
7180 - name : " Terraform init (iam)"
Original file line number Diff line number Diff line change 5050 with :
5151 environment : " preprod"
5252 tag_or_sha_to_deploy : ${{ steps.get-latest-tag-name.outputs.value }}
53+ secret_aws_account_id : ${{ secrets.AWS_ACCOUNT_ID }}
54+ secret_aws_iam_role : ${{ secrets.IAM_ROLE }}
55+ secret_aws_slack_channel_id : ${{ secrets.ALARMS_SLACK_CHANNEL_ID }}
5356
5457 deploy-and-test-main :
5558 name : " Main Branch Assurance"
9093 with :
9194 environment : " preprod"
9295 tag_or_sha_to_deploy : ${{ steps.get-latest-tag-name.outputs.value }}
96+ secret_aws_account_id : ${{ secrets.AWS_ACCOUNT_ID }}
97+ secret_aws_iam_role : ${{ secrets.IAM_ROLE }}
98+ secret_aws_slack_channel_id : ${{ secrets.ALARMS_SLACK_CHANNEL_ID }}
You can’t perform that action at this time.
0 commit comments