-
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
fix(secretsmanager): rotation function name can exceed 64 chars #7896
Conversation
Get the last 64 chars of the `uniqueId`. See aws#7885 (comment). Closes aws#7885
// Max length of 64 chars, get the last 64 chars | ||
const uniqueId = this.node.uniqueId; | ||
const rotationFunctionName = uniqueId.substring(Math.max(uniqueId.length - 64, 0), uniqueId.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if something in @aws-cdk/core
wouldn't be useful for such cases:
this.node.uniqueIdOf(50); // Custom length
this.node.uniqueId64; // Last 64 chars
There are several places in the code where an id derived from unique id is truncated.
Or is this in constructs
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more general solution would be nice... and this is blocking me today. :(
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
], | ||
], | ||
}, | ||
functionName: 'RotationSecretRotationSecretRotationSecretRotationSecretRotation', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functionName: 'RotationSecretRotationSecretRotationSecretRotationSecretRotation', | |
functionName: 'VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongName', |
I know the symmetry is pleasing, but it also makes it unnecessarily difficult to figure out how the name is generated.
The PR aws#8403 changed the "IAM stack" to use the default environment and forgot to update the expected output (which now does not contain a token for the URL suffix). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jogold apologies for only now getting to review this. Would you mind rebasing/merging the PR with master? Looks like it accumulated some conflicts with mainline in the meantime. Thanks!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoveItLoveItLoveItLoveItLoveIt
Thanks @jogold !
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Get the last 64 chars of the
uniqueId
.See #7885 (comment).
Closes #7885
Closes #8442
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license