CfnLifecyclePolicyPropsMixin

class aws_cdk.mixins_preview.aws_dlm.mixins.CfnLifecyclePolicyPropsMixin(props, *, strategy=None)

Bases: Mixin

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.

See:

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

CloudformationResource:

AWS::DLM::LifecyclePolicy

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

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

# cross_region_copy_targets: Any
# exclude_tags: Any
# exclude_volume_types: Any

cfn_lifecycle_policy_props_mixin = dlm_mixins.CfnLifecyclePolicyPropsMixin(dlm_mixins.CfnLifecyclePolicyMixinProps(
    copy_tags=False,
    create_interval=123,
    cross_region_copy_targets=cross_region_copy_targets,
    default_policy="defaultPolicy",
    description="description",
    exclusions=dlm_mixins.CfnLifecyclePolicyPropsMixin.ExclusionsProperty(
        exclude_boot_volumes=False,
        exclude_tags=exclude_tags,
        exclude_volume_types=exclude_volume_types
    ),
    execution_role_arn="executionRoleArn",
    extend_deletion=False,
    policy_details=dlm_mixins.CfnLifecyclePolicyPropsMixin.PolicyDetailsProperty(
        actions=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ActionProperty(
            cross_region_copy=[dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyActionProperty(
                encryption_configuration=dlm_mixins.CfnLifecyclePolicyPropsMixin.EncryptionConfigurationProperty(
                    cmk_arn="cmkArn",
                    encrypted=False
                ),
                retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
                    interval=123,
                    interval_unit="intervalUnit"
                ),
                target="target"
            )],
            name="name"
        )],
        copy_tags=False,
        create_interval=123,
        cross_region_copy_targets=cross_region_copy_targets,
        event_source=dlm_mixins.CfnLifecyclePolicyPropsMixin.EventSourceProperty(
            parameters=dlm_mixins.CfnLifecyclePolicyPropsMixin.EventParametersProperty(
                description_regex="descriptionRegex",
                event_type="eventType",
                snapshot_owner=["snapshotOwner"]
            ),
            type="type"
        ),
        exclusions=dlm_mixins.CfnLifecyclePolicyPropsMixin.ExclusionsProperty(
            exclude_boot_volumes=False,
            exclude_tags=exclude_tags,
            exclude_volume_types=exclude_volume_types
        ),
        extend_deletion=False,
        parameters=dlm_mixins.CfnLifecyclePolicyPropsMixin.ParametersProperty(
            exclude_boot_volume=False,
            exclude_data_volume_tags=[CfnTag(
                key="key",
                value="value"
            )],
            no_reboot=False
        ),
        policy_language="policyLanguage",
        policy_type="policyType",
        resource_locations=["resourceLocations"],
        resource_type="resourceType",
        resource_types=["resourceTypes"],
        retain_interval=123,
        schedules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ScheduleProperty(
            archive_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRuleProperty(
                retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRetainRuleProperty(
                    retention_archive_tier=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetentionArchiveTierProperty(
                        count=123,
                        interval=123,
                        interval_unit="intervalUnit"
                    )
                )
            ),
            copy_tags=False,
            create_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CreateRuleProperty(
                cron_expression="cronExpression",
                interval=123,
                interval_unit="intervalUnit",
                location="location",
                scripts=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ScriptProperty(
                    execute_operation_on_script_failure=False,
                    execution_handler="executionHandler",
                    execution_handler_service="executionHandlerService",
                    execution_timeout=123,
                    maximum_retry_count=123,
                    stages=["stages"]
                )],
                times=["times"]
            ),
            cross_region_copy_rules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRuleProperty(
                cmk_arn="cmkArn",
                copy_tags=False,
                deprecate_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyDeprecateRuleProperty(
                    interval=123,
                    interval_unit="intervalUnit"
                ),
                encrypted=False,
                retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
                    interval=123,
                    interval_unit="intervalUnit"
                ),
                target="target",
                target_region="targetRegion"
            )],
            deprecate_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.DeprecateRuleProperty(
                count=123,
                interval=123,
                interval_unit="intervalUnit"
            ),
            fast_restore_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.FastRestoreRuleProperty(
                availability_zones=["availabilityZones"],
                count=123,
                interval=123,
                interval_unit="intervalUnit"
            ),
            name="name",
            retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetainRuleProperty(
                count=123,
                interval=123,
                interval_unit="intervalUnit"
            ),
            share_rules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.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"
        )]
    ),
    retain_interval=123,
    state="state",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::DLM::LifecyclePolicy.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['copyTags', 'createInterval', 'crossRegionCopyTargets', 'defaultPolicy', 'description', 'exclusions', 'executionRoleArn', 'extendDeletion', 'policyDetails', 'retainInterval', 'state', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ActionProperty

class CfnLifecyclePolicyPropsMixin.ActionProperty(*, cross_region_copy=None, name=None)

Bases: object

[Event-based policies only] Specifies an action for an event-based policy.

Parameters:
See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

action_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.ActionProperty(
    cross_region_copy=[dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyActionProperty(
        encryption_configuration=dlm_mixins.CfnLifecyclePolicyPropsMixin.EncryptionConfigurationProperty(
            cmk_arn="cmkArn",
            encrypted=False
        ),
        retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
            interval=123,
            interval_unit="intervalUnit"
        ),
        target="target"
    )],
    name="name"
)

Attributes

cross_region_copy

The rule for copying shared snapshots across Regions.

