Class: AWSCDK::DLM::CfnLifecyclePolicy::CreateRuleProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::DLM::CfnLifecyclePolicy::CreateRuleProperty
- Defined in:
- dlm/cfn_lifecycle_policy.rb
Overview
[Custom snapshot and AMI policies only] Specifies when the policy should create snapshots or AMIs.
- You must specify either CronExpression , or Interval , IntervalUnit , and Times .
- If you need to specify an ArchiveRule for the schedule, then you must specify a creation frequency of at least 28 days.
Instance Attribute Summary collapse
-
#cron_expression ⇒ String?
readonly
The schedule, as a Cron expression.
-
#interval ⇒ Numeric?
readonly
The interval between snapshots.
-
#interval_unit ⇒ String?
readonly
The interval unit.
-
#location ⇒ String?
readonly
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.
-
#scripts ⇒ AWSCDK::IResolvable, ...
readonly
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances.
-
#times ⇒ Array<String>?
readonly
The time, in UTC, to start the operation.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cron_expression: nil, interval: nil, interval_unit: nil, location: nil, scripts: nil, times: nil) ⇒ CreateRuleProperty
constructor
A new instance of CreateRuleProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cron_expression: nil, interval: nil, interval_unit: nil, location: nil, scripts: nil, times: nil) ⇒ CreateRuleProperty
Returns a new instance of CreateRuleProperty.
789 790 791 792 793 794 795 796 797 798 799 800 801 802 |
# File 'dlm/cfn_lifecycle_policy.rb', line 789 def initialize(cron_expression: nil, interval: nil, interval_unit: nil, location: nil, scripts: nil, times: nil) @cron_expression = cron_expression Jsii::Type.check_type(@cron_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cronExpression") unless @cron_expression.nil? @interval = interval Jsii::Type.check_type(@interval, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "interval") unless @interval.nil? @interval_unit = interval_unit Jsii::Type.check_type(@interval_unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "intervalUnit") unless @interval_unit.nil? @location = location Jsii::Type.check_type(@location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "location") unless @location.nil? @scripts = scripts Jsii::Type.check_type(@scripts, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZGxtLkNmbkxpZmVjeWNsZVBvbGljeS5TY3JpcHRQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "scripts") unless @scripts.nil? @times = times Jsii::Type.check_type(@times, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "times") unless @times.nil? end |
Instance Attribute Details
#cron_expression ⇒ String? (readonly)
The schedule, as a Cron expression.
The schedule interval must be between 1 hour and 1 year. For more information, see the Cron and rate expressions in the Amazon EventBridge User Guide .
810 811 812 |
# File 'dlm/cfn_lifecycle_policy.rb', line 810 def cron_expression @cron_expression end |
#interval ⇒ Numeric? (readonly)
The interval between snapshots.
The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.
817 818 819 |
# File 'dlm/cfn_lifecycle_policy.rb', line 817 def interval @interval end |
#interval_unit ⇒ String? (readonly)
The interval unit.
822 823 824 |
# File 'dlm/cfn_lifecycle_policy.rb', line 822 def interval_unit @interval_unit end |
#location ⇒ String? (readonly)
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.
The allowed destinations depend on the location of the targeted resources.
- If the policy targets resources in a Region, then you must create snapshots in the same Region as the source resource.
- If the policy targets resources in a Local Zone, you can create snapshots in the same Local Zone or in its parent Region.
- If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost or in its parent Region.
Specify one of the following values:
- To create snapshots in the same Region as the source resource, specify
CLOUD. - To create snapshots in the same Local Zone as the source resource, specify
LOCAL_ZONE. - To create snapshots on the same Outpost as the source resource, specify
OUTPOST_LOCAL.
Default: CLOUD
841 842 843 |
# File 'dlm/cfn_lifecycle_policy.rb', line 841 def location @location end |
#scripts ⇒ AWSCDK::IResolvable, ... (readonly)
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances.
This is useful for creating application-consistent snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts .
850 851 852 |
# File 'dlm/cfn_lifecycle_policy.rb', line 850 def scripts @scripts end |
#times ⇒ Array<String>? (readonly)
The time, in UTC, to start the operation. The supported format is hh:mm.
The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon Data Lifecycle Manager selects a time within the next 24 hours.
857 858 859 |
# File 'dlm/cfn_lifecycle_policy.rb', line 857 def times @times end |
Class Method Details
.jsii_properties ⇒ Object
859 860 861 862 863 864 865 866 867 868 |
# File 'dlm/cfn_lifecycle_policy.rb', line 859 def self.jsii_properties { :cron_expression => "cronExpression", :interval => "interval", :interval_unit => "intervalUnit", :location => "location", :scripts => "scripts", :times => "times", } end |
Instance Method Details
#to_jsii ⇒ Object
870 871 872 873 874 875 876 877 878 879 880 881 |
# File 'dlm/cfn_lifecycle_policy.rb', line 870 def to_jsii result = {} result.merge!({ "cronExpression" => @cron_expression, "interval" => @interval, "intervalUnit" => @interval_unit, "location" => @location, "scripts" => @scripts, "times" => @times, }) result.compact end |