Skip to content

A set of commands that help with setting environment variables for AWSCLI in Fish

License

Notifications You must be signed in to change notification settings

tanmng/omf-aws-asp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aws-asp

A plugin for Oh My Fish.

MIT License Fish Shell Version Oh My Fish Framework

Enables quick switching between AWS profiles. Supports both hard-coded keys (role will have to come later)

Prerequisites

The machine which you are using should support following standard commands

  • grep
  • fgrep

Install

$ omf install https://github.com/tanmng/omf-aws-asp.git

Available commands

  • asp - Set up AWS_DEFAULT_PROFILE environment variable to specify the profile you wish to use in subsequent commands
  • asc - Clear all AWS-related environment variables
  • ase - Set up AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION (in case your CLI utility doesn't support AWS profile)

Usage

asp

Parameter:

  • profile_name The name of the profile (set in ~/.aws/config) that we wish to set to AWS_DEFAULT_PROFILE

Set the value of AWS_DEFAULT_PROFILE so that subsequent command can use the appropriate profile.

Sample

$ asp test

Setting AWS_DEFAULT_PROFILE to test

ase

  • Sets AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables to the corresponding values from ~/.aws/credentials;
  • Sets AWS_DEFAULT_PROFILE environment variables to the corresponding values from ~/.aws/config.

Parameter:

  • profile_name The name of the profile (set in ~/.aws/config)

Sample

$ ase aws-hs-searchnp

Setting AWS_DEFAULT_REGION to WAIT A SECOND, WHY SHOULD I PRINT THIS OUT AGAIN?
Setting AWS_ACCESS_KEY_ID to WAIT A SECOND, WHY SHOULD I PRINT THIS OUT AGAIN?
Setting AWS_SECRET_ACCESS_KEY to WAIT A SECOND, WHY SHOULD I PRINT THIS OUT AGAIN?

asc

This command doesn't take any parameter

Remove all AWS-related environment variables (filtered by the RegExp AWS_[^=]+

Todo

  • Use the value of AWS_SHARED_CREDENTIALS_FILE and AWS_CONFIG_FILE if set
  • Support using assume_role for credentials

About

A set of commands that help with setting environment variables for AWSCLI in Fish

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages