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: docs/ce/howto/project-level-roles.mdx
+26-9Lines changed: 26 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -20,22 +20,15 @@ projects:
20
20
aws_role_to_assume:
21
21
state: "arn:/blabla/accid/backenddev"
22
22
command: "arn:/blabla/accid/devaccount"
23
+
aws_role_region: us-east-1
23
24
- name: prod
24
25
dir: ./prod
25
26
aws_role_to_assume:
26
27
state: "arn:/blabla/accid/backendprod"
27
28
command: "arn:/blabla/accid/prodaccount"
29
+
aws_role_region: us-east-1
28
30
```
29
31
30
-
Using a workflow file as usual. Here is an [example repository](https://github.com/diggerhq/demo-assume-role-multi-account-aws_diggeryml) using digger.yml to assume different roles for different projects.
31
-
32
-
<Note>
33
-
NOTE: for locking to be configured user needs to also pass aws-role-to-assume in the workflow file as a
34
-
parameter within the workflow file. This role needs to have ability to assume all the other roles and also have access to a common account where the locks are to live.
35
-
36
-
If you are not using a aws-role-to-assume setting it workflow you **must** add ```AwsRoleRegion``` property to project level ```aws_role_to_assume```
37
-
</Note>
38
-
39
32
You can also use project-level assume role with [generated projects](/ce/howto/generate-projects):
40
33
41
34
```
@@ -48,3 +41,27 @@ generate_projects:
48
41
command: "arn:/blabla/accid/devaccount"
49
42
```
50
43
44
+
# Assume role with cognito identity
45
+
46
+
The github action JWT token includes alot of useful fields such as `ref`, `sha`, `runner_environment` etc. however it is
47
+
challenging to write an AWS trust policy to match for these fields since only `aud` and `sub` fields are supported. Using cognito
48
+
identity it is possible to remap the fields into principal tags which allows them to be matched in the trust policy. More information
49
+
about this is in this article: https://catnekaise.github.io/github-actions-abac-aws/cognito-identity/.
50
+
51
+
If you wish to perform this mapping in digger you can specify an additional aws_cognito_oidc configuration as follows:
0 commit comments