Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

proper logical order when deploying multiple resources using cloudformation

Hey community,


I am using bitbucket-pipelines.yml to deploy a cloudformation using the atlassian/aws-cloudformation-deploy:0.12.0 pipe and my lambda function to s3 using the atlassian/aws-s3-deploy:1.1.0 pipe.

I have all of my resources being created in the cloudformation template. The resources include an S3 bucket, and lambda function which is referencing the zip file code in the S3 bucket.

I keep running into issues because I cant ( or at least I dont think I can) put the S3 pipe before the cloudformation template because the bucket would not be created, and if I put the S3 pipe after the cloudformation pipe it will fail because the lambda function cloudformation step tries to reference the zipped code in the S3 bucket, which the S3 pipe is supposed to upload.

Any recommendations? I could potentially have separate cloudformation templates for each resource and create a new step in the bitbucket-pipelines.yml, but it seems a bit more challenging to manage all the files, but maybe not?

Any suggestions?

1 answer

1 accepted

0 votes
Answer accepted

@dataking  hi. Thanks for your question. Try this to split logic:

  - pipe: atlassin/cloudformation-deploy:0.12.0
    <create s3 bucket from template>
  - pipe: atlassian/aws-s3-deploy:1.1.0
    <deploy to s3>
- pipe: atlassin/cloudformation-deploy:0.12.0
  <create lambda>

Regards, Igor

Hey @Igor Stoyanov with this approach, wouldn't I require 2 separate cloud formation templates? In other words, step 1 would contain the CF for S3, where as step 3 would contain a separate CF template with lambda resources.

Is that correct?

@dataking hi. Yes, you need to create 2 separate cloudformation templates.

@Igor Stoyanov how do you recommend to manage that at scale? Imagine we are dealing with many resources in the same repository.

@dataking  hi. Please, describe your case with more details.

Do you have known count of lambdas? And how many lambdas if count is known?

Regards, Igor.

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,263 views 2 9
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