You must specify a region. You can also configure your region by running "aws configure". Exited with code 255

Hi There,

I’m trying to get a continuous deployment happening with docker compose and CircleCi. I have the following circle.yml and my AWS environment variables in under “Environment Variables”. I still keep getting the error: You must specify a region. You can also configure your region by running “aws configure”.
Exited with code 255

Not sure what else I need to configure here. Any assistance is really appreciated…

version: 2
jobs:
build:
working_directory: /app
docker:
- image: docker:17.05.0-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Install dependencies
command: |
apk add --no-cache
py-pip=9.0.0-r1
pip install
docker-compose==1.12.0
awscli==1.11.76
- restore_cache:
keys:
- v1-{{ .Branch }}
paths:
- /caches/app.tar
- run:
name: Load Docker image layer cache
command: |
set +o pipefail
docker load -i /caches/app.tar | true
- run:
name: Build application Docker image
command: |
docker build --cache-from=app -t app .
- run:
name: Save Docker image layer cache
command: |
mkdir -p /caches
docker save -o /caches/app.tar app
- save_cache:
key: v1-{{ .Branch }}-{{ epoch }}
paths:
- /caches/app.tar
- run:
name: Run tests
command: |
docker-compose -f ./docker-compose.test.yml up
- deploy:
name: Push application Docker image
command: |
if [ “{CIRCLE_BRANCH}" == "master" ]; then login="(aws ecr get-login)”
{login} docker tag app "{ECR_ENDPOINT}/app:{CIRCLE_SHA1}" docker push "{ECR_ENDPOINT}/app:${CIRCLE_SHA1}"
fi

@theonlysean - can you try AWS_DEFAULT_REGION instead in your environment variables instead?

1 Like

@paul-pop I had the same issue and changing the key name to AWS_DEFAULT_REGION fixed it for me. Thanks!

(I appreciate this is an old post for you @theonlysean, but if you still visit the forum, would you edit your post to apply code formatting? It’s hard to read YAML if the spaces are removed).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.