Skip to content

Commit d1edd20

Browse files
committed
Updated README.md for information about using alternate audiences
1 parent 2f8dfd0 commit d1edd20

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ The default session duration is 1 hour when using the OIDC provider to directly
8282
The default session duration is 6 hours when using an IAM User to assume an IAM Role (by providing an `aws-access-key-id`, `aws-secret-access-key`, and a `role-to-assume`) .
8383
If you would like to adjust this you can pass a duration to `role-duration-seconds`, but the duration cannot exceed the maximum that was defined when the IAM Role was created.
8484
The default session name is GitHubActions, and you can modify it by specifying the desired name in `role-session-name`.
85+
The default audience is `sts.amazonaws.com` which you can replace by specifying the desired audience name in `audience`.
8586

8687
The following table describes which identity is used based on which values are supplied to the Action:
8788

@@ -98,7 +99,6 @@ The following table describes which identity is used based on which values are s
9899
- name: Configure AWS Credentials
99100
uses: aws-actions/configure-aws-credentials@v1
100101
with:
101-
audience: sts.amazonaws.com
102102
aws-region: us-east-2
103103
role-to-assume: arn:aws:iam::123456789100:role/my-github-actions-role
104104
role-session-name: MySessionName
@@ -109,7 +109,6 @@ In this example, the Action will load the OIDC token from the GitHub-provided en
109109
- name: Configure AWS Credentials
110110
uses: aws-actions/configure-aws-credentials@v1
111111
with:
112-
audience: sts.amazonaws.com
113112
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
114113
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
115114
aws-region: us-east-2
@@ -120,6 +119,19 @@ In this example, the Action will load the OIDC token from the GitHub-provided en
120119
```
121120
In this example, the secret `AWS_ROLE_TO_ASSUME` contains a string like `arn:aws:iam::123456789100:role/my-github-actions-role`. To assume a role in the same account as the static credentials, you can simply specify the role name, like `role-to-assume: my-github-actions-role`.
122121

122+
```yaml
123+
- name: Configure AWS Credentials for Beta Customers
124+
uses: aws-actions/configure-aws-credentials@v1
125+
with:
126+
audience: beta-customers
127+
aws-region: us-east-3
128+
role-to-assume: arn:aws:iam::123456789100:role/my-github-actions-role
129+
role-session-name: MySessionName
130+
```
131+
In this example, the audience has been changed from the default to use a different audience name `beta-customers`. This can help ensure that the role can only affect those AWS accounts whose GitHub OIDC providers have explicitly opted in to the `beta-customers` label.
132+
133+
Changing the default audience may be necessary when using non-default [AWS partitions](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
134+
123135
### Sample IAM Role CloudFormation Template
124136
```yaml
125137
Parameters:

0 commit comments

Comments
 (0)