aws-cdk-lib(aws-secretsmanager): Update the SecretsManagerRDSMySQLRotationMultiUser rotation Lambda function so it can be deployed with the latest code #32181
Labels
aws-cdk-lib
Related to the aws-cdk-lib package
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Summary
Using AWS CDK, I want to deploy the secret manager SecretsManagerRDSMySQLRotationMultiUser rotation Lambda function with the following latest GitHub code content.
https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/blob/master/SecretsManagerRDSMySQLRotationMultiUser/lambda_function.py
However, I confirmed that currently, when deployed via AWS CDK, the rotation Lambda function is deployed with the following old code content.
https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/blob/13a7a467dfa7643438d9a6e61eb185695fe2229d/SecretsManagerRDSMySQLRotationMultiUser/lambda_function.py
About the cause
It seems that the issue is caused by the semantic version of the AWS SAM Managed application SecretsManagerRDSMySQLRotationMultiUser used in CDK is old.
CDK is hard coded to be 1.1.367, but the latest one appears to be newer than 1.1.500.
aws-cdk/packages/aws-cdk-lib/aws-secretsmanager/lib/secret-rotation.ts
Lines 44 to 46 in 01f2dcd
(I am not exactly sure about the latest version)
Use Case
In the latest code content of SecretsManagerRDSMySQLRotationMultiUser, we can set the username character limit with environment variables.
https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/blob/92f00b3e3b32df58a8a7c230773335f5846c74fd/SecretsManagerRDSMySQLRotationMultiUser/lambda_function.py#L120-L121
On the other hand, the old code does not allow arbitrary character limits for the username.
Proposed Solution
Update version 1.1.367 to newer than 1.1.500.
aws-cdk/packages/aws-cdk-lib/aws-secretsmanager/lib/secret-rotation.ts
Lines 44 to 46 in 01f2dcd
Other Information
No response
Acknowledgements
CDK version used
2.167.1 (build d681b12)
Environment details (OS name and version, etc.)
All
The text was updated successfully, but these errors were encountered: