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): automatic rotation cannot be disabled #18906

Merged
merged 11 commits into from
May 17, 2022

Conversation

AdamVD
Copy link
Contributor

@AdamVD AdamVD commented Feb 10, 2022

fixes #18749

Adds a manualRotation prop to RotationSchedule in order to leave automaticallyAfterDays unset on the underlying Cfn resource.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Feb 10, 2022

@github-actions github-actions bot added the @aws-cdk/aws-secretsmanager Related to AWS Secrets Manager label Feb 10, 2022
@AdamVD
Copy link
Contributor Author

AdamVD commented Mar 3, 2022

@skinny85 just bumping this!

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.

@AdamVD thanks for the ping, this slipped under my radar!

Before I dive into the details, what do you think about, instead of adding a new property, adding a "magic" value for automaticallyAfter (0 comes to mind immediately), and that will mean "disable rotation"?

@AdamVD
Copy link
Contributor Author

AdamVD commented Mar 3, 2022

@skinny85 No problem, I figured that was all and that's why I bumped!

I actually proposed that as one of the two options in the issue #18749. Basically my argument for the solution you see implemented is that it is better from a UX perspective rather than using a "magic" value of zero. The issue creator agreed, but I'll follow your wisdom on what the better solution is out of the two. Just let me know!

@skinny85
Copy link
Contributor

skinny85 commented Mar 3, 2022

I actually feel like automaticallyAfter: Duration.days(0) makes it clear to me that rotation is disabled, and doesn't require a separate property (and all of the dance that you have to do to validate that they're not both provided at the same time).

I guess I don't know for a fact that Duration.days(0) is allowed 😛. Can you check?

@rix0rrr rix0rrr added bug This issue is a bug. p1 and removed bug This issue is a bug. p1 @aws-cdk/aws-secretsmanager Related to AWS Secrets Manager labels Mar 4, 2022
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

I'm inclined to agree that using automaticallyAfter: Duration.days(0) is the preferred route. I'm not a big fan of using mutually exclusive optional parameters.

@skinny85
Copy link
Contributor

skinny85 commented May 5, 2022

@AdamVD are you still working on this PR?

@skinny85 skinny85 removed their assignment May 5, 2022
@AdamVD
Copy link
Contributor Author

AdamVD commented May 6, 2022

@skinny85 Thanks for the bump. I'll try to switch the implementation by early next week.

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review May 14, 2022 19:32

Pull request has been modified.

@Jacco
Copy link
Contributor

Jacco commented May 14, 2022

From a UX perspective maybe a Duration.never() could be implemented so that the user does not have to google if it’s 0 or 9999 :-)

@AdamVD
Copy link
Contributor Author

AdamVD commented May 14, 2022

@Jacco Interesting idea! I also have the feeling that a duration of zero isn't a great UX, but we are limited on options. I think a never option could make sense with something like Schedule (from aws-events), but it doesn't seem to belong with Duration. I wonder if adding Duration.zero() would be better than picking one of the time units to provide with 0. Using a union type would give us some good options but they can't be used in the CDK codebase.

@skinny85 I'll leave it to you to decide!

@skinny85
Copy link
Contributor

I really like the ideas here!

Between Duration.never() and Duration.zero() - that's a tough call! I really like the "fluentness" of never(), but I agree it might be a tiny bit confusing.

@AdamVD I'll let you make the final call - propose something in the PR!

Also, to be 100% transparent, I'm no longer with AWS, so I can't merge this PR anymore - but I'd be happy to help in whatever way I can!

@Jacco
Copy link
Contributor

Jacco commented May 14, 2022

Duration.eternity ;-)

@AdamVD
Copy link
Contributor Author

AdamVD commented May 15, 2022

@skinny85 thanks for the input and clarifying your status. Best wishes on your transition!

@Jacco I actually love that... "Automatically rotate my keys after eternity". It's perfect! I wonder if I can get someone to approve this 🤔

@TheRealAmazonKendra TheRealAmazonKendra changed the title fix(secretsmanager): allow automatic rotation to be disabled fix(secretsmanager): automatic rotation cannot be disabled May 17, 2022
@github-actions github-actions bot added the effort/small Small work item – less than a day of effort label May 17, 2022
@mergify
Copy link
Contributor

mergify bot commented May 17, 2022

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: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 26793ea
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit c50d60c into aws:master May 17, 2022
@mergify
Copy link
Contributor

mergify bot commented May 17, 2022

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

wphilipw pushed a commit to wphilipw/aws-cdk that referenced this pull request May 23, 2022
fixes aws#18749

Adds a `manualRotation` prop to `RotationSchedule` in order to leave `automaticallyAfterDays` unset on the underlying Cfn resource.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(secretsmanager): cannot make 'RotationRules' unset for RotationSchedule
6 participants