-
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
(lambda): Make it easy to use "AWS Parameters and Secrets Lambda Extension" with Lambda Functions #23187
Comments
Thanks for this feature request @blimmer, this would be an excellent feature for us to support! I am marking this issue as p2, which means that we are unable to work on this immediately. We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization. Check out our contributing guide if you're interested in contributing yourself - I'd love to see what you come up with 🙂 |
I want this feature so I will work on this. |
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
#25725 has to be reverted. |
…n for Lambda (#25928) This PR provides support for the AWS Parameters and Secrets Extension for Lambda functions. This extension will allow users to retrieve and cache AWS Secrets Manager secrets and AWS Parameter Store parameters in Lambda functions without using an SDK. Note: Previous PR results in the go build breaking. This removed the circular dependency causing the go build to break: ``` [jsii-pacmak] [INFO] Found 1 modules to package [jsii-pacmak] [INFO] Packaging NPM bundles [jsii-pacmak] [INFO] Loading jsii assemblies and translations [jsii-pacmak] [INFO] Packaging 'go' for aws-cdk-lib [jsii-pacmak] [INFO] go finished [jsii-pacmak] [INFO] Packaged. go (54.9s) | npm pack (5.4s) | load jsii (0.5s) | cleanup (0.0s) ``` Closes #23187 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Currently this feature works like a charm, however, it does not support Cross Account SSM parameter retrieval, could that be supported any time soon? |
Describe the feature
The AWS Parameters and Secrets Lambda Extension is a great way to securely fetch Secrets Manager Secrets from Lambda functions. Today, I have to reference the documentation and hard-code the Layer ARN from this table to add the layer to my function.
It would be nice if there were a convenience method that automatically determined the proper ARN for the Lambda's architecture and deployment region. It would also be great if the available configuration environment variables were able to be set via CDK.
Use Case
A common pattern for exposing Secrets Manager secrets to Lambda functions is by setting them as environment variables. However, this is insecure because the variable is set in plain text in the console. Additionally, updates to the secret outside of CloudFormation do not update the environment variable. Recent versions of CDK warn you about this, requiring an explicit call to
unsafeUnwrap
on the Secret.One way to work around this issue is to call the Secrets Manager API (e.g. via
aws-sdk
) in your Lambda function. However, this can get expensive because it results in a lot of retrievals of secret values. You then have to implement your own caching behavior if you want to reduce cost.The AWS Parameters and Secrets Lambda Extension solves both of these problems. The secret is fetched at runtime and it handles caching for you automatically.
Proposed Solution
Then, the logic for the function would look something like (pseudocode):
Other Information
No response
Acknowledgements
CDK version used
2.53.0
Environment details (OS name and version, etc.)
MacOS, TypeScript
The text was updated successfully, but these errors were encountered: