From d53fcc42a439dbc757c0619790295f7c87aaa8d3 Mon Sep 17 00:00:00 2001 From: Virgil Date: Tue, 2 Jul 2019 13:39:02 +1000 Subject: [PATCH] docs(README) Markdown linting --- README.md | 29 ++++++++++++++++------------- aws-export-profile | 4 ++-- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fb142ef..4e7d6e7 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,21 @@ # aws-export-profile -`aws-export-profile` is a bash script that will output AWS export statements of your chosen aws boto profile. In case you have to manage multiple AWS accounts that rely on different boto profiles, you can *activate* a chosen profile by making it available in your shell environment. +`aws-export-profile` is a bash script that will output AWS export statements of your chosen aws boto profile. In case you have to manage multiple AWS accounts that rely on different boto profiles, you can **_activate_** a chosen profile by making it available in your shell environment. -This tool reads credentials from `~/.aws/credentials`. If you are looking for a way to export boto profiles via `aws sts assume-role` instead, have a lookt at **[aws-export-assume-profile](https://github.com/cytopia/aws-export-assume-profile)**. +This tool reads credentials from `~/.aws/credentials`. If you are looking for a way to export boto profiles via `aws sts assume-role` instead, have a look at **[aws-export-assume-profile](https://github.com/cytopia/aws-export-assume-profile)**. [![Build Status](https://travis-ci.org/cytopia/aws-export-profile.svg?branch=master)](https://travis-ci.org/cytopia/aws-export-profile) ![Release](https://img.shields.io/github/release/cytopia/aws-export-profile.svg) -**Note:** Wrap the command in **`$(aws-export-profile)`** to actually export your boto environment variables. - +> [!NOTE] +> Wrap the command in **`$(aws-export-profile)`** to actually export your boto environment variables. + ## But why? + Most AWS related tools support boto profiles out of the box, such as the `aws-cli` (Example: `aws ec2 --profile $(aws-export-profile staging) @@ -25,7 +28,6 @@ user> docker run --rm -it \ my-aws-docker ``` - ## Available exports The following export variables are currently supported. @@ -41,8 +43,7 @@ The following export variables are currently supported. | `AWS_SECURITY_TOKEN` | Secret token | | `AWS_REGION` | Region| - -## Examples +### Examples This tool simply output the exports to stdout. In order to auto-source them, wrap the command in **`$(...)`**. @@ -71,6 +72,7 @@ export AWS_REGION="eu-central-1" ``` #### Boto profile `production` with more exports + ```bash user> aws-export-profile production @@ -84,11 +86,12 @@ export AWS_REGION="eu-central-1" ``` #### Export boto profile `production` + ```bash user> $(aws-export-profile production) # Validate -user> env | grep AWS_ +user> printenv | grep AWS_ AWS_ACCESS_KEY_ID="XXXXXXXXXXXXXXXXXXXX" AWS_ACCESS_KEY="XXXXXXXXXXXXXXXXXXXX" @@ -100,18 +103,18 @@ AWS_REGION="eu-central-1" ``` #### Unset all AWS_ variables + ```bash user> $(aws-export-profile -u) ``` - ## Usage ```bash Usage: aws-export-profile [profile] [credentials] [config] aws-export-profile --unset, -u - aws-export-profile --help|-h - aws-export-profile --version|-v + aws-export-profile --help, -h + aws-export-profile --version, -v This bash helper will output AWS export statements of your chosen aws boto profile. Wrap this script in $(aws-export-profile) to export those environment variables. @@ -126,7 +129,7 @@ Optional parameter: Arguments: --unset, -u Unset currently set AWS variables from env - --help, -h Show this help screen + --help, -h Show this help screen --version, -v Show version Available exports: @@ -148,7 +151,7 @@ Examples to export: $(aws-export-profile production /jenkins/aws/credentials /jenkins/aws/config) Examples to unset all AWS variables - \$(aws-export-profile -u) + $(aws-export-profile -u) ``` ## License diff --git a/aws-export-profile b/aws-export-profile index 474f2b3..e59458b 100755 --- a/aws-export-profile +++ b/aws-export-profile @@ -36,7 +36,7 @@ EOF cat << EOF Usage: aws-export-profile [profile] [credentials] [config] aws-export-profile --unset, -u - aws-export-profile --help, -h + aws-export-profile --help, -h aws-export-profile --version, -v This bash helper will output AWS export statements of your chosen aws boto profile. @@ -52,7 +52,7 @@ Optional parameter: Arguments: --unset, -u Unset currently set AWS variables from env - --help, -h Show this help screen + --help, -h Show this help screen --version, -v Show version