-
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
[cdk-pipelines] Add an example of Lambda with blue/green or canary deployments #9276
Comments
We don't think Lambda B/G deployments are safe in the general case. The B/G part of the deployment only works if you change the Lambda source code, not if you change anything about related objects. The easiest to get wrong is the IAM policy. If you change code and remove a permission (which is a simple thing to do in CDK) the policy changes will be deployed in a point-in-time fashion, breaking your old Lambda version that would still be requiring it. This is a sharp edge that we are afraid a lot of people will get bitten by. As such, you can do this today, but I'm not sure we're ready to recommend it for general use yet. |
By the way we do have an example of Lambda B/G deployments here: https://docs.aws.amazon.com/cdk/latest/guide/codepipeline_example.html |
I was building this for a demo recently actually - code is in one of my repos (purely for demo purposes) - https://github.com/brianfarnhill/Examples.LambdaDeploymentPipeline - have a look at it, it might be useful |
I am not able to access that repo. Is it public? |
@AdamTylerLynch sorry that was my bad, realised I had a couple of account IDs in there and wanted to take them out. I've been rebuilding that demo in a bit of a different way recently (adds CodeArtifact in for custom CDK constructs too, but that does complicate things a little). It's a work in progress but the guts of that old repo is there again now, in this new URL. https://github.com/BrianFarnhill/Demos.CDKApiPipeline |
@BrianFarnhill From what I understand, you are using:
I thought the whole point of cdk pipelines was that we didn't have to use aws_codepipeline, aws_codebuild, aws_codedeploy, etc. individually. Is your reason for this choice that cdk pipelines is too limited to be useful alone at the moment? I for example noticed that cdk-pipelines don't seem to use CodeDeploy, so I'm still unsure how to rollback a stack (which is deployed via cloudformation changesets) after a unit-test fails. |
@samlaf I'm in a bit of a transition in that repo - I dragged everything forward to v2 of the CDK but haven't done the pipeline yet. I do however absolutely plan to use the newer pipeline construct for this though as that will be a lot cleaner from a code perspective. My use of the the native code* resources is to add things to that core pipeline though, not provision the core resources themselves. For example, I use So to answer the question specifically - the reason for my choice is that I just haven't gotten around to updating the pipeline yet, but absolutely intend to. |
Thank you @BrianFarnhill ! |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Please provide documentation for implementing blue/green or canary deployments using CDK Pipelines.
This is a 📕 documentation issue
The text was updated successfully, but these errors were encountered: