Class: AWSCDK::SecretsManager::CfnRotationSchedule::RotationRulesProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::SecretsManager::CfnRotationSchedule::RotationRulesProperty
- Defined in:
- secrets_manager/cfn_rotation_schedule.rb
Overview
The rotation schedule and window.
We recommend you use ScheduleExpression to set a cron or rate expression for the schedule and Duration to set the length of the rotation window.
When changing an existing rotation schedule and setting
RotateImmediatelyOnUpdatetofalse:
- If using
AutomaticallyAfterDaysor aScheduleExpressionwithrate(), the previously scheduled rotation might still occur.- To prevent unintended rotations, use a
ScheduleExpressionwithcron()for granular control over rotation windows.
Instance Attribute Summary collapse
-
#automatically_after_days ⇒ Numeric?
readonly
The number of days between automatic scheduled rotations of the secret.
-
#duration ⇒ String?
readonly
The length of the rotation window in hours, for example
3hfor a three hour window. -
#schedule_expression ⇒ String?
readonly
A
cron()orrate()expression that defines the schedule for rotating your secret.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(automatically_after_days: nil, duration: nil, schedule_expression: nil) ⇒ RotationRulesProperty
constructor
A new instance of RotationRulesProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(automatically_after_days: nil, duration: nil, schedule_expression: nil) ⇒ RotationRulesProperty
Returns a new instance of RotationRulesProperty.
843 844 845 846 847 848 849 850 |
# File 'secrets_manager/cfn_rotation_schedule.rb', line 843 def initialize(automatically_after_days: nil, duration: nil, schedule_expression: nil) @automatically_after_days = automatically_after_days Jsii::Type.check_type(@automatically_after_days, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "automaticallyAfterDays") unless @automatically_after_days.nil? @duration = duration Jsii::Type.check_type(@duration, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "duration") unless @duration.nil? @schedule_expression = schedule_expression Jsii::Type.check_type(@schedule_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scheduleExpression") unless @schedule_expression.nil? end |
Instance Attribute Details
#automatically_after_days ⇒ Numeric? (readonly)
The number of days between automatic scheduled rotations of the secret.
You can use this value to check that your secret meets your compliance guidelines for how often secrets must be rotated.
In DescribeSecret and ListSecrets , this value is calculated from the rotation schedule after every successful rotation. In RotateSecret , you can set the rotation schedule in RotationRules with AutomaticallyAfterDays or ScheduleExpression , but not both.
860 861 862 |
# File 'secrets_manager/cfn_rotation_schedule.rb', line 860 def automatically_after_days @automatically_after_days end |
#duration ⇒ String? (readonly)
The length of the rotation window in hours, for example 3h for a three hour window.
Secrets Manager rotates your secret at any time during this window. The window must not extend into the next rotation window or the next UTC day. The window starts according to the ScheduleExpression . If you don't specify a Duration , for a ScheduleExpression in hours, the window automatically closes after one hour. For a ScheduleExpression in days, the window automatically closes at the end of the UTC day. For more information, including examples, see Schedule expressions in Secrets Manager rotation in the Secrets Manager Users Guide .
867 868 869 |
# File 'secrets_manager/cfn_rotation_schedule.rb', line 867 def duration @duration end |
#schedule_expression ⇒ String? (readonly)
A cron() or rate() expression that defines the schedule for rotating your secret.
Secrets Manager rotation schedules use UTC time zone. Secrets Manager rotates your secret any time during a rotation window.
Secrets Manager rate() expressions represent the interval in hours or days that you want to rotate your secret, for example rate(12 hours) or rate(10 days) . You can rotate a secret as often as every four hours. If you use a rate() expression, the rotation window starts at midnight. For a rate in hours, the default rotation window closes after one hour. For a rate in days, the default rotation window closes at the end of the day. You can set the Duration to change the rotation window. The rotation window must not extend into the next UTC day or into the next rotation window.
You can use a cron() expression to create a rotation schedule that is more detailed than a rotation interval. For more information, including examples, see Schedule expressions in Secrets Manager rotation in the Secrets Manager Users Guide . For a cron expression that represents a schedule in hours, the default rotation window closes after one hour. For a cron expression that represents a schedule in days, the default rotation window closes at the end of the day. You can set the Duration to change the rotation window. The rotation window must not extend into the next UTC day or into the next rotation window.
878 879 880 |
# File 'secrets_manager/cfn_rotation_schedule.rb', line 878 def schedule_expression @schedule_expression end |
Class Method Details
.jsii_properties ⇒ Object
880 881 882 883 884 885 886 |
# File 'secrets_manager/cfn_rotation_schedule.rb', line 880 def self.jsii_properties { :automatically_after_days => "automaticallyAfterDays", :duration => "duration", :schedule_expression => "scheduleExpression", } end |
Instance Method Details
#to_jsii ⇒ Object
888 889 890 891 892 893 894 895 896 |
# File 'secrets_manager/cfn_rotation_schedule.rb', line 888 def to_jsii result = {} result.merge!({ "automaticallyAfterDays" => @automatically_after_days, "duration" => @duration, "scheduleExpression" => @schedule_expression, }) result.compact end |