https://github.com/yleisradio/yle-aws-role
Tooling to help to assume AWS IAM roles
https://github.com/yleisradio/yle-aws-role
aws aws-iam
Last synced: about 1 month ago
JSON representation
Tooling to help to assume AWS IAM roles
- Host: GitHub
- URL: https://github.com/yleisradio/yle-aws-role
- Owner: Yleisradio
- License: mit
- Created: 2016-12-03T08:38:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-28T14:24:01.000Z (over 5 years ago)
- Last Synced: 2024-04-15T00:05:25.337Z (over 1 year ago)
- Topics: aws, aws-iam
- Language: Ruby
- Size: 33.2 KB
- Stars: 11
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# yle-aws-role
Tooling to help to assume [AWS IAM roles](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html).
Offers a command-line helper tool, `asu`, and a Ruby library. After assuming the specified role, it sets the standard environment variables and configures the Ruby SDK for the role.
## Installation
The project can be installed in a shell:
```sh
gem install yle-aws-role
```To use the Ruby library, add this line to your application's Gemfile:
```ruby
gem 'yle-aws-role'
```and then execute `bundle`
## Usage
```plain
Usage: asu [options] -- [command ...]
or: asu --listaccount The account ID or pattern of the role account
command Command to execute with the role. Defaults to launching new shell session.-d, --duration Duration for the role credentials. Default: 900
--env Print out environment variables and exit
-l, --list Print out all configured account aliases
-q, --quiet Be quiet
-r, --role Name of the role-h, --help Prints this help
-v, --version Prints the version information
```### Configuration
Account aliases and their IDs can be specified in a configuration file. Then you can list the known accounts with `asu --list`, and use aliases (even with partial matching) when specifying the account for `asu`. Also the default role can be set.
The configuration file location defaults to _$HOME/.aws/asu.yaml_, but can be specified with the `ASU_CONFIG` environment variable.
Example configuration:
```yaml
defaults:
role: "dev"accounts:
foo-bar: "123456789012"
baz: "987654321098"
```With this you can just call for example
```sh
asu foo -- aws s3 ls s3://mybucket/
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Yleisradio/yle-aws-role. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).