Class: AWSCDK::Backup::BackupPlanRuleProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Backup::BackupPlanRuleProps
- Defined in:
- backup/backup_plan_rule_props.rb
Overview
Properties for a BackupPlanRule.
Instance Attribute Summary collapse
-
#backup_vault ⇒ AWSCDK::Interfaces::AWSBackup::IBackupVaultRef?
readonly
The backup vault where backups are.
-
#completion_window ⇒ AWSCDK::Duration?
readonly
The duration after a backup job is successfully started before it must be completed or it is canceled by AWS Backup.
-
#copy_actions ⇒ Array<AWSCDK::Backup::BackupPlanCopyActionProps>?
readonly
Copy operations to perform on recovery points created by this rule.
-
#delete_after ⇒ AWSCDK::Duration?
readonly
Specifies the duration after creation that a recovery point is deleted.
-
#enable_continuous_backup ⇒ Boolean?
readonly
Enables continuous backup and point-in-time restores (PITR).
-
#move_to_cold_storage_after ⇒ AWSCDK::Duration?
readonly
Specifies the duration after creation that a recovery point is moved to cold storage.
-
#recovery_point_tags ⇒ Hash{String => String}?
readonly
To help organize your resources, you can assign your own metadata to the resources that you create.
-
#rule_name ⇒ String?
readonly
A display name for the backup rule.
-
#schedule_expression ⇒ AWSCDK::Events::Schedule?
readonly
A CRON expression specifying when AWS Backup initiates a backup job.
-
#schedule_expression_timezone ⇒ AWSCDK::TimeZone?
readonly
The timezone in which the schedule expression is set.
-
#start_window ⇒ AWSCDK::Duration?
readonly
The duration after a backup is scheduled before a job is canceled if it doesn't start successfully.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(backup_vault: nil, completion_window: nil, copy_actions: nil, delete_after: nil, enable_continuous_backup: nil, move_to_cold_storage_after: nil, recovery_point_tags: nil, rule_name: nil, schedule_expression: nil, schedule_expression_timezone: nil, start_window: nil) ⇒ BackupPlanRuleProps
constructor
A new instance of BackupPlanRuleProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(backup_vault: nil, completion_window: nil, copy_actions: nil, delete_after: nil, enable_continuous_backup: nil, move_to_cold_storage_after: nil, recovery_point_tags: nil, rule_name: nil, schedule_expression: nil, schedule_expression_timezone: nil, start_window: nil) ⇒ BackupPlanRuleProps
Returns a new instance of BackupPlanRuleProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'backup/backup_plan_rule_props.rb', line 18 def initialize(backup_vault: nil, completion_window: nil, copy_actions: nil, delete_after: nil, enable_continuous_backup: nil, move_to_cold_storage_after: nil, recovery_point_tags: nil, rule_name: nil, schedule_expression: nil, schedule_expression_timezone: nil, start_window: nil) @backup_vault = backup_vault Jsii::Type.check_type(@backup_vault, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19iYWNrdXAuSUJhY2t1cFZhdWx0UmVmIn0=")), "backupVault") unless @backup_vault.nil? @completion_window = completion_window Jsii::Type.check_type(@completion_window, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "completionWindow") unless @completion_window.nil? @copy_actions = copy_actions.is_a?(Array) ? copy_actions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Backup::BackupPlanCopyActionProps.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : copy_actions Jsii::Type.check_type(@copy_actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYWNrdXAuQmFja3VwUGxhbkNvcHlBY3Rpb25Qcm9wcyJ9LCJraW5kIjoiYXJyYXkifX0=")), "copyActions") unless @copy_actions.nil? @delete_after = delete_after Jsii::Type.check_type(@delete_after, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "deleteAfter") unless @delete_after.nil? @enable_continuous_backup = enable_continuous_backup Jsii::Type.check_type(@enable_continuous_backup, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableContinuousBackup") unless @enable_continuous_backup.nil? @move_to_cold_storage_after = move_to_cold_storage_after Jsii::Type.check_type(@move_to_cold_storage_after, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "moveToColdStorageAfter") unless @move_to_cold_storage_after.nil? @recovery_point_tags = Jsii::Type.check_type(@recovery_point_tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "recoveryPointTags") unless @recovery_point_tags.nil? @rule_name = rule_name Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName") unless @rule_name.nil? @schedule_expression = schedule_expression Jsii::Type.check_type(@schedule_expression, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlNjaGVkdWxlIn0=")), "scheduleExpression") unless @schedule_expression.nil? @schedule_expression_timezone = schedule_expression_timezone Jsii::Type.check_type(@schedule_expression_timezone, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5UaW1lWm9uZSJ9")), "scheduleExpressionTimezone") unless @schedule_expression_timezone.nil? @start_window = start_window Jsii::Type.check_type(@start_window, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "startWindow") unless @start_window.nil? end |
Instance Attribute Details
#backup_vault ⇒ AWSCDK::Interfaces::AWSBackup::IBackupVaultRef? (readonly)
Default: - use the vault defined at the plan level. If not defined a new common vault for the plan will be created
The backup vault where backups are.
47 48 49 |
# File 'backup/backup_plan_rule_props.rb', line 47 def backup_vault @backup_vault end |
#completion_window ⇒ AWSCDK::Duration? (readonly)
Default: - 7 days
The duration after a backup job is successfully started before it must be completed or it is canceled by AWS Backup.
52 53 54 |
# File 'backup/backup_plan_rule_props.rb', line 52 def completion_window @completion_window end |
#copy_actions ⇒ Array<AWSCDK::Backup::BackupPlanCopyActionProps>? (readonly)
Default: - no copy actions
Copy operations to perform on recovery points created by this rule.
57 58 59 |
# File 'backup/backup_plan_rule_props.rb', line 57 def copy_actions @copy_actions end |
#delete_after ⇒ AWSCDK::Duration? (readonly)
Default: - recovery point is never deleted
Specifies the duration after creation that a recovery point is deleted.
Must be greater than move_to_cold_storage_after.
64 65 66 |
# File 'backup/backup_plan_rule_props.rb', line 64 def delete_after @delete_after end |
#enable_continuous_backup ⇒ Boolean? (readonly)
Default: false
Enables continuous backup and point-in-time restores (PITR).
Property delete_after defines the retention period for the backup. It is mandatory if PITR is enabled.
If no value is specified, the retention period is set to 35 days which is the maximum retention period supported by PITR.
Property move_to_cold_storage_after must not be specified because PITR does not support this option.
74 75 76 |
# File 'backup/backup_plan_rule_props.rb', line 74 def enable_continuous_backup @enable_continuous_backup end |
#move_to_cold_storage_after ⇒ AWSCDK::Duration? (readonly)
Default: - recovery point is never moved to cold storage
Specifies the duration after creation that a recovery point is moved to cold storage.
79 80 81 |
# File 'backup/backup_plan_rule_props.rb', line 79 def move_to_cold_storage_after @move_to_cold_storage_after end |
#recovery_point_tags ⇒ Hash{String => String}? (readonly)
Default: - no recovery point tags.
To help organize your resources, you can assign your own metadata to the resources that you create.
Each tag is a key-value pair.
86 87 88 |
# File 'backup/backup_plan_rule_props.rb', line 86 def @recovery_point_tags end |
#rule_name ⇒ String? (readonly)
Default: - a CDK generated name
A display name for the backup rule.
91 92 93 |
# File 'backup/backup_plan_rule_props.rb', line 91 def rule_name @rule_name end |
#schedule_expression ⇒ AWSCDK::Events::Schedule? (readonly)
Default: - no schedule
A CRON expression specifying when AWS Backup initiates a backup job.
96 97 98 |
# File 'backup/backup_plan_rule_props.rb', line 96 def schedule_expression @schedule_expression end |
#schedule_expression_timezone ⇒ AWSCDK::TimeZone? (readonly)
Default: - UTC
The timezone in which the schedule expression is set.
101 102 103 |
# File 'backup/backup_plan_rule_props.rb', line 101 def schedule_expression_timezone @schedule_expression_timezone end |
#start_window ⇒ AWSCDK::Duration? (readonly)
Default: - 8 hours
The duration after a backup is scheduled before a job is canceled if it doesn't start successfully.
106 107 108 |
# File 'backup/backup_plan_rule_props.rb', line 106 def start_window @start_window end |
Class Method Details
.jsii_properties ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'backup/backup_plan_rule_props.rb', line 108 def self.jsii_properties { :backup_vault => "backupVault", :completion_window => "completionWindow", :copy_actions => "copyActions", :delete_after => "deleteAfter", :enable_continuous_backup => "enableContinuousBackup", :move_to_cold_storage_after => "moveToColdStorageAfter", :recovery_point_tags => "recoveryPointTags", :rule_name => "ruleName", :schedule_expression => "scheduleExpression", :schedule_expression_timezone => "scheduleExpressionTimezone", :start_window => "startWindow", } end |
Instance Method Details
#to_jsii ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'backup/backup_plan_rule_props.rb', line 124 def to_jsii result = {} result.merge!({ "backupVault" => @backup_vault, "completionWindow" => @completion_window, "copyActions" => @copy_actions, "deleteAfter" => @delete_after, "enableContinuousBackup" => @enable_continuous_backup, "moveToColdStorageAfter" => @move_to_cold_storage_after, "recoveryPointTags" => @recovery_point_tags, "ruleName" => @rule_name, "scheduleExpression" => @schedule_expression, "scheduleExpressionTimezone" => @schedule_expression_timezone, "startWindow" => @start_window, }) result.compact end |