Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Issue with default region selection during deployment

azuredevops azuredevops
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 17, 2024

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

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 22, 2024

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:

  • the whole content of the yml file (you can sanitize any private/sensitive data prior to sharing) so that we can understand where each step belongs and how you are using deployment environments
  • where you have defined the variables (are they workspace, repository, or deployment variables)

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events