Class: AWSCDK::DLM::CfnLifecyclePolicyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
dlm/cfn_lifecycle_policy_props.rb

Overview

Properties for defining a CfnLifecyclePolicy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(copy_tags: nil, create_interval: nil, cross_region_copy_targets: nil, default_policy: nil, description: nil, exclusions: nil, execution_role_arn: nil, extend_deletion: nil, policy_details: nil, retain_interval: nil, state: nil, tags: nil) ⇒ CfnLifecyclePolicyProps

Returns a new instance of CfnLifecyclePolicyProps.

Parameters:

  • copy_tags (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    [Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.

  • create_interval (Numeric, nil) (defaults to: nil)

    [Default policies only] Specifies how often the policy should run and create snapshots or AMIs.

  • cross_region_copy_targets (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::DLM::CfnLifecyclePolicy::CrossRegionCopyTargetProperty>, nil) (defaults to: nil)

    [Default policies only] Specifies destination Regions for snapshot or AMI copies.

  • default_policy (String, nil) (defaults to: nil)

    [Default policies only] Specify the type of default policy to create.

  • description (String, nil) (defaults to: nil)

    A description of the lifecycle policy.

  • exclusions (AWSCDK::IResolvable, AWSCDK::DLM::CfnLifecyclePolicy::ExclusionsProperty, nil) (defaults to: nil)

    [Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs.

  • execution_role_arn (String, nil) (defaults to: nil)

    The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.

  • extend_deletion (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    [Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.

  • policy_details (AWSCDK::IResolvable, AWSCDK::DLM::CfnLifecyclePolicy::PolicyDetailsProperty, nil) (defaults to: nil)

    The configuration details of the lifecycle policy.

  • retain_interval (Numeric, nil) (defaults to: nil)

    [Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them.

  • state (String, nil) (defaults to: nil)

    The activation state of the lifecycle policy.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    The tags to apply to the lifecycle policy during creation.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'dlm/cfn_lifecycle_policy_props.rb', line 21

def initialize(copy_tags: nil, create_interval: nil, cross_region_copy_targets: nil, default_policy: nil, description: nil, exclusions: nil, execution_role_arn: nil, extend_deletion: nil, policy_details: nil, retain_interval: nil, state: nil, tags: nil)
  @copy_tags = copy_tags
  Jsii::Type.check_type(@copy_tags, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "copyTags") unless @copy_tags.nil?
  @create_interval = create_interval
  Jsii::Type.check_type(@create_interval, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "createInterval") unless @create_interval.nil?
  @cross_region_copy_targets = cross_region_copy_targets
  Jsii::Type.check_type(@cross_region_copy_targets, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZGxtLkNmbkxpZmVjeWNsZVBvbGljeS5Dcm9zc1JlZ2lvbkNvcHlUYXJnZXRQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "crossRegionCopyTargets") unless @cross_region_copy_targets.nil?
  @default_policy = default_policy
  Jsii::Type.check_type(@default_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultPolicy") unless @default_policy.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @exclusions = exclusions.is_a?(Hash) ? ::AWSCDK::DLM::CfnLifecyclePolicy::ExclusionsProperty.new(**exclusions.transform_keys(&:to_sym)) : exclusions
  Jsii::Type.check_type(@exclusions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19kbG0uQ2ZuTGlmZWN5Y2xlUG9saWN5LkV4Y2x1c2lvbnNQcm9wZXJ0eSJ9XX19")), "exclusions") unless @exclusions.nil?
  @execution_role_arn = execution_role_arn
  Jsii::Type.check_type(@execution_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "executionRoleArn") unless @execution_role_arn.nil?
  @extend_deletion = extend_deletion
  Jsii::Type.check_type(@extend_deletion, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "extendDeletion") unless @extend_deletion.nil?
  @policy_details = policy_details.is_a?(Hash) ? ::AWSCDK::DLM::CfnLifecyclePolicy::PolicyDetailsProperty.new(**policy_details.transform_keys(&:to_sym)) : policy_details
  Jsii::Type.check_type(@policy_details, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19kbG0uQ2ZuTGlmZWN5Y2xlUG9saWN5LlBvbGljeURldGFpbHNQcm9wZXJ0eSJ9XX19")), "policyDetails") unless @policy_details.nil?
  @retain_interval = retain_interval
  Jsii::Type.check_type(@retain_interval, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retainInterval") unless @retain_interval.nil?
  @state = state
  Jsii::Type.check_type(@state, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "state") unless @state.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#copy_tagsBoolean, ... (readonly)

[Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.

If you do not specify a value, the default is false .

Default: false



56
57
58
# File 'dlm/cfn_lifecycle_policy_props.rb', line 56

def copy_tags
  @copy_tags
end

#create_intervalNumeric? (readonly)

[Default policies only] Specifies how often the policy should run and create snapshots or AMIs.

The creation frequency can range from 1 to 7 days. If you do not specify a value, the default is 1.

Default: 1



65
66
67
# File 'dlm/cfn_lifecycle_policy_props.rb', line 65

def create_interval
  @create_interval
end

#cross_region_copy_targetsAWSCDK::IResolvable, ... (readonly)

[Default policies only] Specifies destination Regions for snapshot or AMI copies.

You can specify up to 3 destination Regions. If you do not want to create cross-Region copies, omit this parameter.



72
73
74
# File 'dlm/cfn_lifecycle_policy_props.rb', line 72

def cross_region_copy_targets
  @cross_region_copy_targets
end

#default_policyString? (readonly)

[Default policies only] Specify the type of default policy to create.

  • To create a default policy for EBS snapshots, that creates snapshots of all volumes in the Region that do not have recent backups, specify VOLUME .
  • To create a default policy for EBS-backed AMIs, that creates EBS-backed AMIs from all instances in the Region that do not have recent backups, specify INSTANCE .


80
81
82
# File 'dlm/cfn_lifecycle_policy_props.rb', line 80

def default_policy
  @default_policy
end

#descriptionString? (readonly)

A description of the lifecycle policy.

The characters ^[0-9A-Za-z _-]+$ are supported.



87
88
89
# File 'dlm/cfn_lifecycle_policy_props.rb', line 87

def description
  @description
end

#exclusionsAWSCDK::IResolvable, ... (readonly)

[Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs.

The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.



94
95
96
# File 'dlm/cfn_lifecycle_policy_props.rb', line 94

def exclusions
  @exclusions
end

#execution_role_arnString? (readonly)

The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.



99
100
101
# File 'dlm/cfn_lifecycle_policy_props.rb', line 99

def execution_role_arn
  @execution_role_arn
end

#extend_deletionBoolean, ... (readonly)

[Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.

By default ( ExtendDeletion=false ):

  • If a source resource is deleted, Amazon Data Lifecycle Manager will continue to delete previously created snapshots or AMIs, up to but not including the last one, based on the specified retention period. If you want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, including the last one, specify true .
  • If a policy enters the error, disabled, or deleted state, Amazon Data Lifecycle Manager stops deleting snapshots and AMIs. If you want Amazon Data Lifecycle Manager to continue deleting snapshots or AMIs, including the last one, if the policy enters one of these states, specify true .

If you enable extended deletion ( ExtendDeletion=true ), you override both default behaviors simultaneously.

If you do not specify a value, the default is false .

Default: false



115
116
117
# File 'dlm/cfn_lifecycle_policy_props.rb', line 115

def extend_deletion
  @extend_deletion
end

#policy_detailsAWSCDK::IResolvable, ... (readonly)

The configuration details of the lifecycle policy.

If you create a default policy, you can specify the request parameters either in the request body, or in the PolicyDetails request structure, but not both.



122
123
124
# File 'dlm/cfn_lifecycle_policy_props.rb', line 122

def policy_details
  @policy_details
end

#retain_intervalNumeric? (readonly)

[Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them.

The retention period can range from 2 to 14 days, but it must be greater than the creation frequency to ensure that the policy retains at least 1 snapshot or AMI at any given time. If you do not specify a value, the default is 7.

Default: 7



131
132
133
# File 'dlm/cfn_lifecycle_policy_props.rb', line 131

def retain_interval
  @retain_interval
end

#stateString? (readonly)

The activation state of the lifecycle policy.



136
137
138
# File 'dlm/cfn_lifecycle_policy_props.rb', line 136

def state
  @state
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

The tags to apply to the lifecycle policy during creation.



141
142
143
# File 'dlm/cfn_lifecycle_policy_props.rb', line 141

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'dlm/cfn_lifecycle_policy_props.rb', line 143

def self.jsii_properties
  {
    :copy_tags => "copyTags",
    :create_interval => "createInterval",
    :cross_region_copy_targets => "crossRegionCopyTargets",
    :default_policy => "defaultPolicy",
    :description => "description",
    :exclusions => "exclusions",
    :execution_role_arn => "executionRoleArn",
    :extend_deletion => "extendDeletion",
    :policy_details => "policyDetails",
    :retain_interval => "retainInterval",
    :state => "state",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'dlm/cfn_lifecycle_policy_props.rb', line 160

def to_jsii
  result = {}
  result.merge!({
    "copyTags" => @copy_tags,
    "createInterval" => @create_interval,
    "crossRegionCopyTargets" => @cross_region_copy_targets,
    "defaultPolicy" => @default_policy,
    "description" => @description,
    "exclusions" => @exclusions,
    "executionRoleArn" => @execution_role_arn,
    "extendDeletion" => @extend_deletion,
    "policyDetails" => @policy_details,
    "retainInterval" => @retain_interval,
    "state" => @state,
    "tags" => @tags,
  })
  result.compact
end