Skip to content

Files

Latest commit

557a700 · Oct 24, 2022

History

History
This branch is 2693 commits behind aws-powertools/powertools-lambda-python:develop.

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 18, 2022
Oct 21, 2022
Oct 24, 2022
Jul 7, 2022
Jul 7, 2022
Oct 14, 2022
Jul 7, 2022
Oct 14, 2022
Oct 14, 2022

README.md

CDK Powertools layer

This is a CDK project to build and deploy AWS Lambda Powertools Lambda layer to multiple commercial regions.

Build the layer

To build the layer construct you need to provide the Powertools version that is available in PyPi. You can pass it as a context variable when running synth or deploy,

cdk synth --context version=1.25.1

Canary stack

We use a canary stack to verify that the deployment is successful and we can use the layer by adding it to a newly created Lambda function. The canary is deployed after the layer construct. Because the layer ARN is created during the deploy we need to pass this information async via SSM parameter. To achieve that we use SSM parameter store to pass the layer ARN to the canary. The layer stack writes the layer ARN after the deployment as SSM parameter and the canary stacks reads this information and adds the layer to the function.

Version tracking

AWS Lambda versions Lambda layers by incrementing a number at the end of the ARN. This makes it challenging to know which Powertools version a layer contains. For better tracking of the ARNs and the corresponding version we need to keep track which powertools version was deployed to which layer. To achieve that we created two components. First, we created a version tracking app which receives events via EventBridge. Second, after a successful canary deployment we send the layer ARN, Powertools version, and the region to this EventBridge.