AWS::DLM::LifecyclePolicy - AWS CloudFormation

AWS::DLM::LifecyclePolicy

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

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

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::DLM::LifecyclePolicy", "Properties" : { "Description" : String, "ExecutionRoleArn" : String, "PolicyDetails" : PolicyDetails, "State" : String } }

YAML

Type: AWS::DLM::LifecyclePolicy Properties: Description: String ExecutionRoleArn: String PolicyDetails: PolicyDetails State: String

Properties

Description

A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$ are supported.

Required: Conditional

Type: String

Minimum: 0

Maximum: 500

Pattern: [0-9A-Za-z _-]+

Update requires: No interruption

ExecutionRoleArn

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

Required: Conditional

Type: String

Minimum: 0

Maximum: 2048

Pattern: arn:aws:iam::\d+:role/.*

Update requires: No interruption

PolicyDetails

The configuration details of the lifecycle policy.

Required: Conditional

Type: PolicyDetails

Update requires: No interruption

State

The activation state of the lifecycle policy.

Required: Conditional

Type: String

Allowed Values: DISABLED | ENABLED | ERROR

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the lifecycle policy.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

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

Examples

Creating a Lifecycle Policy

The following example demonstrates how to create a basic lifecycle policy.

YAML

Description: "Basic LifecyclePolicy" Resources: BasicLifecyclePolicy: Type: "AWS::DLM::LifecyclePolicy" Properties: Description: "Lifecycle Policy using CloudFormation" State: "ENABLED" ExecutionRoleArn: "arn:aws:iam::123456789012:role/AWSDataLifecycleManagerDefaultRole" PolicyDetails: ResourceTypes: - "VOLUME" TargetTags: - Key: "costcenter" Value: "115" Schedules: - Name: "Daily Snapshots" TagsToAdd: - Key: "type" Value: "DailySnapshot" CreateRule: Interval: 12 IntervalUnit: "HOURS" Times: - "13:00" RetainRule: Count: 1 CopyTags: true

JSON

{ "Description": "Basic LifecyclePolicy", "Resources": { "BasicLifecyclePolicy": { "Type": "AWS::DLM::LifecyclePolicy", "Properties": { "Description": "Lifecycle Policy using CloudFormation", "State": "ENABLED", "ExecutionRoleArn": "arn:aws:iam::123456789012:role/AWSDataLifecycleManagerDefaultRole", "PolicyDetails": { "ResourceTypes": [ "VOLUME" ], "TargetTags": [ { "Key": "costcenter", "Value": "115" } ], "Schedules": [ { "Name": "Daily Snapshots", "TagsToAdd": [ { "Key": "type", "Value": "DailySnapshot" } ], "CreateRule": { "Interval": 12, "IntervalUnit": "HOURS", "Times": [ "13:00" ] }, "RetainRule": { "Count": 1 }, "CopyTags": true } ] } } } }

See Also