Install the AWS cli tool

Container

Run an ephemeral container with local .aws directory mounted

Pros: quick if already configured Cons: required to install the aws-cli locally first

podman run --rm -it -v /home/user/.aws:/root/.aws:Z docker.io/amazon/aws-cli:latest ec2 describe-instances

Run an ephemeral container with a volume mounted for config

I don’t want to install the aws-cli locally at all.

Pros: The only static thing is the config volume, no upgrades required, completely ephemeral in a container Cons: if you accidentally delete the volume you lose the config

Create a volume:

podman volume create awscli-config
podman run --rm -it -v awscli-config:/root/.aws:Z docker.io/amazon/aws-cli:latest configure
podman run --rm -it -v awscli-config:/root/.aws:Z docker.io/amazon/aws-cli:latest [ aws_cli_command ]
podman run --rm -it -v awscli-config:/root/.aws:Z docker.io/amazon/aws-cli:latest ec2 describe-instances

Pip package

pip install awscli --user