-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (43 loc) · 1.6 KB
/
deploy-role-PRX-GHA-AccessRole.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deploy PRX-GHA-AccessRole
on:
push:
branches:
- main
paths:
- iam-roles/PRX-GHA-AccessRole/template.yml
concurrency:
group: ${{ github.workflow }}
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::048723829744:role/PRX-GHA-AccessRole
role-session-name: gha-deploy-gha-accessrole
- name: Deploy to management account
working-directory: iam-roles/PRX-GHA-AccessRole
run: |
aws cloudformation deploy \
--region us-east-2 \
--stack-name PRX-GHA-AccessRole \
--template-file template.yml \
--capabilities CAPABILITY_NAMED_IAM \
--no-fail-on-empty-changeset \
--role-arn arn:aws:iam::048723829744:role/PRX-GHA-ServiceRoleForCloudFormation
- name: Update stack set
working-directory: iam-roles/PRX-GHA-AccessRole
run: |
template_body=$(cat template.yml)
aws cloudformation update-stack-set \
--stack-set-name PRX-GHA-AccessRole \
--capabilities CAPABILITY_NAMED_IAM \
--template-body "$template_body" \
--operation-preferences FailureTolerancePercentage=100,MaxConcurrentPercentage=100,ConcurrencyMode=SOFT_FAILURE_TOLERANCE,RegionConcurrencyType=PARALLEL \
--auto-deployment Enabled=true,RetainStacksOnAccountRemoval=false