AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::DLM::LifecyclePolicy

The AWS::DLM::LifecyclePolicy resource creates a lifecycle policy for Amazon Data Lifecycle Manager. For more information, see Automating the Amazon EBS Snapshot Lifecycle in the Amazon EC2 User Guide for Linux Instances and CreateLifecyclePolicy in the Amazon Data Lifecycle Manager API Reference.

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

The description of the lifecycle policy.

Required: No

Type: String

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: Yes

Type: String

Update requires: No interruption

PolicyDetails

The configuration of the lifecycle policy.

Required: No

Type: PolicyDetails

Update requires: No interruption

State

The activation state of the lifecycle policy.

Required: Yes

Type: String

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of an AWS::DLM::LifecyclePolicy resource to the intrinsic Ref function, the function returns the policy ID, such as policy-0123456789abcdef0.

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

Fn::GetAtt

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

Arn

The Amazon Resource Name (ARN) of the policy, such as arn:aws:dlm:us-west-2:012345678912:policy/policy-0123456789abcdef.

For more information about using Fn::GetAtt, see Fn::GetAtt.

Examples

Creating a Lifecycle Policy

The following example illustrates the creation of a basic lifecycle policy.

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 } ] } } } }

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

See Also