You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/build_docker_image_and_push_to_ecr.yaml
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@ name: build docker image and push it to ECR
3
3
on:
4
4
workflow_call:
5
5
inputs:
6
+
awsRoleArn:
7
+
description: AWS IAM role ARN
8
+
required: false
9
+
type: string
6
10
useOIDC:
7
11
description: Whether to use OIDC for assume role
8
12
required: false
@@ -169,8 +173,8 @@ jobs:
169
173
- name: setup Docker Buildx
170
174
uses: docker/setup-buildx-action@v3
171
175
172
-
#Assume OIDC Role, the trust relationship between GitHub and AWS is defined in IAM in the organization account.
173
-
- name: assume OIDC Role
176
+
#First assume GithubOIDCRole role, the trust relationship between GitHub and AWS is defined in IAM GithubOIDCRole in the organization account. This role has permissions to assume Deployer roles only.
177
+
- name: assume GithubOIDCRole
174
178
if: inputs.useOIDC == true
175
179
uses: aws-actions/configure-aws-credentials@v4
176
180
with:
@@ -182,6 +186,17 @@ jobs:
182
186
# which does not work for cross-account assume
183
187
role-skip-session-tagging: true
184
188
189
+
# Then assume Deployer role, which can be assumed by GithubOIDCRole and has all the permissions needed to deploy cloudformation stacks.
0 commit comments