war

command module
v0.0.0-...-f46d4ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 9 Imported by: 0

README

war

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

Usage: war <role-arn-to-assume> <command> [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"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL