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?
@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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@dataking hi. Yes, you need to create 2 separate cloudformation templates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Igor Stoyanov how do you recommend to manage that at scale? Imagine we are dealing with many resources in the same repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.