An open API service indexing awesome lists of open source software.

https://github.com/adrianosela/war

A utility to run commands with assumed-role credentials in the environment.
https://github.com/adrianosela/war

aws aws-assume-role aws-iam iam iam-policy rbac role role-based-access-control sts

Last synced: 7 months ago
JSON representation

A utility to run commands with assumed-role credentials in the environment.

Awesome Lists containing this project

README

          

# war

A utility to run commands with assumed-role credentials in the environment.

### Usage: `war [args...]`

#### Examples

- `war arn:aws:iam::123456789012:role/MY-DEMO-ROLE aws ec2 describe-instances`
- `war arn:aws:iam::123456789012:role/MY-DEMO-ROLE aws iam list-roles`
- `war arn:aws:iam::123456789012:role/MY-DEMO-ROLE ${ANY_AWS_CLI_CMD}`
- `war arn:aws:iam::123456789012:role/MY-DEMO-ROLE ${ANY_NON_AWS_CLI_CMD_THAT_USES_AWS_CREDENTIALS}`

> Note: to test whether you are assuming the role, you can run aws sts get-caller-identity (which requires no IAM permissions to run)

```
$ war arn:aws:iam::123456789012:role/MY-DEMO-ROLE aws sts get-caller-identity
{
"UserId": "AROHA7R44MA5HUOWH3YNXZ:WAR-1689374829999217000",
"Account": "123456789012",
"Arn": "arn:aws:sts::123456789012:assumed-role/MY-DEMO-ROLE/WAR-1689374829999217000"
}
```