-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy AWS CDK stacks using CodePipeline #7108
Comments
I am currently working through this scenario too. I was thinking of doing the following in Code Pipeline -
In step 2, I want to see if I can do It would be nice as you mentioned if Code Pipeline has native actions to do CDK deploys. |
When thinking about this further, I guess the problem is also that |
I know they are working on the assets publishing capability which is part of the puzzle - https://github.com/aws/aws-cdk-rfcs/blob/master/text/0092-asset-publishing.md I haven't quite figured out if it can be used yet. |
@kennu So I ran into a different issue trying to do I think I am going to take the Code Pipeline approach laid out here and create a Lambda stack and Build Artifact job per lambda. Hope this helps! |
Hey @kennu and @vineethsoma , thanks for opening and commenting on the issue. You've pretty much figured out everything I wanted to say by yourselves, but let me say it anyway 🙂. The problem you encountered @kennu is indeed because you're using assets in your code, and assets (currently!) are modeled in the CDK using CloudFormation parameters. Like @vineethsoma said, we're working hard on making applications using assets deployable through CodePipeline, but until we release that functionality, you have to forego using assets in all stacks that you want to deploy through CodePipeline. Looking at your asset parameters, I'm guessing you're using assets for the https://github.com/skinny85/cdk-codepipeline-and-local-lambda-guidance Which shows you how to use assets for local development of Lambdas, but then using a different Hope this makes it clear! Thanks, |
Okay thanks, I will wait for the support to come out. I think until then I can just run I realized, though, that my current use case involves quite a few Lambda functions (total 150 functions in 13 CloudFormation stacks). It would be a lot of work to configure 150 separate CodePipeline S3 artifacts and deployments. Also adding a new Lambda function would require modifying the Pipeline every time. So I'm not sure if that would be the best approach in this case. Configuring 13 different CloudFormation template artifacts and deployments, on the other hand, seems reasonable. They would stay pretty static. |
Let me ask you this: are all 150 of those Lambdas completely separate? Like, does each of them have their own |
In this particular project there's about 50 separate code asset folders so that 3 Lambda functions share one asset folder. It's a bit special because we are running some tests with many different Lambda runtime configurations (AWS CDK is very convenient for configuring them). In my typical projects there tends to be only one code asset folder shared by all the Lambda functions in a CloudFormation stack. |
Ok. In that case, you only need 50 CodePipeline Artifacts / CodeBuild Projects ;p Still not great, but better than 150... |
For those, you only need a single artifact / CodeBuild Project. |
Closing this issue for now. Feel free to reopen if you have more questions. |
This is now possible with the introduction of CDK pipelines: |
I would like to build my AWS CDK stack in CodeBuild using
cdk synth
into an artifact, and then deploy the artifact with CodePipeline using its built-in CloudFormation deployment feature.When I try to do that, I get an error about missing parameters. I can't figure out how to pass the right parameters to CodePipeline. It seems that AWS CDK only generates the required parameters when using
cdk deploy
.The parameters are like:
I have a project where a single Git repository builds 13 CloudFormation stacks. It would be nice to use CodePipeline to deploy them, instead of trying to handle all the
cdk deploy
processes in CodeBuild. It seems like the right way to do deploy CloudFormation stacks anyway.Maybe there already is some way to pass these parameters from CDK to CodePipeline?
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: