Module dlm

This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

Resources

Others

Resources

Resource LifecyclePolicy

class LifecyclePolicy extends CustomResource

Provides a Data Lifecycle Manager (DLM) lifecycle policy for managing snapshots.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const dlmLifecycleRole = new aws.iam.Role("dlm_lifecycle_role", {
    assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "dlm.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`,
});
const dlmLifecycle = new aws.iam.RolePolicy("dlm_lifecycle", {
    policy: `{
   "Version": "2012-10-17",
   "Statement": [
      {
         "Effect": "Allow",
         "Action": [
            "ec2:CreateSnapshot",
            "ec2:DeleteSnapshot",
            "ec2:DescribeVolumes",
            "ec2:DescribeSnapshots"
         ],
         "Resource": "*"
      },
      {
         "Effect": "Allow",
         "Action": [
            "ec2:CreateTags"
         ],
         "Resource": "arn:aws:ec2:*::snapshot/*"
      }
   ]
}
`,
    role: dlmLifecycleRole.id,
});
const example = new aws.dlm.LifecyclePolicy("example", {
    description: "example DLM lifecycle policy",
    executionRoleArn: dlmLifecycleRole.arn,
    policyDetails: {
        resourceTypes: ["VOLUME"],
        schedules: [{
            copyTags: false,
            createRule: {
                interval: 24,
                intervalUnit: "HOURS",
                times: "23:45",
            },
            name: "2 weeks of daily snapshots",
            retainRule: {
                count: 14,
            },
            tagsToAdd: {
                SnapshotCreator: "DLM",
            },
        }],
        targetTags: {
            Snapshot: "true",
        },
    },
    state: "ENABLED",
});

constructor

new LifecyclePolicy(name: string, args: LifecyclePolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a LifecyclePolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LifecyclePolicyState, opts?: pulumi.CustomResourceOptions): LifecyclePolicy

Get an existing LifecyclePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is LifecyclePolicy

Returns true if the given object is an instance of LifecyclePolicy. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

Amazon Resource Name (ARN) of the DLM Lifecycle Policy.

property description

public description: pulumi.Output<string>;

A description for the DLM lifecycle policy.

property executionRoleArn

public executionRoleArn: pulumi.Output<string>;

The ARN of an IAM role that is able to be assumed by the DLM service.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property policyDetails

public policyDetails: pulumi.Output<LifecyclePolicyPolicyDetails>;

See the policyDetails configuration block. Max of 1.

property state

public state: pulumi.Output<string | undefined>;

Whether the lifecycle policy should be enabled or disabled. ENABLED or DISABLED are valid values. Defaults to ENABLED.

property tags

public tags: pulumi.Output<{[key: string]: any} | undefined>;

Key-value map of resource tags.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Others

interface LifecyclePolicyArgs

interface LifecyclePolicyArgs

The set of arguments for constructing a LifecyclePolicy resource.

property description

description: pulumi.Input<string>;

A description for the DLM lifecycle policy.

property executionRoleArn

executionRoleArn: pulumi.Input<string>;

The ARN of an IAM role that is able to be assumed by the DLM service.

property policyDetails

policyDetails: pulumi.Input<LifecyclePolicyPolicyDetails>;

See the policyDetails configuration block. Max of 1.

property state

state?: pulumi.Input<string>;

Whether the lifecycle policy should be enabled or disabled. ENABLED or DISABLED are valid values. Defaults to ENABLED.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value map of resource tags.

interface LifecyclePolicyState

interface LifecyclePolicyState

Input properties used for looking up and filtering LifecyclePolicy resources.

property arn

arn?: pulumi.Input<string>;

Amazon Resource Name (ARN) of the DLM Lifecycle Policy.

property description

description?: pulumi.Input<string>;

A description for the DLM lifecycle policy.

property executionRoleArn

executionRoleArn?: pulumi.Input<string>;

The ARN of an IAM role that is able to be assumed by the DLM service.

property policyDetails

policyDetails?: pulumi.Input<LifecyclePolicyPolicyDetails>;

See the policyDetails configuration block. Max of 1.

property state

state?: pulumi.Input<string>;

Whether the lifecycle policy should be enabled or disabled. ENABLED or DISABLED are valid values. Defaults to ENABLED.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value map of resource tags.