The deployment environment 'Prd' in your bitbucket-pipelines.yml file occurs multiple times....

Arun Kumar D February 18, 2025

Hey Atlassian  Team,

 

Need some help here. I am trying to terraform Deploy to Production Env. My definition in the pipeline.yaml file looks like this below

 

terraform-plan-prd: &terraform-plan-prd
  step:
    name: Terraform_Plan_Prd
    deployment: Prd
    image: hashicorp/terraform:1.1.5
    script:
      - cd mwaa/infrastructure
      - ./plan.sh prd

terraform-apply-prd: &terraform-apply-prd step: name: Terraform_Apply_prd image: hashicorp/terraform:1.1.5 deployment: Prd trigger: manual script: - cd mwaa/infrastructure - ./apply.sh prd


branches: mwaa-prd-*: - <<: *terraform-plan-prd - <<: *terraform-apply-prd

Now both the steps are using deployment env Prd. I think I read in some Community Chats that Atlassian have deployed multi step deployments somewhere. Please help how to fix this ?

 

Thanks - Arun Kumar D

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2025

Hi Arun Kumar,

A stage can be used so that multiple steps can share the same deployment environment:

Please keep in mind though that stages can't contain manually triggered steps, this is one of the stages' limitations at the moment:

If you remove the manual trigger from the second step, you could use a yml like the following:

definitions:
terraform-plan-prd: &terraform-plan-prd
step:
name: Terraform_Plan_Prd
image: hashicorp/terraform:1.1.5
script:
- cd mwaa/infrastructure
- ./plan.sh prd
terraform-apply-prd: &terraform-apply-prd
step:
name: Terraform_Apply_prd
image: hashicorp/terraform:1.1.5
script:
- cd mwaa/infrastructure
- ./apply.sh prd

pipelines:
branches:
mwaa-prd-*:
- stage:
deployment: Prd
steps:
- <<: *terraform-plan-prd
- <<: *terraform-apply-prd

If you'd like to keep the manual trigger on the second step, then the only workaround would be creating a second deployment environment for production with the same variables as the environment named Prd and using that for the second step.

We have a feature request for supporting manual steps in a stage:

You can add your vote to that feature request (by selecting the link Vote for this issue) to increase the chances of this being implemented. You are more than welcome to leave feedback, and you can also add yourself as a watcher (by selecting the link Start watching this issue) if you'd like to be notified via email on updates.

Implementation of features is done as per our policy here and any updates will be posted in the feature request.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events