Skip to content

Instantly share code, notes, and snippets.

@matwerber1
Last active November 9, 2023 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matwerber1/6614f54bdf3214273a96c0501d6708c2 to your computer and use it in GitHub Desktop.
Save matwerber1/6614f54bdf3214273a96c0501d6708c2 to your computer and use it in GitHub Desktop.
AWS - Containers - Compose - mount ~/.aws/cred
version: "3.8"
services:
AwsCLI:
image: public.ecr.aws/aws-cli/aws-cli
container_name: aws-cli
platform: linux/x86_64
volumes:
- ~/.aws/:~/.aws/ # Mount local credentials into container to use AWS CLI/SDK
environment:
AWS_PROFILE: "PROFILE YOU WANT TO USE"
AWS_DEFAULT_REGION: "us-east-1" # used by AWS CLI
AWS_REGION: "us-east-1" # used by SDKs (typically)
AWS_DEFAULT_REGION:
AWS_CLI_AUTO_PROMPT: on-partial
AWS_DEFAULT_OUTPUT: json
AWS_PAGER: "" # Empty string=disabled
#AWS_CONFIG_FILE: ""
# AWS_DEFAULT_REGION: "" only for assuming role with web identity, not standard assume-role
# AWS_ROLE_SESSION_NAME: "" custom identifier added to end uf session ARN - can help with logging
ports:
- "8000:8000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment