Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanFrench committed Mar 28, 2018
1 parent eedfbff commit a77eec2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# aws-role

Small CLI utility to assume a role in AWS

Using this utility, a command can be run using an assumed role, as opposed to your default profile. The role assumption is not persisted to your shell, so subsequent requests must also use this utility.


## Installation

### From source

Currently, the only way to install the utility is from source. It requires you to have [go](https://golang.org) installed on your system.

`go get github.com/ryanfrench/aws-role`

## Usage

### Assume a role

`aws-role --role-arn [role] [command]`

This will assume `[role]` and then run `[command]` using that role.

### Help

`aws-role --help`
7 changes: 4 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ var (
)

var rootCmd = &cobra.Command{
Use: "aws-role [command]",
Use: "aws-role --role-arn [role] [command]",
Short: "Assume a role in AWS and optionally run a command",
Long: `
Assume a role within AWS. This will set your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN environment variables, allowing you to run a command using the new role. If no command is provided, they will be exported into your current session.
Run a command within the context of assuming a role. This is not persistent, and will only affect the command that is passed in.
e.g.
Use "aws-role [command] --help" for more information about a command.`,
aws-role --role-arn=arn:aws:iam::1234567890:role/my-role aws s3 ls`,
Run: run,
Version: "0.1.0",
Args: cobra.MinimumNArgs(1),
Expand Down

0 comments on commit a77eec2

Please sign in to comment.