Provided region_name 'AWS_REGION' doesn't match a supported format

Hello! I am trying to push an image to AWS-ECR but in the log I have the following error:

  • Provided region_name ‘AWS_REGION’ doesn’t match a supported format

This is an snippet of how I configure the .yml file

- aws-ecr/build-and-push-image:
          aws-access-key-id: ACCESS_KEY_ID_ENV_VAR_NAME
          aws-secret-access-key: SECRET_ACCESS_KEY_ENV_VAR_NAME
          create-repo: false
          platform: linux/amd64
          public-registry: false
          push-image: true
          region: AWS_REGION
          registry-id: AWS_ECR_REGISTRY_ID
          repo: opground_backend_lambda
          repo-scan-on-push: true
          tag: 'latest'

I also tried with AWS_DEFAULT_REGION but it didn’t work either.

“AWS_REGION” is normally the variable name rather than a valid value, which would be something like “us-west-1”.

As for “AWS_DEFAULT_REGION” that is a little more complicated, while also a variable name it is not found in all SDKs, in general, it is a variable that would provide the value of the default region.

As for the ORB, the problem I think is the way that the example has been written “AWS_REGION” is a variable of some sort, rather than a value - and so you need to provide its value.

1 Like

Thank you rit1010 for replied. I could not discovered which was the reason why this variable gave me troubles. To fix this issue I decided to remove this variable, because is not required, and magically that fix my issue.