Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 19, 2021

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

step:
script:
  - 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?

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 07, 2021

@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.

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 08, 2021

@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
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events