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

AWS Cloudformation Pipe Fails to Detect Existing Stack After Version Update

When I switch the cloudformation pipe to a new version it fails to detect that the stack already exists and attempts to create a new stack. The new stack creation fails because the stack already existed in AWS, and subsequently the pipe fails.


For example, I've created several stack using the pipeatlassian/aws-cloudformation-deploy:0.6.3. If I go back to one of those pipelines and change it to the latest version (0.9.2) it will not detect the existing stack in AWS, attempt to create a new stack, and fail.

1 answer

1 accepted

0 votes
Answer accepted

Hi @Clayo84 ,

Thank you for your question!

We'll investigate this case and notify you.


Best regards,
Oleksandr Kyrdan

Any update?

@Clayo84we are trying to reproduce your issue and find root cause now.

Could you share your bitbucket pipeline file, that part where you execute cloudformation pipes, both versions?

I just tried to reproduce and did not succeed, hope after your sharing will get the root cause.


Regards, Galyna

@Halyna Berezovska @Oleksandr Kyrdan  Certainly! The relevant code is going from this:

nameUpdate Cloudformation stack          
#WAIT: 'true'                                        
"ParameterKey": "EnvironmentParam",
"ParameterValue": "$BITBUCKET_BRANCH"
"ParameterKey": "NameStubParam",
"ParameterValue": "$BITBUCKET_REPO_SLUG"

To this:

 - step:
name: Update Cloudformation stack
- pipe: atlassian/aws-cloudformation-deploy:0.9.2
#WAIT: 'true'
TEMPLATE: serverless_app.yml
"ParameterKey": "EnvironmentParam",
"ParameterValue": "$BITBUCKET_BRANCH"
"ParameterKey": "NameStubParam",
"ParameterValue": "$BITBUCKET_REPO_SLUG"
"NotificationARNs": [name-removed-to-protect-the-innocent]

Please excuse the formatting, I promise it's properly lined up in the file.

Let me know if you need anything else from me! 

Like chad nash likes this

@Clayo84no matter, formatting is fine!

I see you're using


as STACK_NAME variable.

Are you sure that your branch was not changed there ?

Me, did not change the branch while testing and it worked.


Also, just in case I tried to test another case and switch to the new branch (in case if your branch or repo is different from previous one).

I did got the error:

✖ Failed to update the stack.ERROR: Failed to get information about stack mysteep-new-check-branch.
An error occurred (ValidationError) when calling the DescribeStacks operation: Stack with id mysteep-new-check-branch does not exist

An error occurred (ValidationError) when calling the UpdateStack operation: Invalid ARN name-removed-to-protect-the-innocent

It indeed logs that stack does not exist, buit this is just the output, the root cause was in incorrect role arn in EXTRA_PARAMETERS.

Clearing EXTRA_PARAMETERS, I have succeeded creating new stack (even previous one from another branch already existed).


I'd like to note that if you want the same stack to be updated , you should mention that stack, otherwise if branch or repo is different, the stack name will be also different.


So please, tell your purpose: do you want to create new stack on new branch, e.g., or update the previous one?

In the first case you can go more deep in extra params and look into aws docs for NotificationARNs notation (you can find it here . I guess arn should be like

"NotificationARNs": ["arn:aws:sns:us-east-1:111122223333:my-topic"] format


In the second case, ensure that you're on the same repo or branch, or just use the hardcoded stack name.

Regards, Galyna

Not exactly.


I had obfuscated the SNS ARN because it included my tenant id.


I have since found that updating to the 0.10.0 version of this pipe appears to be handling the existing stack as expected.


Thank you for the time you've spent investigating this issue for me.

Like Halyna Berezovska likes this

Suggest an answer

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

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,449 views 4 7
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