GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — powertools-lambda-python/layer at develop · developerlabsai/powertools-lambda-python

Expand file tree

/

layer

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

layer

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
layer
layer
 
 
sar
sar
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
app.py
app.py
 
 
cdk.json
cdk.json
 
 
poetry.lock
poetry.lock
 
 
pyproject.toml
pyproject.toml
 
 

README.md

Outline

CDK Powertools for AWS Lambda (Python) layer

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

Build the layer

To build the layer construct you need to provide the Powertools for AWS Lambda (Python) 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 for AWS Lambda (Python) version a layer contains. For better tracking of the ARNs and the corresponding version we need to keep track which Powertools for AWS Lambda (Python) 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 for AWS Lambda (Python) version, and the region to this EventBridge.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.