feat: Have an ability to configure session name (#29)

* 1. Add 'role-session-name' variable to action.yml
2. Configure roleSessionName with role-session-name from action or default value (GitHubActions)

* Add description on README.md

* update README.md

* update dist/index.js

* add test code

* update context based on comments
This commit is contained in:
Chuan-Yen Chiang
2020-03-01 20:47:10 +01:00
committed by GitHub
parent 058322d68a
commit 4d0082acf8
5 changed files with 42 additions and 11 deletions
+3 -1
View File
@@ -53,7 +53,8 @@ We recommend following [Amazon IAM best practices](https://docs.aws.amazon.com/I
## Assuming a role
If you would like to use the credentials you provide to this action to assume a role, you can do so by specifying the role ARN in `role-to-assume`.
The role credentials will then be output instead of the ones you have provided.
The default session duration is 6 hours, but if you would like to adjust this you can pass a duration to `role-duration-seconds`.
The default session duration is 6 hours, but if you would like to adjust this you can pass a duration to `role-duration-seconds`.
The default session name is GitHubActions, and you can modify it by specifying the desired name in `role-session-name`.
Example:
```yaml
@@ -65,6 +66,7 @@ Example:
aws-region: us-east-2
role-to-assume: arn:aws:iam::123456789100:role/role-to-assume
role-duration-seconds: 1200
role-session-name: MySessionName
```
### Session tagging