Different AWS Keys per environment

Isaacpm: each command runs in a separate shell, thus the variables are forgotten.

You can create the profile in circle like so:

aws configure --profile staging set region eu-west-2
aws configure --profile staging set access_key whatever
aws configure --profile staging set scret_key whatever
aws configure --profile staging list  # Get confirmation it worked in your logs 

(See aws configure help for details.)

However, aws ecr get-login is going to require being run in the same shell as the docker commands.

Either put them into their own file or in a longer block in the circle.yml file.

1 Like