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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why can't I use an environment more then once in my pipeline

So I am trying to separate my AWS CDK build and deploy in 2 steps, so that I can rerun one of the steps if necessary:

- step:
<<: *build
deployment: development
name: Build for development
- step:
<<: *deploy
deployment: development
name: Deploy to development

So the Build step required the deployment variable because it used in AWS CDK code.

And the deploy also needs it to get the right AWS_ACCESS_KEYs .

Bitbucket doesnt allow me to use this variable deployment twice.

How do I resolve this issue?

My current solution is the have build & deploy in one step.

1 answer

1 accepted

0 votes
Answer accepted

Hi Mattijs and welcome to the community.

Apart from having both build and deploy in the one step, you could also:

  • Configure the deployment variables as repository or workspace variables instead. This way, they'll be available to all steps.
  • You could also create two deployment environments and define the same variables in both of them.

We have a feature request for what you are asking in our issue tracker:

I would suggest adding your vote there (by selecting the Vote for this issue link), as the number of votes helps the development team and product managers better understand the demand for new features. You can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates. When there is an update, it will be posted in this public ticket.

Please note though that we don't provide ETAs and implementation of new features is done as per our policy here:

Please feel free to let me know if you have any other questions.

Kind regards,



the `deployment` variable can't be a repo variable because it has different meanings for each deployment: DEV | STAGING | PROD.

The build step needs to know what env it is building for, and the deployment to AWS also needs to know to get the correct secret key.


Yes, 2 deployment variables with a slight different name could work until there is a better fix.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,725 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you