See:

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

name

A descriptive name for the action.

See:

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

ArchiveRetainRuleProperty

class CfnLifecyclePolicyPropsMixin.ArchiveRetainRuleProperty(*, retention_archive_tier=None)

Bases: object

[Custom snapshot policies only] Specifies information about the archive storage tier retention period.

Parameters:

retention_archive_tier (Union[IResolvable, RetentionArchiveTierProperty, Dict[str, Any], None]) – Information about retention period in the Amazon EBS Snapshots Archive. For more information, see Archive Amazon EBS snapshots .

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

archive_retain_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRetainRuleProperty(
    retention_archive_tier=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetentionArchiveTierProperty(
        count=123,
        interval=123,
        interval_unit="intervalUnit"
    )
)

Attributes

retention_archive_tier

Information about retention period in the Amazon EBS Snapshots Archive.

For more information, see Archive Amazon EBS snapshots .

See:

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

ArchiveRuleProperty

class CfnLifecyclePolicyPropsMixin.ArchiveRuleProperty(*, retain_rule=None)

Bases: object

[Custom snapshot policies only] Specifies a snapshot archiving rule for a schedule.

Parameters:

retain_rule (Union[IResolvable, ArchiveRetainRuleProperty, Dict[str, Any], None]) – Information about the retention period for the snapshot archiving rule.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

archive_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRuleProperty(
    retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRetainRuleProperty(
        retention_archive_tier=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetentionArchiveTierProperty(
            count=123,
            interval=123,
            interval_unit="intervalUnit"
        )
    )
)

Attributes

retain_rule

Information about the retention period for the snapshot archiving rule.

See:

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

CreateRuleProperty

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

Bases: object

[Custom snapshot and AMI policies only] Specifies when the policy should create snapshots or AMIs.

  • You must specify either CronExpression , or Interval , IntervalUnit , and Times .

  • If you need to specify an ArchiveRule for the schedule, then you must specify a creation frequency of at least 28 days.

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 the Cron and rate expressions in the Amazon EventBridge 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]) – [Custom snapshot policies only] Specifies the destination for snapshots created by the policy. The allowed destinations depend on the location of the targeted resources. - If the policy targets resources in a Region, then you must create snapshots in the same Region as the source resource. - If the policy targets resources in a Local Zone, you can create snapshots in the same Local Zone or in its parent Region. - If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost or in its parent Region. Specify one of the following values: - To create snapshots in the same Region as the source resource, specify CLOUD . - To create snapshots in the same Local Zone as the source resource, specify LOCAL_ZONE . - To create snapshots on the same Outpost as the source resource, specify OUTPOST_LOCAL . Default: CLOUD

  • scripts (Union[IResolvable, Sequence[Union[IResolvable, ScriptProperty, Dict[str, Any]]], None]) – [Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances. This is useful for creating application-consistent snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager initiates snapshot creation. For more information, see Automating application-consistent snapshots with pre and post scripts .

  • 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 Data Lifecycle Manager selects a time within the next 24 hours.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

create_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.CreateRuleProperty(
    cron_expression="cronExpression",
    interval=123,
    interval_unit="intervalUnit",
    location="location",
    scripts=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ScriptProperty(
        execute_operation_on_script_failure=False,
        execution_handler="executionHandler",
        execution_handler_service="executionHandlerService",
        execution_timeout=123,
        maximum_retry_count=123,
        stages=["stages"]
    )],
    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 the Cron and rate expressions in the Amazon EventBridge User Guide .

See:

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

interval

The interval between snapshots.

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

See:

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

interval_unit

The interval unit.

See:

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

location

[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.

The allowed destinations depend on the location of the targeted resources.

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

  • If the policy targets resources in a Local Zone, you can create snapshots in the same Local Zone or in its parent Region.

  • If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost or in its parent Region.

Specify one of the following values:

  • To create snapshots in the same Region as the source resource, specify CLOUD .

  • To create snapshots in the same Local Zone as the source resource, specify LOCAL_ZONE .

  • To create snapshots on the same Outpost as the source resource, specify OUTPOST_LOCAL .

Default: CLOUD

See:

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

scripts

[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances.

This is useful for creating application-consistent snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager initiates snapshot creation.

For more information, see Automating application-consistent snapshots with pre and post scripts .

See:

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

times

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

See:

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

CrossRegionCopyActionProperty

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

Bases: object

[Event-based policies only] Specifies a cross-Region copy action for event-based policies.

To specify a cross-Region copy rule for snapshot and AMI policies, use CrossRegionCopyRule .

Parameters:
  • encryption_configuration (Union[IResolvable, EncryptionConfigurationProperty, Dict[str, Any], None]) – The encryption settings for the copied snapshot.

  • retain_rule (Union[IResolvable, CrossRegionCopyRetainRuleProperty, Dict[str, Any], None]) – Specifies a retention rule for cross-Region snapshot copies created by snapshot or event-based policies, or cross-Region AMI copies created by AMI policies. After the retention period expires, the cross-Region copy is deleted.

  • target (Optional[str]) – The target Region.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

cross_region_copy_action_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyActionProperty(
    encryption_configuration=dlm_mixins.CfnLifecyclePolicyPropsMixin.EncryptionConfigurationProperty(
        cmk_arn="cmkArn",
        encrypted=False
    ),
    retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
        interval=123,
        interval_unit="intervalUnit"
    ),
    target="target"
)

Attributes

encryption_configuration

The encryption settings for the copied snapshot.

See:

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

retain_rule

Specifies a retention rule for cross-Region snapshot copies created by snapshot or event-based policies, or cross-Region AMI copies created by AMI policies.

After the retention period expires, the cross-Region copy is deleted.

See:

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

target

The target Region.

See:

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

CrossRegionCopyDeprecateRuleProperty

class CfnLifecyclePolicyPropsMixin.CrossRegionCopyDeprecateRuleProperty(*, interval=None, interval_unit=None)

Bases: object

[Custom AMI policies only] Specifies an AMI deprecation rule for cross-Region AMI copies created by an AMI policy.

Parameters:
  • interval (Union[int, float, None]) – 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 (Optional[str]) – The unit of time in which to measure the Interval . For example, to deprecate a cross-Region AMI copy after 3 months, specify Interval=3 and IntervalUnit=MONTHS .

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

cross_region_copy_deprecate_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.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.

See:

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

interval_unit

The unit of time in which to measure the Interval .

For example, to deprecate a cross-Region AMI copy after 3 months, specify Interval=3 and IntervalUnit=MONTHS .

See:

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

CrossRegionCopyRetainRuleProperty

class CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(*, interval=None, interval_unit=None)

Bases: object

Specifies a retention rule for cross-Region snapshot copies created by snapshot or event-based policies, or cross-Region AMI copies created by AMI policies.

After the retention period expires, the cross-Region copy is deleted.

Parameters:
  • interval (Union[int, float, None]) – The amount of time to retain a cross-Region snapshot or AMI copy. 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. For example, to retain a cross-Region copy for 3 months, specify Interval=3 and IntervalUnit=MONTHS .

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

cross_region_copy_retain_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
    interval=123,
    interval_unit="intervalUnit"
)

Attributes

interval

The amount of time to retain a cross-Region snapshot or AMI copy.

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

See:

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

interval_unit

The unit of time for time-based retention.

For example, to retain a cross-Region copy for 3 months, specify Interval=3 and IntervalUnit=MONTHS .

See:

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

CrossRegionCopyRuleProperty

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

Bases: object

[Custom snapshot and AMI policies only] Specifies a cross-Region copy rule for a snapshot and AMI policies.

To specify a cross-Region copy action for event-based polices, use CrossRegionCopyAction .

Parameters:
  • 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 or AMI to the cross-Region copy.

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

  • encrypted (Union[bool, IResolvable, None]) – 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.

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

  • target (Optional[str]) –

    Use this parameter for snapshot policies only. For AMI policies, use TargetRegion instead. [Custom snapshot policies only] The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.

  • target_region (Optional[str]) –

    Use this parameter for AMI policies only. For snapshot policies, use Target instead. For snapshot policies created before the Target parameter was introduced, this parameter indicates the target Region for snapshot copies. [Custom AMI policies only] The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

cross_region_copy_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRuleProperty(
    cmk_arn="cmkArn",
    copy_tags=False,
    deprecate_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyDeprecateRuleProperty(
        interval=123,
        interval_unit="intervalUnit"
    ),
    encrypted=False,
    retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.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.

See:

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

copy_tags

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

See:

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

deprecate_rule

[Custom AMI policies only] The AMI deprecation rule for cross-Region AMI copies created by the rule.

See:

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

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.

See:

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

retain_rule

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

See:

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

target

Use this parameter for snapshot policies only. For AMI policies, use TargetRegion instead.

[Custom snapshot policies only] The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.

see:

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

target_region

Use this parameter for AMI policies only.

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

[Custom AMI policies only] The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.

see:

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

DeprecateRuleProperty

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

Bases: object

[Custom AMI policies only] Specifies an AMI deprecation rule for AMIs created by an AMI lifecycle policy.

For age-based schedules, you must specify Interval and IntervalUnit . For count-based schedules, you must specify Count .

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 .

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

deprecate_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.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.

See:

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

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.

See:

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

interval_unit

The unit of time in which to measure the Interval .

See:

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

EncryptionConfigurationProperty

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

Bases: object

[Event-based policies only] Specifies the encryption settings for cross-Region snapshot copies created by event-based policies.

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

  • encrypted (Union[bool, IResolvable, None]) – 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.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

encryption_configuration_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.EncryptionConfigurationProperty(
    cmk_arn="cmkArn",
    encrypted=False
)

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.

See:

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

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.

See:

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

EventParametersProperty

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

Bases: object

[Event-based policies only] Specifies an event that activates an event-based policy.

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

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

  • snapshot_owner (Optional[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.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

event_parameters_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.EventParametersProperty(
    description_regex="descriptionRegex",
    event_type="eventType",
    snapshot_owner=["snapshotOwner"]
)

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.

See:

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

event_type

The type of event.

Currently, only snapshot sharing events are supported.

See:

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

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.

See:

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

EventSourceProperty

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

Bases: object

[Event-based policies only] Specifies an event that activates an event-based policy.

Parameters:
  • parameters (Union[IResolvable, EventParametersProperty, Dict[str, Any], None]) – Information about the event.

  • type (Optional[str]) – The source of the event. Currently only managed Amazon EventBridge (formerly known as Amazon CloudWatch) events are supported.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

event_source_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.EventSourceProperty(
    parameters=dlm_mixins.CfnLifecyclePolicyPropsMixin.EventParametersProperty(
        description_regex="descriptionRegex",
        event_type="eventType",
        snapshot_owner=["snapshotOwner"]
    ),
    type="type"
)

Attributes

parameters

Information about the event.

See:

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

type

The source of the event.

Currently only managed Amazon EventBridge (formerly known as Amazon CloudWatch) events are supported.

See:

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

ExclusionsProperty

class CfnLifecyclePolicyPropsMixin.ExclusionsProperty(*, exclude_boot_volumes=None, exclude_tags=None, exclude_volume_types=None)

Bases: object

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

Parameters:
  • exclude_boot_volumes (Union[bool, IResolvable, None]) – [Default policies for EBS snapshots only] Indicates whether to exclude volumes that are attached to instances as the boot volume. If you exclude boot volumes, only volumes attached as data (non-boot) volumes will be backed up by the policy. To exclude boot volumes, specify true .

  • exclude_tags (Any) – [Default policies for EBS-backed AMIs only] Specifies whether to exclude volumes that have specific tags.

  • exclude_volume_types (Any) – [Default policies for EBS snapshots only] Specifies the volume types to exclude. Volumes of the specified types will not be targeted by the policy.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# exclude_tags: Any
# exclude_volume_types: Any

exclusions_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.ExclusionsProperty(
    exclude_boot_volumes=False,
    exclude_tags=exclude_tags,
    exclude_volume_types=exclude_volume_types
)

Attributes

exclude_boot_volumes

[Default policies for EBS snapshots only] Indicates whether to exclude volumes that are attached to instances as the boot volume.

If you exclude boot volumes, only volumes attached as data (non-boot) volumes will be backed up by the policy. To exclude boot volumes, specify true .

See:

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

exclude_tags

[Default policies for EBS-backed AMIs only] Specifies whether to exclude volumes that have specific tags.

See:

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

exclude_volume_types

[Default policies for EBS snapshots only] Specifies the volume types to exclude.

Volumes of the specified types will not be targeted by the policy.

See:

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

FastRestoreRuleProperty

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

Bases: object

[Custom snapshot policies only] Specifies a rule for enabling fast snapshot restore for snapshots created by snapshot policies.

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.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

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

Attributes

availability_zones

The Availability Zones in which to enable fast snapshot restore.

See:

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

count

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

See:

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

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.

See:

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

interval_unit

The unit of time for enabling fast snapshot restore.

See:

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

ParametersProperty

class CfnLifecyclePolicyPropsMixin.ParametersProperty(*, exclude_boot_volume=None, exclude_data_volume_tags=None, no_reboot=None)

Bases: object

[Custom snapshot and AMI policies only] Specifies optional parameters for snapshot and AMI policies.

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

If you choose to exclude boot volumes and you specify tags that consequently exclude all of the additional data volumes attached to an instance, then Amazon Data Lifecycle Manager will not create any snapshots for the affected instance, and it will emit a SnapshotsCreateFailed Amazon CloudWatch metric. For more information, see Monitor your policies using Amazon CloudWatch .

Parameters:
  • exclude_boot_volume (Union[bool, IResolvable, None]) – [Custom snapshot policies that target instances only] Indicates whether to exclude the root volume from multi-volume snapshot sets. The default is false . If you specify true , then the root volumes attached to targeted instances will be excluded from the multi-volume snapshot sets created by the policy.

  • exclude_data_volume_tags (Union[IResolvable, Sequence[Union[IResolvable, CfnTag, Dict[str, Any]]], None]) – [Custom snapshot policies that target instances only] The tags used to identify data (non-root) volumes to exclude from multi-volume snapshot sets. If you create a snapshot lifecycle policy that targets instances and you specify tags for this parameter, then data volumes with the specified tags that are attached to targeted instances will be excluded from the multi-volume snapshot sets created by the policy.

  • no_reboot (Union[bool, IResolvable, None]) – [Custom AMI 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).

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

parameters_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.ParametersProperty(
    exclude_boot_volume=False,
    exclude_data_volume_tags=[CfnTag(
        key="key",
        value="value"
    )],
    no_reboot=False
)

Attributes

exclude_boot_volume

[Custom snapshot policies that target instances only] Indicates whether to exclude the root volume from multi-volume snapshot sets.

The default is false . If you specify true , then the root volumes attached to targeted instances will be excluded from the multi-volume snapshot sets created by the policy.

See:

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

exclude_data_volume_tags

[Custom snapshot policies that target instances only] The tags used to identify data (non-root) volumes to exclude from multi-volume snapshot sets.

If you create a snapshot lifecycle policy that targets instances and you specify tags for this parameter, then data volumes with the specified tags that are attached to targeted instances will be excluded from the multi-volume snapshot sets created by the policy.

See:

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

no_reboot

[Custom AMI 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).

See:

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

PolicyDetailsProperty

class CfnLifecyclePolicyPropsMixin.PolicyDetailsProperty(*, actions=None, copy_tags=None, create_interval=None, cross_region_copy_targets=None, event_source=None, exclusions=None, extend_deletion=None, parameters=None, policy_language=None, policy_type=None, resource_locations=None, resource_type=None, resource_types=None, retain_interval=None, schedules=None, target_tags=None)

Bases: object

Specifies the configuration of a lifecycle policy.

Parameters:
  • actions (Union[IResolvable, Sequence[Union[IResolvable, ActionProperty, Dict[str, Any]]], None]) – [Event-based policies only] The actions to be performed when the event-based policy is activated. You can specify only one action per policy.

  • copy_tags (Union[bool, IResolvable, None]) – [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

  • create_interval (Union[int, float, None]) – [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

  • cross_region_copy_targets (Any) – [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.

  • event_source (Union[IResolvable, EventSourceProperty, Dict[str, Any], None]) – [Event-based policies only] The event that activates the event-based policy.

  • exclusions (Union[IResolvable, ExclusionsProperty, Dict[str, Any], None]) – [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.

  • extend_deletion (Union[bool, IResolvable, None]) – [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

  • parameters (Union[IResolvable, ParametersProperty, Dict[str, Any], None]) – [Custom snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies. .. 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_language (Optional[str]) – The type of policy to create. Specify one of the following:. - SIMPLIFIED To create a default policy. - STANDARD To create a custom policy.

  • policy_type (Optional[str]) – 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 .

  • resource_locations (Optional[Sequence[str]]) – [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.

  • resource_type (Optional[str]) – [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 .

  • resource_types (Optional[Sequence[str]]) – [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.

  • retain_interval (Union[int, float, None]) – [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

  • schedules (Union[IResolvable, Sequence[Union[IResolvable, ScheduleProperty, Dict[str, Any]]], None]) – [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.

  • target_tags (Union[IResolvable, Sequence[Union[IResolvable, CfnTag, Dict[str, Any]]], None]) – [Custom snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

# cross_region_copy_targets: Any
# exclude_tags: Any
# exclude_volume_types: Any

policy_details_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.PolicyDetailsProperty(
    actions=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ActionProperty(
        cross_region_copy=[dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyActionProperty(
            encryption_configuration=dlm_mixins.CfnLifecyclePolicyPropsMixin.EncryptionConfigurationProperty(
                cmk_arn="cmkArn",
                encrypted=False
            ),
            retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
                interval=123,
                interval_unit="intervalUnit"
            ),
            target="target"
        )],
        name="name"
    )],
    copy_tags=False,
    create_interval=123,
    cross_region_copy_targets=cross_region_copy_targets,
    event_source=dlm_mixins.CfnLifecyclePolicyPropsMixin.EventSourceProperty(
        parameters=dlm_mixins.CfnLifecyclePolicyPropsMixin.EventParametersProperty(
            description_regex="descriptionRegex",
            event_type="eventType",
            snapshot_owner=["snapshotOwner"]
        ),
        type="type"
    ),
    exclusions=dlm_mixins.CfnLifecyclePolicyPropsMixin.ExclusionsProperty(
        exclude_boot_volumes=False,
        exclude_tags=exclude_tags,
        exclude_volume_types=exclude_volume_types
    ),
    extend_deletion=False,
    parameters=dlm_mixins.CfnLifecyclePolicyPropsMixin.ParametersProperty(
        exclude_boot_volume=False,
        exclude_data_volume_tags=[CfnTag(
            key="key",
            value="value"
        )],
        no_reboot=False
    ),
    policy_language="policyLanguage",
    policy_type="policyType",
    resource_locations=["resourceLocations"],
    resource_type="resourceType",
    resource_types=["resourceTypes"],
    retain_interval=123,
    schedules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ScheduleProperty(
        archive_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRuleProperty(
            retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRetainRuleProperty(
                retention_archive_tier=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetentionArchiveTierProperty(
                    count=123,
                    interval=123,
                    interval_unit="intervalUnit"
                )
            )
        ),
        copy_tags=False,
        create_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CreateRuleProperty(
            cron_expression="cronExpression",
            interval=123,
            interval_unit="intervalUnit",
            location="location",
            scripts=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ScriptProperty(
                execute_operation_on_script_failure=False,
                execution_handler="executionHandler",
                execution_handler_service="executionHandlerService",
                execution_timeout=123,
                maximum_retry_count=123,
                stages=["stages"]
            )],
            times=["times"]
        ),
        cross_region_copy_rules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRuleProperty(
            cmk_arn="cmkArn",
            copy_tags=False,
            deprecate_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyDeprecateRuleProperty(
                interval=123,
                interval_unit="intervalUnit"
            ),
            encrypted=False,
            retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
                interval=123,
                interval_unit="intervalUnit"
            ),
            target="target",
            target_region="targetRegion"
        )],
        deprecate_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.DeprecateRuleProperty(
            count=123,
            interval=123,
            interval_unit="intervalUnit"
        ),
        fast_restore_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.FastRestoreRuleProperty(
            availability_zones=["availabilityZones"],
            count=123,
            interval=123,
            interval_unit="intervalUnit"
        ),
        name="name",
        retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetainRuleProperty(
            count=123,
            interval=123,
            interval_unit="intervalUnit"
        ),
        share_rules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.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

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

You can specify only one action per policy.

See:

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

copy_tags

[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

See:

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

create_interval

[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

See:

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

cross_region_copy_targets

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

See:

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

event_source

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

See:

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

exclusions

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

See:

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

extend_deletion

[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

See:

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

parameters

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

See:

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

policy_language

.

  • SIMPLIFIED To create a default policy.

  • STANDARD To create a custom policy.

See:

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

Type:

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

policy_type

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 .

See:

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

resource_locations

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

See:

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

resource_type

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

See:

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

resource_types

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

See:

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

retain_interval

[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

See:

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

schedules

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

See:

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

target_tags

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

See:

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

RetainRuleProperty

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

Bases: object

[Custom snapshot and AMI policies only] Specifies a retention rule for snapshots created by snapshot policies, or for AMIs created by AMI policies.

For snapshot policies that have an ArchiveRule , this retention rule applies to standard tier retention. When the retention threshold is met, snapshots are moved from the standard to the archive tier.

For snapshot policies that do not have an ArchiveRule , snapshots are permanently deleted when this retention threshold is met.

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

  • Count-based retention

You must specify Count . If you specify an ArchiveRule for the schedule, then you can specify a retention count of 0 to archive snapshots immediately after creation. If you specify a FastRestoreRule , ShareRule , or a CrossRegionCopyRule , then you must specify a retention count of 1 or more.

  • Age-based retention

You must specify Interval and IntervalUnit . If you specify an ArchiveRule for the schedule, then you can specify a retention interval of 0 days to archive snapshots immediately after creation. If you specify a FastRestoreRule , ShareRule , or a CrossRegionCopyRule , then you must specify a retention interval of 1 day or more.

Parameters:
  • count (Union[int, float, None]) –

    The number of snapshots to retain for each volume, up to a maximum of 1000. For example if you want to retain a maximum of three snapshots, specify 3 . When the fourth snapshot is created, the oldest retained snapshot is deleted, or it is moved to the archive tier if you have specified an ArchiveRule .

  • 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. For example, to retain snapshots for 3 months, specify Interval=3 and IntervalUnit=MONTHS . Once the snapshot has been retained for 3 months, it is deleted, or it is moved to the archive tier if you have specified an ArchiveRule .

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

retain_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.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.

For example if you want to retain a maximum of three snapshots, specify 3 . When the fourth snapshot is created, the oldest retained snapshot is deleted, or it is moved to the archive tier if you have specified an ArchiveRule .

See:

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

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.

See:

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

interval_unit

The unit of time for time-based retention.

For example, to retain snapshots for 3 months, specify Interval=3 and IntervalUnit=MONTHS . Once the snapshot has been retained for 3 months, it is deleted, or it is moved to the archive tier if you have specified an ArchiveRule .

See:

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

RetentionArchiveTierProperty

class CfnLifecyclePolicyPropsMixin.RetentionArchiveTierProperty(*, count=None, interval=None, interval_unit=None)

Bases: object

[Custom snapshot policies only] Describes the retention rule for archived snapshots.

Once the archive retention threshold is met, the snapshots are permanently deleted from the archive tier. .. epigraph:

The archive retention rule must retain snapshots in the archive tier for a minimum of 90 days.

For count-based schedules , you must specify Count . For age-based schedules , you must specify Interval and IntervalUnit .

For more information about using snapshot archiving, see Considerations for snapshot lifecycle policies .

Parameters:
  • count (Union[int, float, None]) – The maximum number of snapshots to retain in the archive storage tier for each volume. The count must ensure that each snapshot remains in the archive tier for at least 90 days. For example, if the schedule creates snapshots every 30 days, you must specify a count of 3 or more to ensure that each snapshot is archived for at least 90 days.

  • interval (Union[int, float, None]) – Specifies the period of time to retain snapshots in the archive tier. After this period expires, the snapshot is permanently deleted.

  • interval_unit (Optional[str]) – The unit of time in which to measure the Interval . For example, to retain a snapshots in the archive tier for 6 months, specify Interval=6 and IntervalUnit=MONTHS .

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

retention_archive_tier_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.RetentionArchiveTierProperty(
    count=123,
    interval=123,
    interval_unit="intervalUnit"
)

Attributes

count

The maximum number of snapshots to retain in the archive storage tier for each volume.

The count must ensure that each snapshot remains in the archive tier for at least 90 days. For example, if the schedule creates snapshots every 30 days, you must specify a count of 3 or more to ensure that each snapshot is archived for at least 90 days.

See:

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

interval

Specifies the period of time to retain snapshots in the archive tier.

After this period expires, the snapshot is permanently deleted.

See:

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

interval_unit

The unit of time in which to measure the Interval .

For example, to retain a snapshots in the archive tier for 6 months, specify Interval=6 and IntervalUnit=MONTHS .

See:

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

ScheduleProperty

class CfnLifecyclePolicyPropsMixin.ScheduleProperty(*, archive_rule=None, 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

[Custom snapshot and AMI policies only] Specifies a schedule for a snapshot or AMI lifecycle policy.

Parameters:
  • archive_rule (Union[IResolvable, ArchiveRuleProperty, Dict[str, Any], None]) –

    [Custom snapshot policies that target volumes only] The snapshot archiving rule for the schedule. When you specify an archiving rule, snapshots are automatically moved from the standard tier to the archive tier once the schedule’s retention threshold is met. Snapshots are then retained in the archive tier for the archive retention period that you specify. For more information about using snapshot archiving, see Considerations for snapshot lifecycle policies .

  • 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, Dict[str, Any], None]) – The creation rule.

  • cross_region_copy_rules (Union[IResolvable, Sequence[Union[IResolvable, CrossRegionCopyRuleProperty, Dict[str, Any]]], None]) – Specifies a rule for copying snapshots or AMIs across Regions. .. epigraph:: You can’t specify cross-Region copy rules for policies that create snapshots on an Outpost or in a Local Zone. 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, Dict[str, Any], None]) – [Custom AMI policies only] The AMI deprecation rule for the schedule.

  • fast_restore_rule (Union[IResolvable, FastRestoreRuleProperty, Dict[str, Any], None]) – [Custom snapshot policies only] The rule for enabling fast snapshot restore.

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

  • retain_rule (Union[IResolvable, RetainRuleProperty, Dict[str, Any], None]) – The retention rule for snapshots or AMIs created by the policy.

  • share_rules (Union[IResolvable, Sequence[Union[IResolvable, ShareRuleProperty, Dict[str, Any]]], None]) – [Custom snapshot policies only] The rule for sharing snapshots with other AWS accounts .

  • tags_to_add (Union[IResolvable, Sequence[Union[IResolvable, CfnTag, Dict[str, Any]]], 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, Dict[str, Any]]], None]) – [AMI policies and snapshot policies that target instances only] 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.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

schedule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.ScheduleProperty(
    archive_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRuleProperty(
        retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.ArchiveRetainRuleProperty(
            retention_archive_tier=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetentionArchiveTierProperty(
                count=123,
                interval=123,
                interval_unit="intervalUnit"
            )
        )
    ),
    copy_tags=False,
    create_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CreateRuleProperty(
        cron_expression="cronExpression",
        interval=123,
        interval_unit="intervalUnit",
        location="location",
        scripts=[dlm_mixins.CfnLifecyclePolicyPropsMixin.ScriptProperty(
            execute_operation_on_script_failure=False,
            execution_handler="executionHandler",
            execution_handler_service="executionHandlerService",
            execution_timeout=123,
            maximum_retry_count=123,
            stages=["stages"]
        )],
        times=["times"]
    ),
    cross_region_copy_rules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRuleProperty(
        cmk_arn="cmkArn",
        copy_tags=False,
        deprecate_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyDeprecateRuleProperty(
            interval=123,
            interval_unit="intervalUnit"
        ),
        encrypted=False,
        retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.CrossRegionCopyRetainRuleProperty(
            interval=123,
            interval_unit="intervalUnit"
        ),
        target="target",
        target_region="targetRegion"
    )],
    deprecate_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.DeprecateRuleProperty(
        count=123,
        interval=123,
        interval_unit="intervalUnit"
    ),
    fast_restore_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.FastRestoreRuleProperty(
        availability_zones=["availabilityZones"],
        count=123,
        interval=123,
        interval_unit="intervalUnit"
    ),
    name="name",
    retain_rule=dlm_mixins.CfnLifecyclePolicyPropsMixin.RetainRuleProperty(
        count=123,
        interval=123,
        interval_unit="intervalUnit"
    ),
    share_rules=[dlm_mixins.CfnLifecyclePolicyPropsMixin.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

archive_rule

[Custom snapshot policies that target volumes only] The snapshot archiving rule for the schedule.

When you specify an archiving rule, snapshots are automatically moved from the standard tier to the archive tier once the schedule’s retention threshold is met. Snapshots are then retained in the archive tier for the archive retention period that you specify.

For more information about using snapshot archiving, see Considerations for snapshot lifecycle policies .

See:

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

copy_tags

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

See:

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

create_rule

The creation rule.

See:

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

cross_region_copy_rules

Specifies a rule for copying snapshots or AMIs across Regions.

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

See:

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

deprecate_rule

[Custom AMI policies only] The AMI deprecation rule for the schedule.

See:

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

fast_restore_rule

[Custom snapshot policies only] The rule for enabling fast snapshot restore.

See:

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

name

The name of the schedule.

See:

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

retain_rule

The retention rule for snapshots or AMIs created by the policy.

See:

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

share_rules

[Custom snapshot policies only] The rule for sharing snapshots with other AWS accounts .

See:

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

tags_to_add

The tags to apply to policy-created resources.

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

See:

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

variable_tags

[AMI policies and snapshot policies that target instances only] 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.

See:

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

ScriptProperty

class CfnLifecyclePolicyPropsMixin.ScriptProperty(*, execute_operation_on_script_failure=None, execution_handler=None, execution_handler_service=None, execution_timeout=None, maximum_retry_count=None, stages=None)

Bases: object

[Custom snapshot policies that target instances only] Information about pre and/or post scripts for a snapshot lifecycle policy that targets instances.

For more information, see Automating application-consistent snapshots with pre and post scripts .

Parameters:
  • execute_operation_on_script_failure (Union[bool, IResolvable, None]) – Indicates whether Amazon Data Lifecycle Manager should default to crash-consistent snapshots if the pre script fails. - To default to crash consistent snapshot if the pre script fails, specify true . - To skip the instance for snapshot creation if the pre script fails, specify false . This parameter is supported only if you run a pre script. If you run a post script only, omit this parameter. Default: true

  • execution_handler (Optional[str]) – The SSM document that includes the pre and/or post scripts to run. - If you are automating VSS backups, specify AWS_VSS_BACKUP . In this case, Amazon Data Lifecycle Manager automatically uses the AWSEC2-CreateVssSnapshot SSM document. - If you are automating application-consistent snapshots for SAP HANA workloads, specify AWSSystemsManagerSAP-CreateDLMSnapshotForSAPHANA . - If you are using a custom SSM document that you own, specify either the name or ARN of the SSM document. If you are using a custom SSM document that is shared with you, specify the ARN of the SSM document.

  • execution_handler_service (Optional[str]) – Indicates the service used to execute the pre and/or post scripts. - If you are using custom SSM documents or automating application-consistent snapshots of SAP HANA workloads, specify AWS_SYSTEMS_MANAGER . - If you are automating VSS Backups, omit this parameter. Default: AWS_SYSTEMS_MANAGER

  • execution_timeout (Union[int, float, None]) – Specifies a timeout period, in seconds, after which Amazon Data Lifecycle Manager fails the script run attempt if it has not completed. If a script does not complete within its timeout period, Amazon Data Lifecycle Manager fails the attempt. The timeout period applies to the pre and post scripts individually. If you are automating VSS Backups, omit this parameter. Default: 10

  • maximum_retry_count (Union[int, float, None]) – Specifies the number of times Amazon Data Lifecycle Manager should retry scripts that fail. - If the pre script fails, Amazon Data Lifecycle Manager retries the entire snapshot creation process, including running the pre and post scripts. - If the post script fails, Amazon Data Lifecycle Manager retries the post script only; in this case, the pre script will have completed and the snapshot might have been created. If you do not want Amazon Data Lifecycle Manager to retry failed scripts, specify 0 . Default: 0

  • stages (Optional[Sequence[str]]) – Indicate which scripts Amazon Data Lifecycle Manager should run on target instances. Pre scripts run before Amazon Data Lifecycle Manager initiates snapshot creation. Post scripts run after Amazon Data Lifecycle Manager initiates snapshot creation. - To run a pre script only, specify PRE . In this case, Amazon Data Lifecycle Manager calls the SSM document with the pre-script parameter before initiating snapshot creation. - To run a post script only, specify POST . In this case, Amazon Data Lifecycle Manager calls the SSM document with the post-script parameter after initiating snapshot creation. - To run both pre and post scripts, specify both PRE and POST . In this case, Amazon Data Lifecycle Manager calls the SSM document with the pre-script parameter before initiating snapshot creation, and then it calls the SSM document again with the post-script parameter after initiating snapshot creation. If you are automating VSS Backups, omit this parameter. Default: PRE and POST

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

script_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.ScriptProperty(
    execute_operation_on_script_failure=False,
    execution_handler="executionHandler",
    execution_handler_service="executionHandlerService",
    execution_timeout=123,
    maximum_retry_count=123,
    stages=["stages"]
)

Attributes

execute_operation_on_script_failure

Indicates whether Amazon Data Lifecycle Manager should default to crash-consistent snapshots if the pre script fails.

  • To default to crash consistent snapshot if the pre script fails, specify true .

  • To skip the instance for snapshot creation if the pre script fails, specify false .

This parameter is supported only if you run a pre script. If you run a post script only, omit this parameter.

Default: true

See:

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

execution_handler

The SSM document that includes the pre and/or post scripts to run.

  • If you are automating VSS backups, specify AWS_VSS_BACKUP . In this case, Amazon Data Lifecycle Manager automatically uses the AWSEC2-CreateVssSnapshot SSM document.

  • If you are automating application-consistent snapshots for SAP HANA workloads, specify AWSSystemsManagerSAP-CreateDLMSnapshotForSAPHANA .

  • If you are using a custom SSM document that you own, specify either the name or ARN of the SSM document. If you are using a custom SSM document that is shared with you, specify the ARN of the SSM document.

See:

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

execution_handler_service

Indicates the service used to execute the pre and/or post scripts.

  • If you are using custom SSM documents or automating application-consistent snapshots of SAP HANA workloads, specify AWS_SYSTEMS_MANAGER .

  • If you are automating VSS Backups, omit this parameter.

Default: AWS_SYSTEMS_MANAGER

See:

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

execution_timeout

Specifies a timeout period, in seconds, after which Amazon Data Lifecycle Manager fails the script run attempt if it has not completed.

If a script does not complete within its timeout period, Amazon Data Lifecycle Manager fails the attempt. The timeout period applies to the pre and post scripts individually.

If you are automating VSS Backups, omit this parameter.

Default: 10

See:

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

maximum_retry_count

Specifies the number of times Amazon Data Lifecycle Manager should retry scripts that fail.

  • If the pre script fails, Amazon Data Lifecycle Manager retries the entire snapshot creation process, including running the pre and post scripts.

  • If the post script fails, Amazon Data Lifecycle Manager retries the post script only; in this case, the pre script will have completed and the snapshot might have been created.

If you do not want Amazon Data Lifecycle Manager to retry failed scripts, specify 0 .

Default: 0

See:

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

stages

Indicate which scripts Amazon Data Lifecycle Manager should run on target instances.

Pre scripts run before Amazon Data Lifecycle Manager initiates snapshot creation. Post scripts run after Amazon Data Lifecycle Manager initiates snapshot creation.

  • To run a pre script only, specify PRE . In this case, Amazon Data Lifecycle Manager calls the SSM document with the pre-script parameter before initiating snapshot creation.

  • To run a post script only, specify POST . In this case, Amazon Data Lifecycle Manager calls the SSM document with the post-script parameter after initiating snapshot creation.

  • To run both pre and post scripts, specify both PRE and POST . In this case, Amazon Data Lifecycle Manager calls the SSM document with the pre-script parameter before initiating snapshot creation, and then it calls the SSM document again with the post-script parameter after initiating snapshot creation.

If you are automating VSS Backups, omit this parameter.

Default: PRE and POST

See:

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

ShareRuleProperty

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

Bases: object

[Custom snapshot policies only] 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.

See:

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.
from aws_cdk.mixins_preview.aws_dlm import mixins as dlm_mixins

share_rule_property = dlm_mixins.CfnLifecyclePolicyPropsMixin.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.

See:

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

unshare_interval

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

See:

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

unshare_interval_unit

The unit of time for the automatic unsharing interval.

See:

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