Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lewis262626/aws-sts
AWS STS Role CLI tool
https://github.com/lewis262626/aws-sts
aws cli ruby sts
Last synced: about 1 month ago
JSON representation
AWS STS Role CLI tool
- Host: GitHub
- URL: https://github.com/lewis262626/aws-sts
- Owner: lewis262626
- License: mit
- Created: 2020-04-27T18:56:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-29T22:10:36.000Z (over 4 years ago)
- Last Synced: 2024-03-15T07:49:33.279Z (10 months ago)
- Topics: aws, cli, ruby, sts
- Language: Ruby
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![Ruby](https://github.com/lewisrobbins/aws-sts/workflows/Ruby/badge.svg?branch=master)
[![Gem Version](https://badge.fury.io/rb/aws-sts.svg)](https://badge.fury.io/rb/aws-sts)aws-sts
==========[![asciicast](https://asciinema.org/a/324944.svg)](https://asciinema.org/a/324944)
**The problem:** You want to be able to have short term credentials to your AWS account for security
**The solution:** AWS STS and `aws-sts.rb`
Features
---------This supports `~/.aws/config` making this tool easier to set-up.
How it Works
-------------Roles are assumed, or session tokens are simply acquired (if `--no-role` is
specified) via the [`AssumeRole`][assume-role] or the
[`GetSessionToken`][get-session-token] AWS STS API calls. After this, your
command or shell is launched with the standard AWS credential chain environment
variables set:* `AWS_ACCESS_KEY_ID`
* `AWS_SECRET_ACCESS_KEY`
* `AWS_SESSION_TOKEN`Usage
------Install the tool:
1. `gem install aws-sts`
2. `aws-sts `Configuration
---Setup a profile for each role you'd like to use in your `~/.aws/config`.
```ini
[profile account]
region = eu-west-2[profile dev]
region = eu-north-1
role_arn = arn:aws:iam::1999:role/admin
source_profile = account
```And then in your `~/.aws/credentials`
```ini
[account]
aws_access_key_id=XXXXXX
aws_secret_access_key=XXX
```Usage
---
```bash
$ ./aws-sts
export AWS_ACCESS_KEY_ID=SXXXX
export AWS_SECRET_ACCESS_KEY=XXXX
export AWS_SESSION_TOKEN=XXXX
export ASSUMED_ROLE=dev
# run eval $(ruby aws-sts.rb )
```By default the credentials last for 3600 seconds or 1 hour.