mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-02 05:55:10 +09:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67fbcbb121 | |||
| 58bb841154 | |||
| 34779ed730 | |||
| bf7f81fcf7 | |||
| 79fafe359f | |||
| d1edd20a7e | |||
| 8a84b07f20 | |||
| 2e344a8a34 | |||
| 9f69d0f0bc | |||
| 1ca0e74a85 | |||
| 1684cc585e | |||
| 4ee5565853 | |||
| 4ff5ea70e6 | |||
| 6abb918e09 | |||
| 082f9f0637 | |||
| 2f8dfd0ed4 | |||
| f350a92ff6 | |||
| 88da7d4f1c | |||
| 18cfdaf552 | |||
| 84665e59c8 | |||
| 8788ec5aa1 | |||
| 22e077f99c | |||
| dfe025559e | |||
| 8050a91cfa | |||
| e9dce0860a | |||
| 1936d118bd | |||
| 5d27778945 | |||
| f06248b64a | |||
| ead0512447 | |||
| d63be9338f | |||
| 3ffb855336 | |||
| 25579cba53 | |||
| a64e523261 | |||
| ebad18e1cb | |||
| f324ccbd8b | |||
| f500e4423a | |||
| 717cbc82f1 | |||
| 8b86e3223d | |||
| 72ccd62416 | |||
| 852be5b0ee | |||
| 488370bebd | |||
| a8081b3d23 | |||
| fd1891d12d | |||
| 2d5d4077ee | |||
| f24ace22d4 | |||
| c3e3b80272 | |||
| b878f4b65b |
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.7.0](https://github.com/aws-actions/configure-aws-credentials/compare/v1.6.1...v1.7.0) (2022-08-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Allow audience to be explicitly specified ([2f8dfd0](https://github.com/aws-actions/configure-aws-credentials/commit/2f8dfd0ed43d880f85b57f0c8727b497af2037de))
|
||||||
|
|
||||||
### [1.6.1](https://github.com/aws-actions/configure-aws-credentials/compare/v1.6.0...v1.6.1) (2022-01-18)
|
### [1.6.1](https://github.com/aws-actions/configure-aws-credentials/compare/v1.6.0...v1.6.1) (2022-01-18)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ The default session duration is 1 hour when using the OIDC provider to directly
|
|||||||
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`) .
|
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`) .
|
||||||
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.
|
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.
|
||||||
The default session name is GitHubActions, and you can modify it by specifying the desired name in `role-session-name`.
|
The default session name is GitHubActions, and you can modify it by specifying the desired name in `role-session-name`.
|
||||||
|
The default audience is `sts.amazonaws.com` which you can replace by specifying the desired audience name in `audience`.
|
||||||
|
|
||||||
The following table describes which identity is used based on which values are supplied to the Action:
|
The following table describes which identity is used based on which values are supplied to the Action:
|
||||||
|
|
||||||
@@ -118,6 +119,19 @@ In this example, the Action will load the OIDC token from the GitHub-provided en
|
|||||||
```
|
```
|
||||||
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`.
|
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`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Configure AWS Credentials for Beta Customers
|
||||||
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
with:
|
||||||
|
audience: beta-customers
|
||||||
|
aws-region: us-east-3
|
||||||
|
role-to-assume: arn:aws:iam::123456789100:role/my-github-actions-role
|
||||||
|
role-session-name: MySessionName
|
||||||
|
```
|
||||||
|
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.
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
### Sample IAM Role CloudFormation Template
|
### Sample IAM Role CloudFormation Template
|
||||||
```yaml
|
```yaml
|
||||||
Parameters:
|
Parameters:
|
||||||
@@ -160,7 +174,7 @@ Resources:
|
|||||||
ClientIdList:
|
ClientIdList:
|
||||||
- sts.amazonaws.com
|
- sts.amazonaws.com
|
||||||
ThumbprintList:
|
ThumbprintList:
|
||||||
- a031c46782e6e6c662c2c87c76da9aa62ccabd8e
|
- 6938fd4d98bab03faadb97b34396831e3780aea1
|
||||||
|
|
||||||
Outputs:
|
Outputs:
|
||||||
Role:
|
Role:
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ branding:
|
|||||||
icon: 'cloud'
|
icon: 'cloud'
|
||||||
color: 'orange'
|
color: 'orange'
|
||||||
inputs:
|
inputs:
|
||||||
|
audience:
|
||||||
|
default: 'sts.amazonaws.com'
|
||||||
|
description: 'The audience to use for the OIDC provider'
|
||||||
|
required: false
|
||||||
aws-access-key-id:
|
aws-access-key-id:
|
||||||
description: >-
|
description: >-
|
||||||
AWS Access Key ID. This input is required if running in the GitHub hosted environment.
|
AWS Access Key ID. This input is required if running in the GitHub hosted environment.
|
||||||
|
|||||||
Vendored
+618
-167
File diff suppressed because one or more lines are too long
@@ -263,6 +263,7 @@ async function run() {
|
|||||||
try {
|
try {
|
||||||
// Get inputs
|
// Get inputs
|
||||||
const accessKeyId = core.getInput('aws-access-key-id', { required: false });
|
const accessKeyId = core.getInput('aws-access-key-id', { required: false });
|
||||||
|
const audience = core.getInput('audience', { required: false });
|
||||||
const secretAccessKey = core.getInput('aws-secret-access-key', { required: false });
|
const secretAccessKey = core.getInput('aws-secret-access-key', { required: false });
|
||||||
const region = core.getInput('aws-region', { required: true });
|
const region = core.getInput('aws-region', { required: true });
|
||||||
const sessionToken = core.getInput('aws-session-token', { required: false });
|
const sessionToken = core.getInput('aws-session-token', { required: false });
|
||||||
@@ -310,7 +311,7 @@ async function run() {
|
|||||||
let sourceAccountId;
|
let sourceAccountId;
|
||||||
let webIdentityToken;
|
let webIdentityToken;
|
||||||
if(useGitHubOIDCProvider()) {
|
if(useGitHubOIDCProvider()) {
|
||||||
webIdentityToken = await core.getIDToken('sts.amazonaws.com');
|
webIdentityToken = await core.getIDToken(audience);
|
||||||
roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || DEFAULT_ROLE_DURATION_FOR_OIDC_ROLES;
|
roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || DEFAULT_ROLE_DURATION_FOR_OIDC_ROLES;
|
||||||
// We don't validate the credentials here because we don't have them yet when using OIDC.
|
// We don't validate the credentials here because we don't have them yet when using OIDC.
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Generated
+535
-478
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aws-actions-configure-aws-credentials",
|
"name": "aws-actions-configure-aws-credentials",
|
||||||
"version": "1.6.1",
|
"version": "1.7.0",
|
||||||
"description": "Configure AWS Credentials",
|
"description": "Configure AWS Credentials",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -26,12 +26,12 @@
|
|||||||
"homepage": "https://github.com/aws-actions/configure-aws-credentials#readme",
|
"homepage": "https://github.com/aws-actions/configure-aws-credentials#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.6.0",
|
||||||
"aws-sdk": "^2.1058.0",
|
"aws-sdk": "^2.1112.0",
|
||||||
"axios": "^0.24.0"
|
"axios": "^0.26.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@zeit/ncc": "^0.22.3",
|
||||||
"eslint": "^8.7.0",
|
"eslint": "^8.13.0",
|
||||||
"jest": "^27.4.7"
|
"jest": "^27.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user