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

https://github.com/m-radzikowski/omf-plugin-asp

Oh My Fish plugin for switching between AWS profiles.
https://github.com/m-radzikowski/omf-plugin-asp

aws-cli aws-profiles fish fish-packages fish-shell omf omf-plugin shell

Last synced: 5 months ago
JSON representation

Oh My Fish plugin for switching between AWS profiles.

Awesome Lists containing this project

README

          

#### asp

> A plugin for [Oh My Fish][omf-link].

[![MIT License][license-badge]](/LICENSE)
[![Fish Shell Version][fish-badge]](https://fishshell.com)
[![Oh My Fish Framework][omf-badge]][omf-link]


Enables quick switching between AWS profiles.

## Prerequisites

- [AWS CLI](https://aws.amazon.com/cli/)
- [jq](https://stedolan.github.io/jq/)
- AWK

## Install

```fish
omf install git@github.com:mgoodness/plugin-asp.git
```

## Usage

### Set profile

```fish
asp [region]
```

`asp` - **A**WS **S**et **P**rofile

Sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` variables.
The optional region value can be used if you wish to override the default region
configured for the profile.

### Get selected profile

```fish
agp
```

`agp` - **A**WS **G**et **P**rofile

Echoes `$AWS_PROFILE` and `$AWS_DEFAULT_REGION`.

### Clear selected profile

```fish
acp
```

`acp` - **A**WS **C**lear **P**rofile

Clears variables for selected profile and assumed role.

### Assume role

```fish
aar
```

`aar` - **A**WS **A**ssume **R**ole

Performs [STS Assume Role](https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html) call
and sets obtained `$AWS_ACCESS_KEY_ID`, `$AWS_SECRET_ACCESS_KEY`
and `$AWS_SESSION_TOKEN` variables.

To clear assumed role variables execute either `acp`
or `asp` command.

# License

[MIT][mit] © [Michael Goodness][author] et [al][contributors]

[mit]: https://opensource.org/licenses/MIT
[author]: https://github.com/mgoodness
[contributors]: https://github.com/mgoodness/plugin-asp/graphs/contributors
[omf-link]: https://www.github.com/oh-my-fish/oh-my-fish

[license-badge]: https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square
[fish-badge]: https://img.shields.io/badge/fish-v2.2.0-007EC7.svg?style=flat-square
[omf-badge]: https://img.shields.io/badge/Oh%20My%20Fish-Framework-007EC7.svg?style=flat-square