Hi Team,
By default, it is taking the region of one environment as an example. we have environments such as Dev, Qa, Stage. However, when deploying, it is automaticallytaking the stage region for the Dev deployment. please find the below pipeline.
- step:
name: Build and Push Docker Image to the DEV ECR
image: atlassian/pipelines-awscli
- pipe: atlassian/aws-ecr-push-image:2.2.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEV
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEV
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION_DEV
- step:
name: Build and Push Docker Image to the STAGE ECR
image: atlassian/pipelines-awscli
- pipe: atlassian/aws-ecr-push-image:2.2.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_STAGE
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_STAGE
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION_STAGE
- step:
name: Build and Push Docker Image to the QA ECR
image: atlassian/pipelines-awscli
- pipe: atlassian/aws-ecr-push-image:2.2.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_QA
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_QA
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION_QA
Hi and welcome to the community!
Are you talking about the value of the pipe variable AWS_DEFAULT_REGION? It is not clear what you mean by "taking the stage region for the Dev deployment".
I assume that one of the variables $AWS_DEFAULT_REGION_DEV, $AWS_DEFAULT_REGION_STAGE, or $AWS_DEFAULT_REGION_QA does not show the expected value in the pipe output?
If that is the case, please check whether you have Workspace, Repository, and Deployment variables with the same name. If you use the same names, then the order of overrides is Deployment > Repository > Workspace. This means that a Deployment variable will override a Repository variable with the same name, and a Repository variable will override a Workspace variable with the same name.
If you are facing a different problem, please share some additional details about the issue so I can better help you.
It would also be helpful to know:
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.