-
-
Save chrisforrette/503f0c49ec4321e7350a9fa39efa1571 to your computer and use it in GitHub Desktop.
Revisions
-
ewdurbin revised this gist
Jan 16, 2018 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Configure the current shell with AWS configuration for a given `aws-cli` profile Sets the following Environment Variables * `AWS_PROFILE=<profile_name>` used by `aws-cli` * `AWS_DEFAULT_REGION=<profiles_configured_region>` * `AWS_ACCESS_KEY_ID=<profiles_access_key_id>` * `AWS_SECRET_ACCESS_KEY=<profiles_secret_access_key>` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ aws-profile () { export AWS_PROFILE=${1} export AWS_DEFAULT_REGION=$(aws configure get region) export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id) export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key) } -
ewdurbin revised this gist
Sep 12, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # `aws-cli` bash helper functions The official AWS command line tools, have support for configuration profiles. See [Configuring the AWS Command Line Interface - Named Profiles](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles). Managing multiple profiles with the AWS CLI itself is *relatively* straight forward, switching between them with `--profile` flag on the command line or the `AWS_PROFILE` environment variable. -
ewdurbin revised this gist
Sep 12, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # `aws-cli` bash helper functions The official AWS command line tools, have support for configuration profiles. See [Configuring the AWS Command Line Interface](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles). Managing multiple profiles with the AWS CLI itself is *relatively* straight forward, switching between them with `--profile` flag on the command line or the `AWS_PROFILE` environment variable. -
ewdurbin revised this gist
Aug 18, 2015 . 1 changed file with 27 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # `aws-cli` bash helper functions The official AWS command line tools, have support for configuration profiles. Managing multiple profiles with the AWS CLI itself is *relatively* straight forward, switching between them with `--profile` flag on the command line or the `AWS_PROFILE` environment variable. These helpers extend that functionality for convenience with other tools in the ecosystem. ## `aws-profile` Configure the current shell with AWS configuration for a given `aws-cli` profile. `aws-profile <profile_name>` Sets the following Environment Variables * `AWS_PROFILE=<profile_name>` used by `aws-cli` * `AWS_ACCESS_KEY_ID=<profiles_access_key_id>` * `AWS_SECRET_ACCESS_KEY=<profiles_secret_access_key>` ## `with-aws-profile` Run a single command in a subshell configured for a specific `aws-cli` profile. `with-aws-profile <profile_name> my --arbitrary command` Any command line tool which can understand the environment varibles set by `aws-profile` should just work. -
ewdurbin created this gist
Aug 18, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ aws-profile () { export AWS_PROFILE=${1} export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id) export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key) } with-aws-profile () { ( aws-profile ${1} shift ${@} ) }