CDK Secret Manager Wrapper Layer

raw JSON →
2.1.304 verified Mon Apr 27 auth: no python

AWS CDK construct that creates a Lambda layer wrapping AWS Secrets Manager for easy secret rotation and retrieval. Currently version 2.1.304, requires Python ~=3.9. Release cadence is frequent, often multiple versions per month.

pip install cdk-secret-manager-wrapper-layer
error ModuleNotFoundError: No module named 'cdk_secret_manager_wrapper_layer'
cause Package not installed in the current environment.
fix
Run 'pip install cdk-secret-manager-wrapper-layer' in your environment.
error AttributeError: module 'cdk_secret_manager_wrapper_layer' has no attribute 'SecretManagerWrapperLayer'
cause Using an outdated import path or wrong class name.
fix
Use correct import: 'from cdk_secret_manager_wrapper_layer import SecretManagerWrapperLayer'
error jsii.errors.JSIIError: ... does not exist in ...
cause Mismatch between CDK version and layer version (CDK v1 vs v2).
fix
Ensure you are using aws-cdk-lib (CDK v2) with version 2.x of the construct.
breaking Version 2.x switched to AWS CDK v2. If upgrading from 1.x, you must migrate your CDK app to CDK v2.
fix Use aws-cdk-lib instead of @aws-cdk/ packages. Update your CDK app to v2.
deprecated The construct name 'SecretManagerWrapper' (without 'Layer') was used in early versions and is now deprecated. Use 'SecretManagerWrapperLayer' instead.
fix Replace deprecated construct with SecretManagerWrapperLayer.
gotcha The layer is intended for Python 3.9 Lambda runtimes. Using other runtimes may cause incompatibility.
fix Ensure your Lambda function uses Python 3.9 runtime.

Minimal CDK app to deploy the Lambda layer.

from aws_cdk import App, Stack
from cdk_secret_manager_wrapper_layer import SecretManagerWrapperLayer

app = App()
stack = Stack(app, 'TestStack', env={'region': 'us-east-1'})
SecretManagerWrapperLayer(stack, 'MyLayer')
app.synth()