Amazon Data Lifecycle Manager
API Reference (API Version 2018-01-12)

CreateLifecyclePolicy

Creates a policy to manage the lifecycle of the specified AWS resources. You can create up to 100 lifecycle policies.

Request Syntax

POST /policies HTTP/1.1 Content-type: application/json { "Description": "string", "ExecutionRoleArn": "string", "PolicyDetails": { "Parameters": { "ExcludeBootVolume": boolean }, "PolicyType": "string", "ResourceTypes": [ "string" ], "Schedules": [ { "CopyTags": boolean, "CreateRule": { "Interval": number, "IntervalUnit": "string", "Times": [ "string" ] }, "Name": "string", "RetainRule": { "Count": number }, "TagsToAdd": [ { "Key": "string", "Value": "string" } ], "VariableTags": [ { "Key": "string", "Value": "string" } ] } ], "TargetTags": [ { "Key": "string", "Value": "string" } ] }, "State": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

Description

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

Type: String

Length Constraints: Minimum length of 0. Maximum length of 500.

Required: Yes

ExecutionRoleArn

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

Type: String

Required: Yes

PolicyDetails

The configuration details of the lifecycle policy.

Target tags cannot be re-used across lifecycle policies.

Type: PolicyDetails object

Required: Yes

State

The desired activation state of the lifecycle policy after creation.

Type: String

Valid Values: ENABLED | DISABLED

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "PolicyId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

PolicyId

The identifier of the lifecycle policy.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerException

The service failed in an unexpected way.

HTTP Status Code: 500

InvalidRequestException

Bad request. The request is missing required parameters or has invalid parameters.

HTTP Status Code: 400

LimitExceededException

The request failed because a limit was exceeded.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: