CfnLifecyclePolicy

class aws_cdk.aws_dlm.CfnLifecyclePolicy(scope, id, *, description=None, execution_role_arn=None, policy_details=None, state=None, tags=None)

Bases: aws_cdk.core.CfnResource

A CloudFormation AWS::DLM::LifecyclePolicy.

Specifies a lifecycle policy, which is used to automate operations on Amazon EBS resources.

The properties are required when you add a lifecycle policy and optional when you update a lifecycle policy.

CloudformationResource

AWS::DLM::LifecyclePolicy

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dlm-lifecyclepolicy.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

cfn_lifecycle_policy = dlm.CfnLifecyclePolicy(self, "MyCfnLifecyclePolicy",
    description="description",
    execution_role_arn="executionRoleArn",
    policy_details=dlm.CfnLifecyclePolicy.PolicyDetailsProperty(
        actions=[dlm.CfnLifecyclePolicy.ActionProperty(
            cross_region_copy=[dlm.CfnLifecyclePolicy.CrossRegionCopyActionProperty(
                encryption_configuration=dlm.CfnLifecyclePolicy.EncryptionConfigurationProperty(
                    encrypted=False,

                    # the properties below are optional
                    cmk_arn="cmkArn"
                ),
                target="target",

                # the properties below are optional
                retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
                    interval=123,
                    interval_unit="intervalUnit"
                )
            )],
            name="name"
        )],
        event_source=dlm.CfnLifecyclePolicy.EventSourceProperty(
            type="type",

            # the properties below are optional
            parameters=dlm.CfnLifecyclePolicy.EventParametersProperty(
                event_type="eventType",
                snapshot_owner=["snapshotOwner"],

                # the properties below are optional
                description_regex="descriptionRegex"
            )
        ),
        parameters=dlm.CfnLifecyclePolicy.ParametersProperty(
            exclude_boot_volume=False,
            no_reboot=False
        ),
        policy_type="policyType",
        resource_locations=["resourceLocations"],
        resource_types=["resourceTypes"],
        schedules=[dlm.CfnLifecyclePolicy.ScheduleProperty(
            copy_tags=False,
            create_rule=dlm.CfnLifecyclePolicy.CreateRuleProperty(
                cron_expression="cronExpression",
                interval=123,
                interval_unit="intervalUnit",
                location="location",
                times=["times"]
            ),
            cross_region_copy_rules=[dlm.CfnLifecyclePolicy.CrossRegionCopyRuleProperty(
                encrypted=False,

                # the properties below are optional
                cmk_arn="cmkArn",
                copy_tags=False,
                deprecate_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty(
                    interval=123,
                    interval_unit="intervalUnit"
                ),
                retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
                    interval=123,
                    interval_unit="intervalUnit"
                ),
                target="target",
                target_region="targetRegion"
            )],
            deprecate_rule=dlm.CfnLifecyclePolicy.DeprecateRuleProperty(
                count=123,
                interval=123,
                interval_unit="intervalUnit"
            ),
            fast_restore_rule=dlm.CfnLifecyclePolicy.FastRestoreRuleProperty(
                availability_zones=["availabilityZones"],
                count=123,
                interval=123,
                interval_unit="intervalUnit"
            ),
            name="name",
            retain_rule=dlm.CfnLifecyclePolicy.RetainRuleProperty(
                count=123,
                interval=123,
                interval_unit="intervalUnit"
            ),
            share_rules=[dlm.CfnLifecyclePolicy.ShareRuleProperty(
                target_accounts=["targetAccounts"],
                unshare_interval=123,
                unshare_interval_unit="unshareIntervalUnit"
            )],
            tags_to_add=[CfnTag(
                key="key",
                value="value"
            )],
            variable_tags=[CfnTag(
                key="key",
                value="value"
            )]
        )],
        target_tags=[CfnTag(
            key="key",
            value="value"
        )]
    ),
    state="state",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Create a new AWS::DLM::LifecyclePolicy.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • description (Optional[str]) – A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$ are supported.

  • execution_role_arn (Optional[str]) – The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.

  • policy_details (Union[PolicyDetailsProperty, IResolvable, None]) – The configuration details of the lifecycle policy.

  • state (Optional[str]) – The activation state of the lifecycle policy.

  • tags (Optional[Sequence[CfnTag]]) – The tags to apply to the lifecycle policy during creation.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}
Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::DLM::LifecyclePolicy'
attr_arn

The Amazon Resource Name (ARN) of the lifecycle policy.

CloudformationAttribute

Arn

Return type

str

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

description

A description of the lifecycle policy.

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dlm-lifecyclepolicy.html#cfn-dlm-lifecyclepolicy-description

Return type

Optional[str]

execution_role_arn

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dlm-lifecyclepolicy.html#cfn-dlm-lifecyclepolicy-executionrolearn

Return type

Optional[str]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

Return type

ConstructNode

policy_details

The configuration details of the lifecycle policy.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dlm-lifecyclepolicy.html#cfn-dlm-lifecyclepolicy-policydetails

Return type

Union[PolicyDetailsProperty, IResolvable, None]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

state

The activation state of the lifecycle policy.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dlm-lifecyclepolicy.html#cfn-dlm-lifecyclepolicy-state

Return type

Optional[str]

tags

The tags to apply to the lifecycle policy during creation.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dlm-lifecyclepolicy.html#cfn-dlm-lifecyclepolicy-tags

Return type

TagManager

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

ActionProperty

class CfnLifecyclePolicy.ActionProperty(*, cross_region_copy, name)

Bases: object

Specifies an action for an event-based policy.

Parameters
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-action.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

action_property = dlm.CfnLifecyclePolicy.ActionProperty(
    cross_region_copy=[dlm.CfnLifecyclePolicy.CrossRegionCopyActionProperty(
        encryption_configuration=dlm.CfnLifecyclePolicy.EncryptionConfigurationProperty(
            encrypted=False,

            # the properties below are optional
            cmk_arn="cmkArn"
        ),
        target="target",

        # the properties below are optional
        retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
            interval=123,
            interval_unit="intervalUnit"
        )
    )],
    name="name"
)

Attributes

cross_region_copy

The rule for copying shared snapshots across Regions.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-action.html#cfn-dlm-lifecyclepolicy-action-crossregioncopy

Return type

Union[IResolvable, List[Union[IResolvable, CrossRegionCopyActionProperty]]]

name

A descriptive name for the action.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-action.html#cfn-dlm-lifecyclepolicy-action-name

Return type

str

CreateRuleProperty

class CfnLifecyclePolicy.CreateRuleProperty(*, cron_expression=None, interval=None, interval_unit=None, location=None, times=None)

Bases: object

Specifies when to create snapshots of EBS volumes.

You must specify either a Cron expression or an interval, interval unit, and start time. You cannot specify both.

Parameters
  • cron_expression (Optional[str]) – The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more information, see Cron expressions in the Amazon CloudWatch User Guide .

  • interval (Union[int, float, None]) – The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.

  • interval_unit (Optional[str]) – The interval unit.

  • location (Optional[str]) – Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify CLOUD . To create snapshots on the same Outpost as the source resource, specify OUTPOST_LOCAL . If you omit this parameter, CLOUD is used by default. If the policy targets resources in an AWS Region , then you must create snapshots in the same Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost.

  • times (Optional[Sequence[str]]) – 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 DLM selects a time within the next 24 hours.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-createrule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

create_rule_property = dlm.CfnLifecyclePolicy.CreateRuleProperty(
    cron_expression="cronExpression",
    interval=123,
    interval_unit="intervalUnit",
    location="location",
    times=["times"]
)

Attributes

cron_expression

The schedule, as a Cron expression.

The schedule interval must be between 1 hour and 1 year. For more information, see Cron expressions in the Amazon CloudWatch User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-createrule.html#cfn-dlm-lifecyclepolicy-createrule-cronexpression

Return type

Optional[str]

interval

The interval between snapshots.

The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-createrule.html#cfn-dlm-lifecyclepolicy-createrule-interval

Return type

Union[int, float, None]

interval_unit

The interval unit.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-createrule.html#cfn-dlm-lifecyclepolicy-createrule-intervalunit

Return type

Optional[str]

location

Specifies the destination for snapshots created by the policy.

To create snapshots in the same Region as the source resource, specify CLOUD . To create snapshots on the same Outpost as the source resource, specify OUTPOST_LOCAL . If you omit this parameter, CLOUD is used by default.

If the policy targets resources in an AWS Region , then you must create snapshots in the same Region as the source resource.

If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-createrule.html#cfn-dlm-lifecyclepolicy-createrule-location

Return type

Optional[str]

times

The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon DLM selects a time within the next 24 hours.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-createrule.html#cfn-dlm-lifecyclepolicy-createrule-times

Type

The time, in UTC, to start the operation. The supported format is hh

Return type

Optional[List[str]]

CrossRegionCopyActionProperty

class CfnLifecyclePolicy.CrossRegionCopyActionProperty(*, encryption_configuration, target, retain_rule=None)

Bases: object

Specifies a rule for copying shared snapshots across Regions.

Parameters
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyaction.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

cross_region_copy_action_property = dlm.CfnLifecyclePolicy.CrossRegionCopyActionProperty(
    encryption_configuration=dlm.CfnLifecyclePolicy.EncryptionConfigurationProperty(
        encrypted=False,

        # the properties below are optional
        cmk_arn="cmkArn"
    ),
    target="target",

    # the properties below are optional
    retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
        interval=123,
        interval_unit="intervalUnit"
    )
)

Attributes

encryption_configuration

The encryption settings for the copied snapshot.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyaction.html#cfn-dlm-lifecyclepolicy-crossregioncopyaction-encryptionconfiguration

Return type

Union[IResolvable, EncryptionConfigurationProperty]

retain_rule

Specifies the retention rule for cross-Region snapshot copies.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyaction.html#cfn-dlm-lifecyclepolicy-crossregioncopyaction-retainrule

Return type

Union[IResolvable, CrossRegionCopyRetainRuleProperty, None]

target

The target Region.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyaction.html#cfn-dlm-lifecyclepolicy-crossregioncopyaction-target

Return type

str

CrossRegionCopyDeprecateRuleProperty

class CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty(*, interval, interval_unit)

Bases: object

Specifies an AMI deprecation rule for cross-Region AMI copies created by a cross-Region copy rule.

Parameters
  • interval (Union[int, float]) – The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can’t be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

  • interval_unit (str) – The unit of time in which to measure the Interval .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopydeprecaterule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

cross_region_copy_deprecate_rule_property = dlm.CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty(
    interval=123,
    interval_unit="intervalUnit"
)

Attributes

interval

The period after which to deprecate the cross-Region AMI copies.

The period must be less than or equal to the cross-Region AMI copy retention period, and it can’t be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopydeprecaterule.html#cfn-dlm-lifecyclepolicy-crossregioncopydeprecaterule-interval

Return type

Union[int, float]

interval_unit

The unit of time in which to measure the Interval .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopydeprecaterule.html#cfn-dlm-lifecyclepolicy-crossregioncopydeprecaterule-intervalunit

Return type

str

CrossRegionCopyRetainRuleProperty

class CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(*, interval, interval_unit)

Bases: object

Specifies the retention rule for cross-Region snapshot copies.

Parameters
  • interval (Union[int, float]) – The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.

  • interval_unit (str) – The unit of time for time-based retention.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyretainrule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

cross_region_copy_retain_rule_property = dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
    interval=123,
    interval_unit="intervalUnit"
)

Attributes

interval

The amount of time to retain each snapshot.

The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyretainrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyretainrule-interval

Return type

Union[int, float]

interval_unit

The unit of time for time-based retention.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyretainrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyretainrule-intervalunit

Return type

str

CrossRegionCopyRuleProperty

class CfnLifecyclePolicy.CrossRegionCopyRuleProperty(*, encrypted, cmk_arn=None, copy_tags=None, deprecate_rule=None, retain_rule=None, target=None, target_region=None)

Bases: object

Specifies a rule for cross-Region snapshot copies.

Parameters
  • encrypted (Union[bool, IResolvable]) – To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or if encryption by default is not enabled.

  • cmk_arn (Optional[str]) – The Amazon Resource Name (ARN) of the AWS KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.

  • copy_tags (Union[bool, IResolvable, None]) – Indicates whether to copy all user-defined tags from the source snapshot to the cross-Region snapshot copy.

  • deprecate_rule (Union[IResolvable, CrossRegionCopyDeprecateRuleProperty, None]) – The AMI deprecation rule for cross-Region AMI copies created by the rule.

  • retain_rule (Union[IResolvable, CrossRegionCopyRetainRuleProperty, None]) – The retention rule that indicates how long snapshot copies are to be retained in the destination Region.

  • target (Optional[str]) – The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies. Use this parameter instead of TargetRegion . Do not specify both.

  • target_region (Optional[str]) – Avoid using this parameter when creating new policies. Instead, use Target to specify a target Region or a target Outpost for snapshot copies. For policies created before the Target parameter was introduced, this parameter indicates the target Region for snapshot copies.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

cross_region_copy_rule_property = dlm.CfnLifecyclePolicy.CrossRegionCopyRuleProperty(
    encrypted=False,

    # the properties below are optional
    cmk_arn="cmkArn",
    copy_tags=False,
    deprecate_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty(
        interval=123,
        interval_unit="intervalUnit"
    ),
    retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
        interval=123,
        interval_unit="intervalUnit"
    ),
    target="target",
    target_region="targetRegion"
)

Attributes

cmk_arn

The Amazon Resource Name (ARN) of the AWS KMS key to use for EBS encryption.

If this parameter is not specified, the default KMS key for the account is used.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-cmkarn

Return type

Optional[str]

copy_tags

Indicates whether to copy all user-defined tags from the source snapshot to the cross-Region snapshot copy.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-copytags

Return type

Union[bool, IResolvable, None]

deprecate_rule

The AMI deprecation rule for cross-Region AMI copies created by the rule.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-deprecaterule

Return type

Union[IResolvable, CrossRegionCopyDeprecateRuleProperty, None]

encrypted

To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter.

Copies of encrypted snapshots are encrypted, even if this parameter is false or if encryption by default is not enabled.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-encrypted

Return type

Union[bool, IResolvable]

retain_rule

The retention rule that indicates how long snapshot copies are to be retained in the destination Region.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-retainrule

Return type

Union[IResolvable, CrossRegionCopyRetainRuleProperty, None]

target

The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.

Use this parameter instead of TargetRegion . Do not specify both.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-target

Return type

Optional[str]

target_region

Avoid using this parameter when creating new policies.

Instead, use Target to specify a target Region or a target Outpost for snapshot copies.

For policies created before the Target parameter was introduced, this parameter indicates the target Region for snapshot copies.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-targetregion

Return type

Optional[str]

DeprecateRuleProperty

class CfnLifecyclePolicy.DeprecateRuleProperty(*, count=None, interval=None, interval_unit=None)

Bases: object

Specifies an AMI deprecation rule for a schedule.

Parameters
  • count (Union[int, float, None]) – If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate. The count must be less than or equal to the schedule’s retention count, and it can’t be greater than 1000.

  • interval (Union[int, float, None]) – If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule. The period must be less than or equal to the schedule’s retention period, and it can’t be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

  • interval_unit (Optional[str]) – The unit of time in which to measure the Interval .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

deprecate_rule_property = dlm.CfnLifecyclePolicy.DeprecateRuleProperty(
    count=123,
    interval=123,
    interval_unit="intervalUnit"
)

Attributes

count

If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate.

The count must be less than or equal to the schedule’s retention count, and it can’t be greater than 1000.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html#cfn-dlm-lifecyclepolicy-deprecaterule-count

Return type

Union[int, float, None]

interval

If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule.

The period must be less than or equal to the schedule’s retention period, and it can’t be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html#cfn-dlm-lifecyclepolicy-deprecaterule-interval

Return type

Union[int, float, None]

interval_unit

The unit of time in which to measure the Interval .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html#cfn-dlm-lifecyclepolicy-deprecaterule-intervalunit

Return type

Optional[str]

EncryptionConfigurationProperty

class CfnLifecyclePolicy.EncryptionConfigurationProperty(*, encrypted, cmk_arn=None)

Bases: object

Specifies the encryption settings for shared snapshots that are copied across Regions.

Parameters
  • encrypted (Union[bool, IResolvable]) – To encrypt a copy of an unencrypted snapshot when encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or when encryption by default is not enabled.

  • cmk_arn (Optional[str]) – The Amazon Resource Name (ARN) of the AWS KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-encryptionconfiguration.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

encryption_configuration_property = dlm.CfnLifecyclePolicy.EncryptionConfigurationProperty(
    encrypted=False,

    # the properties below are optional
    cmk_arn="cmkArn"
)

Attributes

cmk_arn

The Amazon Resource Name (ARN) of the AWS KMS key to use for EBS encryption.

If this parameter is not specified, the default KMS key for the account is used.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-encryptionconfiguration.html#cfn-dlm-lifecyclepolicy-encryptionconfiguration-cmkarn

Return type

Optional[str]

encrypted

To encrypt a copy of an unencrypted snapshot when encryption by default is not enabled, enable encryption using this parameter.

Copies of encrypted snapshots are encrypted, even if this parameter is false or when encryption by default is not enabled.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-encryptionconfiguration.html#cfn-dlm-lifecyclepolicy-encryptionconfiguration-encrypted

Return type

Union[bool, IResolvable]

EventParametersProperty

class CfnLifecyclePolicy.EventParametersProperty(*, event_type, snapshot_owner, description_regex=None)

Bases: object

Specifies an event that triggers an event-based policy.

Parameters
  • event_type (str) – The type of event. Currently, only snapshot sharing events are supported.

  • snapshot_owner (Sequence[str]) – The IDs of the AWS accounts that can trigger policy by sharing snapshots with your account. The policy only runs if one of the specified AWS accounts shares a snapshot with your account.

  • description_regex (Optional[str]) – The snapshot description that can trigger the policy. The description pattern is specified using a regular expression. The policy runs only if a snapshot with a description that matches the specified pattern is shared with your account. For example, specifying ^.*Created for policy: policy-1234567890abcdef0.*$ configures the policy to run only if snapshots created by policy policy-1234567890abcdef0 are shared with your account.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-eventparameters.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

event_parameters_property = dlm.CfnLifecyclePolicy.EventParametersProperty(
    event_type="eventType",
    snapshot_owner=["snapshotOwner"],

    # the properties below are optional
    description_regex="descriptionRegex"
)

Attributes

description_regex

The snapshot description that can trigger the policy.

The description pattern is specified using a regular expression. The policy runs only if a snapshot with a description that matches the specified pattern is shared with your account.

For example, specifying ^.*Created for policy: policy-1234567890abcdef0.*$ configures the policy to run only if snapshots created by policy policy-1234567890abcdef0 are shared with your account.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-eventparameters.html#cfn-dlm-lifecyclepolicy-eventparameters-descriptionregex

Return type

Optional[str]

event_type

The type of event.

Currently, only snapshot sharing events are supported.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-eventparameters.html#cfn-dlm-lifecyclepolicy-eventparameters-eventtype

Return type

str

snapshot_owner

The IDs of the AWS accounts that can trigger policy by sharing snapshots with your account.

The policy only runs if one of the specified AWS accounts shares a snapshot with your account.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-eventparameters.html#cfn-dlm-lifecyclepolicy-eventparameters-snapshotowner

Return type

List[str]

EventSourceProperty

class CfnLifecyclePolicy.EventSourceProperty(*, type, parameters=None)

Bases: object

Specifies an event that triggers an event-based policy.

Parameters
  • type (str) – The source of the event. Currently only managed CloudWatch Events rules are supported.

  • parameters (Union[IResolvable, EventParametersProperty, None]) – Information about the event.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-eventsource.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

event_source_property = dlm.CfnLifecyclePolicy.EventSourceProperty(
    type="type",

    # the properties below are optional
    parameters=dlm.CfnLifecyclePolicy.EventParametersProperty(
        event_type="eventType",
        snapshot_owner=["snapshotOwner"],

        # the properties below are optional
        description_regex="descriptionRegex"
    )
)

Attributes

parameters

Information about the event.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-eventsource.html#cfn-dlm-lifecyclepolicy-eventsource-parameters

Return type

Union[IResolvable, EventParametersProperty, None]

type

The source of the event.

Currently only managed CloudWatch Events rules are supported.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-eventsource.html#cfn-dlm-lifecyclepolicy-eventsource-type

Return type

str

FastRestoreRuleProperty

class CfnLifecyclePolicy.FastRestoreRuleProperty(*, availability_zones=None, count=None, interval=None, interval_unit=None)

Bases: object

Specifies a rule for enabling fast snapshot restore.

You can enable fast snapshot restore based on either a count or a time interval.

Parameters
  • availability_zones (Optional[Sequence[str]]) – The Availability Zones in which to enable fast snapshot restore.

  • count (Union[int, float, None]) – The number of snapshots to be enabled with fast snapshot restore.

  • interval (Union[int, float, None]) – The amount of time to enable fast snapshot restore. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.

  • interval_unit (Optional[str]) – The unit of time for enabling fast snapshot restore.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-fastrestorerule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

fast_restore_rule_property = dlm.CfnLifecyclePolicy.FastRestoreRuleProperty(
    availability_zones=["availabilityZones"],
    count=123,
    interval=123,
    interval_unit="intervalUnit"
)

Attributes

availability_zones

The Availability Zones in which to enable fast snapshot restore.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-fastrestorerule.html#cfn-dlm-lifecyclepolicy-fastrestorerule-availabilityzones

Return type

Optional[List[str]]

count

The number of snapshots to be enabled with fast snapshot restore.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-fastrestorerule.html#cfn-dlm-lifecyclepolicy-fastrestorerule-count

Return type

Union[int, float, None]

interval

The amount of time to enable fast snapshot restore.

The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-fastrestorerule.html#cfn-dlm-lifecyclepolicy-fastrestorerule-interval

Return type

Union[int, float, None]

interval_unit

The unit of time for enabling fast snapshot restore.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-fastrestorerule.html#cfn-dlm-lifecyclepolicy-fastrestorerule-intervalunit

Return type

Optional[str]

ParametersProperty

class CfnLifecyclePolicy.ParametersProperty(*, exclude_boot_volume=None, no_reboot=None)

Bases: object

Specifies optional parameters to add to a policy.

The set of valid parameters depends on the combination of policy type and resource type.

Parameters
  • exclude_boot_volume (Union[bool, IResolvable, None]) – [EBS Snapshot Management – Instance policies only] Indicates whether to exclude the root volume from snapshots created using CreateSnapshots . The default is false.

  • no_reboot (Union[bool, IResolvable, None]) – Applies to AMI lifecycle policies only. Indicates whether targeted instances are rebooted when the lifecycle policy runs. true indicates that targeted instances are not rebooted when the policy runs. false indicates that target instances are rebooted when the policy runs. The default is true (instances are not rebooted).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-parameters.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

parameters_property = dlm.CfnLifecyclePolicy.ParametersProperty(
    exclude_boot_volume=False,
    no_reboot=False
)

Attributes

exclude_boot_volume

//docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshots.html>`_ . The default is false.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-parameters.html#cfn-dlm-lifecyclepolicy-parameters-excludebootvolume

Type

[EBS Snapshot Management – Instance policies only] Indicates whether to exclude the root volume from snapshots created using `CreateSnapshots <https

Return type

Union[bool, IResolvable, None]

no_reboot

Applies to AMI lifecycle policies only.

Indicates whether targeted instances are rebooted when the lifecycle policy runs. true indicates that targeted instances are not rebooted when the policy runs. false indicates that target instances are rebooted when the policy runs. The default is true (instances are not rebooted).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-parameters.html#cfn-dlm-lifecyclepolicy-parameters-noreboot

Return type

Union[bool, IResolvable, None]

PolicyDetailsProperty

class CfnLifecyclePolicy.PolicyDetailsProperty(*, actions=None, event_source=None, parameters=None, policy_type=None, resource_locations=None, resource_types=None, schedules=None, target_tags=None)

Bases: object

Specifies the configuration of a lifecycle policy.

Parameters
  • actions (Union[IResolvable, Sequence[Union[IResolvable, ActionProperty]], None]) – The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.

  • event_source (Union[IResolvable, EventSourceProperty, None]) – The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.

  • parameters (Union[IResolvable, ParametersProperty, None]) – A set of optional parameters for snapshot and AMI lifecycle policies. This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter. .. epigraph:: 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.

  • policy_type (Optional[str]) – The valid target resource types and actions a policy can manage. 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 .

  • resource_locations (Optional[Sequence[str]]) – The location of the resources to backup. If the source resources are located in an AWS Region , specify CLOUD . If the source resources are located on an Outpost in your account, specify OUTPOST . If you specify OUTPOST , Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account.

  • resource_types (Optional[Sequence[str]]) – 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. This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.

  • schedules (Union[IResolvable, Sequence[Union[IResolvable, ScheduleProperty]], None]) – 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. This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.

  • target_tags (Union[IResolvable, Sequence[Union[IResolvable, CfnTag]], None]) – The single tag that identifies targeted resources for this policy. This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

policy_details_property = dlm.CfnLifecyclePolicy.PolicyDetailsProperty(
    actions=[dlm.CfnLifecyclePolicy.ActionProperty(
        cross_region_copy=[dlm.CfnLifecyclePolicy.CrossRegionCopyActionProperty(
            encryption_configuration=dlm.CfnLifecyclePolicy.EncryptionConfigurationProperty(
                encrypted=False,

                # the properties below are optional
                cmk_arn="cmkArn"
            ),
            target="target",

            # the properties below are optional
            retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
                interval=123,
                interval_unit="intervalUnit"
            )
        )],
        name="name"
    )],
    event_source=dlm.CfnLifecyclePolicy.EventSourceProperty(
        type="type",

        # the properties below are optional
        parameters=dlm.CfnLifecyclePolicy.EventParametersProperty(
            event_type="eventType",
            snapshot_owner=["snapshotOwner"],

            # the properties below are optional
            description_regex="descriptionRegex"
        )
    ),
    parameters=dlm.CfnLifecyclePolicy.ParametersProperty(
        exclude_boot_volume=False,
        no_reboot=False
    ),
    policy_type="policyType",
    resource_locations=["resourceLocations"],
    resource_types=["resourceTypes"],
    schedules=[dlm.CfnLifecyclePolicy.ScheduleProperty(
        copy_tags=False,
        create_rule=dlm.CfnLifecyclePolicy.CreateRuleProperty(
            cron_expression="cronExpression",
            interval=123,
            interval_unit="intervalUnit",
            location="location",
            times=["times"]
        ),
        cross_region_copy_rules=[dlm.CfnLifecyclePolicy.CrossRegionCopyRuleProperty(
            encrypted=False,

            # the properties below are optional
            cmk_arn="cmkArn",
            copy_tags=False,
            deprecate_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty(
                interval=123,
                interval_unit="intervalUnit"
            ),
            retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
                interval=123,
                interval_unit="intervalUnit"
            ),
            target="target",
            target_region="targetRegion"
        )],
        deprecate_rule=dlm.CfnLifecyclePolicy.DeprecateRuleProperty(
            count=123,
            interval=123,
            interval_unit="intervalUnit"
        ),
        fast_restore_rule=dlm.CfnLifecyclePolicy.FastRestoreRuleProperty(
            availability_zones=["availabilityZones"],
            count=123,
            interval=123,
            interval_unit="intervalUnit"
        ),
        name="name",
        retain_rule=dlm.CfnLifecyclePolicy.RetainRuleProperty(
            count=123,
            interval=123,
            interval_unit="intervalUnit"
        ),
        share_rules=[dlm.CfnLifecyclePolicy.ShareRuleProperty(
            target_accounts=["targetAccounts"],
            unshare_interval=123,
            unshare_interval_unit="unshareIntervalUnit"
        )],
        tags_to_add=[CfnTag(
            key="key",
            value="value"
        )],
        variable_tags=[CfnTag(
            key="key",
            value="value"
        )]
    )],
    target_tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

actions

The actions to be performed when the event-based policy is triggered. You can specify only one action per policy.

This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-actions

Return type

Union[IResolvable, List[Union[IResolvable, ActionProperty]], None]

event_source

The event that triggers the event-based policy.

This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-eventsource

Return type

Union[IResolvable, EventSourceProperty, None]

parameters

A set of optional parameters for snapshot and AMI lifecycle policies.

This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter. .. epigraph:

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

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-parameters

Return type

Union[IResolvable, ParametersProperty, None]

policy_type

The valid target resource types and actions a policy can manage.

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 .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-policytype

Return type

Optional[str]

resource_locations

The location of the resources to backup.

If the source resources are located in an AWS Region , specify CLOUD . If the source resources are located on an Outpost in your account, specify OUTPOST .

If you specify OUTPOST , Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-resourcelocations

Return type

Optional[List[str]]

resource_types

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.

This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-resourcetypes

Return type

Optional[List[str]]

schedules

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.

This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-schedules

Return type

Union[IResolvable, List[Union[IResolvable, ScheduleProperty]], None]

target_tags

The single tag that identifies targeted resources for this policy.

This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-policydetails.html#cfn-dlm-lifecyclepolicy-policydetails-targettags

Return type

Union[IResolvable, List[Union[IResolvable, CfnTag]], None]

RetainRuleProperty

class CfnLifecyclePolicy.RetainRuleProperty(*, count=None, interval=None, interval_unit=None)

Bases: object

Specifies the retention rule for a lifecycle policy.

You can retain snapshots based on either a count or a time interval.

Parameters
  • count (Union[int, float, None]) – The number of snapshots to retain for each volume, up to a maximum of 1000.

  • interval (Union[int, float, None]) – The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.

  • interval_unit (Optional[str]) – The unit of time for time-based retention.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-retainrule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

retain_rule_property = dlm.CfnLifecyclePolicy.RetainRuleProperty(
    count=123,
    interval=123,
    interval_unit="intervalUnit"
)

Attributes

count

The number of snapshots to retain for each volume, up to a maximum of 1000.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-retainrule.html#cfn-dlm-lifecyclepolicy-retainrule-count

Return type

Union[int, float, None]

interval

The amount of time to retain each snapshot.

The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-retainrule.html#cfn-dlm-lifecyclepolicy-retainrule-interval

Return type

Union[int, float, None]

interval_unit

The unit of time for time-based retention.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-retainrule.html#cfn-dlm-lifecyclepolicy-retainrule-intervalunit

Return type

Optional[str]

ScheduleProperty

class CfnLifecyclePolicy.ScheduleProperty(*, copy_tags=None, create_rule=None, cross_region_copy_rules=None, deprecate_rule=None, fast_restore_rule=None, name=None, retain_rule=None, share_rules=None, tags_to_add=None, variable_tags=None)

Bases: object

Specifies a backup schedule for a snapshot or AMI lifecycle policy.

Parameters
  • copy_tags (Union[bool, IResolvable, None]) – Copy all user-defined tags on a source volume to snapshots of the volume created by this policy.

  • create_rule (Union[IResolvable, CreateRuleProperty, None]) – The creation rule.

  • cross_region_copy_rules (Union[IResolvable, Sequence[Union[IResolvable, CrossRegionCopyRuleProperty]], None]) – The rule for cross-Region snapshot copies. You can only specify cross-Region copy rules for policies that create snapshots in a Region. If the policy creates snapshots on an Outpost, then you cannot copy the snapshots to a Region or to an Outpost. If the policy creates snapshots in a Region, then snapshots can be copied to up to three Regions or Outposts.

  • deprecate_rule (Union[IResolvable, DeprecateRuleProperty, None]) – The AMI deprecation rule for the schedule.

  • fast_restore_rule (Union[IResolvable, FastRestoreRuleProperty, None]) – The rule for enabling fast snapshot restore.

  • name (Optional[str]) – The name of the schedule.

  • retain_rule (Union[IResolvable, RetainRuleProperty, None]) – The retention rule.

  • share_rules (Union[IResolvable, Sequence[Union[IResolvable, ShareRuleProperty]], None]) – The rule for sharing snapshots with other AWS accounts .

  • tags_to_add (Union[IResolvable, Sequence[Union[IResolvable, CfnTag]], None]) – The tags to apply to policy-created resources. These user-defined tags are in addition to the AWS -added lifecycle tags.

  • variable_tags (Union[IResolvable, Sequence[Union[IResolvable, CfnTag]], None]) – A collection of key/value pairs with values determined dynamically when the policy is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: $(instance-id) or $(timestamp) . Variable tags are only valid for EBS Snapshot Management – Instance policies.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

schedule_property = dlm.CfnLifecyclePolicy.ScheduleProperty(
    copy_tags=False,
    create_rule=dlm.CfnLifecyclePolicy.CreateRuleProperty(
        cron_expression="cronExpression",
        interval=123,
        interval_unit="intervalUnit",
        location="location",
        times=["times"]
    ),
    cross_region_copy_rules=[dlm.CfnLifecyclePolicy.CrossRegionCopyRuleProperty(
        encrypted=False,

        # the properties below are optional
        cmk_arn="cmkArn",
        copy_tags=False,
        deprecate_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty(
            interval=123,
            interval_unit="intervalUnit"
        ),
        retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
            interval=123,
            interval_unit="intervalUnit"
        ),
        target="target",
        target_region="targetRegion"
    )],
    deprecate_rule=dlm.CfnLifecyclePolicy.DeprecateRuleProperty(
        count=123,
        interval=123,
        interval_unit="intervalUnit"
    ),
    fast_restore_rule=dlm.CfnLifecyclePolicy.FastRestoreRuleProperty(
        availability_zones=["availabilityZones"],
        count=123,
        interval=123,
        interval_unit="intervalUnit"
    ),
    name="name",
    retain_rule=dlm.CfnLifecyclePolicy.RetainRuleProperty(
        count=123,
        interval=123,
        interval_unit="intervalUnit"
    ),
    share_rules=[dlm.CfnLifecyclePolicy.ShareRuleProperty(
        target_accounts=["targetAccounts"],
        unshare_interval=123,
        unshare_interval_unit="unshareIntervalUnit"
    )],
    tags_to_add=[CfnTag(
        key="key",
        value="value"
    )],
    variable_tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

copy_tags

Copy all user-defined tags on a source volume to snapshots of the volume created by this policy.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-copytags

Return type

Union[bool, IResolvable, None]

create_rule

The creation rule.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-createrule

Return type

Union[IResolvable, CreateRuleProperty, None]

cross_region_copy_rules

The rule for cross-Region snapshot copies.

You can only specify cross-Region copy rules for policies that create snapshots in a Region. If the policy creates snapshots on an Outpost, then you cannot copy the snapshots to a Region or to an Outpost. If the policy creates snapshots in a Region, then snapshots can be copied to up to three Regions or Outposts.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-crossregioncopyrules

Return type

Union[IResolvable, List[Union[IResolvable, CrossRegionCopyRuleProperty]], None]

deprecate_rule

The AMI deprecation rule for the schedule.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-deprecaterule

Return type

Union[IResolvable, DeprecateRuleProperty, None]

fast_restore_rule

The rule for enabling fast snapshot restore.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-fastrestorerule

Return type

Union[IResolvable, FastRestoreRuleProperty, None]

name

The name of the schedule.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-name

Return type

Optional[str]

retain_rule

The retention rule.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-retainrule

Return type

Union[IResolvable, RetainRuleProperty, None]

share_rules

The rule for sharing snapshots with other AWS accounts .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-sharerules

Return type

Union[IResolvable, List[Union[IResolvable, ShareRuleProperty]], None]

tags_to_add

The tags to apply to policy-created resources.

These user-defined tags are in addition to the AWS -added lifecycle tags.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-tagstoadd

Return type

Union[IResolvable, List[Union[IResolvable, CfnTag]], None]

variable_tags

A collection of key/value pairs with values determined dynamically when the policy is executed.

Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: $(instance-id) or $(timestamp) . Variable tags are only valid for EBS Snapshot Management – Instance policies.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-variabletags

Return type

Union[IResolvable, List[Union[IResolvable, CfnTag]], None]

ShareRuleProperty

class CfnLifecyclePolicy.ShareRuleProperty(*, target_accounts=None, unshare_interval=None, unshare_interval_unit=None)

Bases: object

Specifies a rule for sharing snapshots across AWS accounts .

Parameters
  • target_accounts (Optional[Sequence[str]]) – The IDs of the AWS accounts with which to share the snapshots.

  • unshare_interval (Union[int, float, None]) – The period after which snapshots that are shared with other AWS accounts are automatically unshared.

  • unshare_interval_unit (Optional[str]) – The unit of time for the automatic unsharing interval.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-sharerule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_dlm as dlm

share_rule_property = dlm.CfnLifecyclePolicy.ShareRuleProperty(
    target_accounts=["targetAccounts"],
    unshare_interval=123,
    unshare_interval_unit="unshareIntervalUnit"
)

Attributes

target_accounts

The IDs of the AWS accounts with which to share the snapshots.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-sharerule.html#cfn-dlm-lifecyclepolicy-sharerule-targetaccounts

Return type

Optional[List[str]]

unshare_interval

The period after which snapshots that are shared with other AWS accounts are automatically unshared.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-sharerule.html#cfn-dlm-lifecyclepolicy-sharerule-unshareinterval

Return type

Union[int, float, None]

unshare_interval_unit

The unit of time for the automatic unsharing interval.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-sharerule.html#cfn-dlm-lifecyclepolicy-sharerule-unshareintervalunit

Return type

Optional[str]