-
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
(secretsmanager): cannot make 'RotationRules' unset for RotationSchedule #18749
Comments
Hey @RobReus 👋🏻 Thanks for reporting this. It does look like we force the default to be 30 days. We should allow this to be undefined to match CloudFormation's implementation. Marked this as p1 which means it is prioritized as important to our devs. As always we appreciate any contributions if anyone is interested in tackling this as there are many issues that our devs are currently working through (see our contribution guidelines). Meanwhile if you need a quick workaround you should be able to override the generated template properties using escape hatches. |
I'd be happy to contribute a fix here, but we need to evaluate what the best non-breaking fix would be. If we stopped applying the default 30 days then automatic rotation would be turned off for any users relying on the default. Clearly this is breaking behavior and not acceptable. I've thought of a couple options to fix this without a breaking change:
I think the second option is clearer and more quickly recognizable to anyone trying to turn off automatic rotation. I'm also open to names other than Let me know what you think! |
@AdamVD thank you for your willingness to contribute to fix this issue. Personally I like the second option better as well. I feel like the way you have described it will be clear and fully backwards compatible. It would be the perfect solution for me. |
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*
|
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*
What is the problem?
Without tapping into the
CfnRotationSchedule
construct directly, it is not possible to leave theRotationRules
(automaticallyAfter
in theRotationSchedule
construct) property ofAWS::SecretsManager::RotationSchedule
empty. When using theCfnRotationSchedule
and not setting therotationRules
property, it is left unset as is expected.The CloudFormation docs (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-rotationschedule.html#cfn-secretsmanager-rotationschedule-rotationrules) has this property set as optional, and when left empty, allows you to configure a rotation lambda without any schedule.
My use-case for this is for secrets that do not need to be automatically rotated, but only on demand when needed.
Reproduction Steps
What did you expect to happen?
The resulting CloudFormation template to not have the property
RotationRules
set for theAWS::SecretsManager::RotationSchedule
resource.What actually happened?
The resulting CloudFormation template has the property
RotationRules
set to a default of 30 days for theAWS::SecretsManager::RotationSchedule
resource.CDK CLI Version
2.10.0
Framework Version
2.10.0
Node.js Version
16.13.2
OS
Ubuntu 20.04 LTS (WSL2)
Language
Typescript
Language Version
4.5.5
Other information
No response
The text was updated successfully, but these errors were encountered: