Class: AWSCDK::DLM::CfnLifecyclePolicy::PolicyDetailsProperty

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

Overview

Specifies the configuration of a lifecycle policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actions: nil, copy_tags: nil, create_interval: nil, cross_region_copy_targets: nil, event_source: nil, exclusions: nil, extend_deletion: nil, parameters: nil, policy_language: nil, policy_type: nil, resource_locations: nil, resource_type: nil, resource_types: nil, retain_interval: nil, schedules: nil, target_tags: nil) ⇒ PolicyDetailsProperty

Returns a new instance of PolicyDetailsProperty.

Parameters:

  • actions (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::DLM::CfnLifecyclePolicy::ActionProperty>, nil) (defaults to: nil)

    [Event-based policies only] The actions to be performed when the event-based policy is activated.

  • 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.

  • event_source (AWSCDK::IResolvable, AWSCDK::DLM::CfnLifecyclePolicy::EventSourceProperty, nil) (defaults to: nil)

    [Event-based policies only] The event that activates the event-based 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.

  • 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.

  • parameters (AWSCDK::IResolvable, AWSCDK::DLM::CfnLifecyclePolicy::ParametersProperty, nil) (defaults to: nil)

    [Custom snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies.

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

    The type of policy to create. Specify one of the following:.

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

    The type of policy.

  • resource_locations (Array<String>, nil) (defaults to: nil)

    [Custom snapshot and AMI policies only] The location of the resources to backup.

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

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

  • resource_types (Array<String>, nil) (defaults to: nil)

    [Custom snapshot policies only] The target resource type for snapshot and AMI lifecycle policies.

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

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

  • schedules (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::DLM::CfnLifecyclePolicy::ScheduleProperty>, nil) (defaults to: nil)

    [Custom snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle policies.

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

    [Custom snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.



1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
# File 'dlm/cfn_lifecycle_policy.rb', line 1602

def initialize(actions: nil, copy_tags: nil, create_interval: nil, cross_region_copy_targets: nil, event_source: nil, exclusions: nil, extend_deletion: nil, parameters: nil, policy_language: nil, policy_type: nil, resource_locations: nil, resource_type: nil, resource_types: nil, retain_interval: nil, schedules: nil, target_tags: nil)
  @actions = actions
  Jsii::Type.check_type(@actions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZGxtLkNmbkxpZmVjeWNsZVBvbGljeS5BY3Rpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "actions") unless @actions.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?
  @event_source = event_source.is_a?(Hash) ? ::AWSCDK::DLM::CfnLifecyclePolicy::EventSourceProperty.new(**event_source.transform_keys(&:to_sym)) : event_source
  Jsii::Type.check_type(@event_source, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19kbG0uQ2ZuTGlmZWN5Y2xlUG9saWN5LkV2ZW50U291cmNlUHJvcGVydHkifV19fQ==")), "eventSource") unless @event_source.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?
  @extend_deletion = extend_deletion
  Jsii::Type.check_type(@extend_deletion, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "extendDeletion") unless @extend_deletion.nil?
  @parameters = parameters.is_a?(Hash) ? ::AWSCDK::DLM::CfnLifecyclePolicy::ParametersProperty.new(**parameters.transform_keys(&:to_sym)) : parameters
  Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19kbG0uQ2ZuTGlmZWN5Y2xlUG9saWN5LlBhcmFtZXRlcnNQcm9wZXJ0eSJ9XX19")), "parameters") unless @parameters.nil?
  @policy_language = policy_language
  Jsii::Type.check_type(@policy_language, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyLanguage") unless @policy_language.nil?
  @policy_type = policy_type
  Jsii::Type.check_type(@policy_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyType") unless @policy_type.nil?
  @resource_locations = resource_locations
  Jsii::Type.check_type(@resource_locations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resourceLocations") unless @resource_locations.nil?
  @resource_type = resource_type
  Jsii::Type.check_type(@resource_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceType") unless @resource_type.nil?
  @resource_types = resource_types
  Jsii::Type.check_type(@resource_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resourceTypes") unless @resource_types.nil?
  @retain_interval = retain_interval
  Jsii::Type.check_type(@retain_interval, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retainInterval") unless @retain_interval.nil?
  @schedules = schedules
  Jsii::Type.check_type(@schedules, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZGxtLkNmbkxpZmVjeWNsZVBvbGljeS5TY2hlZHVsZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "schedules") unless @schedules.nil?
  @target_tags = target_tags
  Jsii::Type.check_type(@target_tags, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5UYWcifV19fSwia2luZCI6ImFycmF5In19XX19")), "targetTags") unless @target_tags.nil?
end

Instance Attribute Details

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

[Event-based policies only] The actions to be performed when the event-based policy is activated.

You can specify only one action per policy.



1643
1644
1645
# File 'dlm/cfn_lifecycle_policy.rb', line 1643

def actions
  @actions
end

#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



1652
1653
1654
# File 'dlm/cfn_lifecycle_policy.rb', line 1652

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



1661
1662
1663
# File 'dlm/cfn_lifecycle_policy.rb', line 1661

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.



1668
1669
1670
# File 'dlm/cfn_lifecycle_policy.rb', line 1668

def cross_region_copy_targets
  @cross_region_copy_targets
end

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

[Event-based policies only] The event that activates the event-based policy.



1673
1674
1675
# File 'dlm/cfn_lifecycle_policy.rb', line 1673

def event_source
  @event_source
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.



1680
1681
1682
# File 'dlm/cfn_lifecycle_policy.rb', line 1680

def exclusions
  @exclusions
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



1696
1697
1698
# File 'dlm/cfn_lifecycle_policy.rb', line 1696

def extend_deletion
  @extend_deletion
end

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

[Custom snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies.

If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle Manager console, then you must include this parameter and specify either the default values or the new values that you require. You can't omit this parameter or set its values to null.



1703
1704
1705
# File 'dlm/cfn_lifecycle_policy.rb', line 1703

def parameters
  @parameters
end

#policy_languageString? (readonly)

The type of policy to create. Specify one of the following:.

  • SIMPLIFIED To create a default policy.
  • STANDARD To create a custom policy.


1711
1712
1713
# File 'dlm/cfn_lifecycle_policy.rb', line 1711

def policy_language
  @policy_language
end

#policy_typeString? (readonly)

The type of policy.

Specify EBS_SNAPSHOT_MANAGEMENT to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify IMAGE_MANAGEMENT to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create an event-based policy that performs specific actions when a defined event occurs in your AWS account .

The default is EBS_SNAPSHOT_MANAGEMENT .



1720
1721
1722
# File 'dlm/cfn_lifecycle_policy.rb', line 1720

def policy_type
  @policy_type
end

#resource_locationsArray<String>? (readonly)

[Custom snapshot and AMI policies only] The location of the resources to backup.

  • If the source resources are located in a Region, specify CLOUD . In this case, the policy targets all resources of the specified type with matching target tags across all Availability Zones in the Region.
  • [Custom snapshot policies only] If the source resources are located in a Local Zone, specify LOCAL_ZONE . In this case, the policy targets all resources of the specified type with matching target tags across all Local Zones in the Region.
  • If the source resources are located on an Outpost in your account, specify OUTPOST . In this case, the policy targets all resources of the specified type with matching target tags across all of the Outposts in your account.


1729
1730
1731
# File 'dlm/cfn_lifecycle_policy.rb', line 1729

def resource_locations
  @resource_locations
end

#resource_typeString? (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 .


1737
1738
1739
# File 'dlm/cfn_lifecycle_policy.rb', line 1737

def resource_type
  @resource_type
end

#resource_typesArray<String>? (readonly)

[Custom snapshot policies only] The target resource type for snapshot and AMI lifecycle policies.

Use VOLUME to create snapshots of individual volumes or use INSTANCE to create multi-volume snapshots from the volumes for an instance.



1744
1745
1746
# File 'dlm/cfn_lifecycle_policy.rb', line 1744

def resource_types
  @resource_types
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



1753
1754
1755
# File 'dlm/cfn_lifecycle_policy.rb', line 1753

def retain_interval
  @retain_interval
end

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

[Custom snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle policies.

A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.



1760
1761
1762
# File 'dlm/cfn_lifecycle_policy.rb', line 1760

def schedules
  @schedules
end

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

[Custom snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.



1765
1766
1767
# File 'dlm/cfn_lifecycle_policy.rb', line 1765

def target_tags
  @target_tags
end

Class Method Details

.jsii_propertiesObject



1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
# File 'dlm/cfn_lifecycle_policy.rb', line 1767

def self.jsii_properties
  {
    :actions => "actions",
    :copy_tags => "copyTags",
    :create_interval => "createInterval",
    :cross_region_copy_targets => "crossRegionCopyTargets",
    :event_source => "eventSource",
    :exclusions => "exclusions",
    :extend_deletion => "extendDeletion",
    :parameters => "parameters",
    :policy_language => "policyLanguage",
    :policy_type => "policyType",
    :resource_locations => "resourceLocations",
    :resource_type => "resourceType",
    :resource_types => "resourceTypes",
    :retain_interval => "retainInterval",
    :schedules => "schedules",
    :target_tags => "targetTags",
  }
end

Instance Method Details

#to_jsiiObject



1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
# File 'dlm/cfn_lifecycle_policy.rb', line 1788

def to_jsii
  result = {}
  result.merge!({
    "actions" => @actions,
    "copyTags" => @copy_tags,
    "createInterval" => @create_interval,
    "crossRegionCopyTargets" => @cross_region_copy_targets,
    "eventSource" => @event_source,
    "exclusions" => @exclusions,
    "extendDeletion" => @extend_deletion,
    "parameters" => @parameters,
    "policyLanguage" => @policy_language,
    "policyType" => @policy_type,
    "resourceLocations" => @resource_locations,
    "resourceType" => @resource_type,
    "resourceTypes" => @resource_types,
    "retainInterval" => @retain_interval,
    "schedules" => @schedules,
    "targetTags" => @target_tags,
  })
  result.compact
end