Skip to content

Instantly share code, notes, and snippets.

@mgaebler
Last active March 27, 2021 17:33
Show Gist options
  • Save mgaebler/f6b999d00a08cea8e92a6bc9f23225d6 to your computer and use it in GitHub Desktop.
Save mgaebler/f6b999d00a08cea8e92a6bc9f23225d6 to your computer and use it in GitHub Desktop.
AWS

aws-cli

Setup

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-docker.html

Learnings

I usually would use brew to install awscli but I've switched to the docker variant.

Benefits:

  • no need to install dependencies
  • isolates aws configuration to a volume or directory

Script that I use in project:

#!/usr/bin/env sh
# file: aws
docker run --rm -it \
  -v some_aws_config:/root/.aws \   # this creates the docker volume some_aws_config
  -v $(pwd):/aws amazon/aws-cli \
  "$@"                              # propagate all parameters here

So I can use ./aws --version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment