Hello everyone!
I feel like I’m just missing something completely here with my configuration file. I’m currently attempting to setup my AWS profile through the circle.yml file.
Here’s what I have so far:
jobs:
build:
<<: *container_config
steps:
- checkout
- run:
name: Setup AWS profile
command: |
aws configure set aws_access_key_id ${CIRCLE_BRANCH^^}_AWS_ACCESS_KEY --profile $CIRCLE_BRANCH
aws configure set aws_secret_access_key ${CIRCLE_BRANCH^^}_AWS_ACCESS_KEY --profile $CIRCLE_BRANCH
aws configure set region us-east-1 --profile $CIRCLE_BRANCH
echo 'export AWS_PROFILE="$CIRCLE_BRANCH"' >> $BASH_ENV
source $BASH_ENV
I have an environment variable set in CircleCI as DEV_AWS_ACCESS_KEY, and the CIRCLE_BRANCH parameter is dev. I’m just unsure on how to reference an environment variable in another environment variable name:
aws configure set aws_access_key_id ${CIRCLE_BRANCH^^}_AWS_ACCESS_KEY
Obviously, the command above isn’t going to work since I’m not referencing the full value of “DEV_AWS_ACCESS_KEY” as an environment variable. Any pointers would be great!