Skip to content
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

Merged
merged 22 commits into from
Jun 10, 2020

Conversation

jogold
Copy link
Contributor

@jogold jogold commented May 10, 2020

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

Comment on lines +213 to +215
// 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);
Copy link
Contributor Author

@jogold jogold May 10, 2020

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?

Copy link
Contributor

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 0757125
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 189b203
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

],
],
},
functionName: 'RotationSecretRotationSecretRotationSecretRotationSecretRotation',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Elad Ben-Israel and others added 11 commits June 7, 2020 11:16
Co-authored-by: Rico Huijbers <rix0rrr@gmail.com>
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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 9e7b54a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 2b0ea5c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@skinny85 skinny85 left a 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!

@ahammond
Copy link
Contributor

ahammond commented Jun 8, 2020

@skinny85 I can't rebase his branch for him, but I did cherry-pick the only actual relevant change (everything else is merge noise) into #8442

Thank you for looking at this!

@mergify mergify bot dismissed skinny85’s stale review June 9, 2020 07:17

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 028281d
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jogold
Copy link
Contributor Author

jogold commented Jun 9, 2020

@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!

Done (added a Closes #8442 in the PR body).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 84460d2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 0a97ab0
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoveItLoveItLoveItLoveItLoveIt

Thanks @jogold !

@mergify
Copy link
Contributor

mergify bot commented Jun 10, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: c4b9d8d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jun 10, 2020

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).

@mergify mergify bot merged commit 24e474b into aws:master Jun 10, 2020
@jogold jogold deleted the rotation-fn-name-length branch June 18, 2020 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to add secret rotation to an RDS database
5 participants