From 102efa4db37a4a00b39a298b49c9da5c2f9bbc44 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 28 Apr 2022 00:53:34 +0200 Subject: [PATCH] Added aws cli notes to the knowledge base --- knowledge base/aws.md | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 knowledge base/aws.md diff --git a/knowledge base/aws.md b/knowledge base/aws.md new file mode 100644 index 0000000..de54481 --- /dev/null +++ b/knowledge base/aws.md @@ -0,0 +1,45 @@ +# AWS CLI + +## TL;DR + +```shell +# Install the CLI. +brew install awscli + +# Configure a profile. +aws configure +aws configure --profile work + +# Use a specific profile for the rest of this shell session. +export AWS_PROFILE="work" +``` + +## Profiles + +```shell +# Initialize the default profile. +# Not specifying a profile means to configure the default profile. +$ aws configure +AWS Access Key ID [None]: AKIAI44QH8DHBEXAMPLE +AWS Secret Access Key [None]: je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY +Default region name [None]: us-east-1 +Default output format [None]: text + +# Initialize a specific profile. +$ aws configure --profile work +AWS Access Key ID [None]: AKIAI44QH8DBEXAMPLE2 +AWS Secret Access Key [None]: je7MtGbClwBF/2Zp9Utk/h3yCo8nbEXAMPLEKEY2 +Default region name [None]: us-west-1 +Default output format [None]: json + +# Use a specific profile for the rest of this session. +$ export AWS_PROFILE="work" +``` + +## Further readings + +- CLI [quickstart] +- [Configure profiles] in the CLI + +[quickstart]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html +[configure profiles]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html