aws.dlm.LifecyclePolicy
Explore with Pulumi AI
Provides a Data Lifecycle Manager (DLM) lifecycle policy for managing snapshots.
Example Usage
Basic
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const assumeRole = aws.iam.getPolicyDocument({
statements: [{
effect: "Allow",
principals: [{
type: "Service",
identifiers: ["dlm.amazonaws.com"],
}],
actions: ["sts:AssumeRole"],
}],
});
const dlmLifecycleRole = new aws.iam.Role("dlm_lifecycle_role", {
name: "dlm-lifecycle-role",
assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json),
});
const dlmLifecycle = aws.iam.getPolicyDocument({
statements: [
{
effect: "Allow",
actions: [
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
"ec2:DeleteSnapshot",
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
],
resources: ["*"],
},
{
effect: "Allow",
actions: ["ec2:CreateTags"],
resources: ["arn:aws:ec2:*::snapshot/*"],
},
],
});
const dlmLifecycleRolePolicy = new aws.iam.RolePolicy("dlm_lifecycle", {
name: "dlm-lifecycle-policy",
role: dlmLifecycleRole.id,
policy: dlmLifecycle.then(dlmLifecycle => dlmLifecycle.json),
});
const example = new aws.dlm.LifecyclePolicy("example", {
description: "example DLM lifecycle policy",
executionRoleArn: dlmLifecycleRole.arn,
state: "ENABLED",
policyDetails: {
resourceTypes: "VOLUME",
schedules: [{
name: "2 weeks of daily snapshots",
createRule: {
interval: 24,
intervalUnit: "HOURS",
times: "23:45",
},
retainRule: {
count: 14,
},
tagsToAdd: {
SnapshotCreator: "DLM",
},
copyTags: false,
}],
targetTags: {
Snapshot: "true",
},
},
});
import pulumi
import pulumi_aws as aws
assume_role = aws.iam.get_policy_document(statements=[{
"effect": "Allow",
"principals": [{
"type": "Service",
"identifiers": ["dlm.amazonaws.com"],
}],
"actions": ["sts:AssumeRole"],
}])
dlm_lifecycle_role = aws.iam.Role("dlm_lifecycle_role",
name="dlm-lifecycle-role",
assume_role_policy=assume_role.json)
dlm_lifecycle = aws.iam.get_policy_document(statements=[
{
"effect": "Allow",
"actions": [
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
"ec2:DeleteSnapshot",
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
],
"resources": ["*"],
},
{
"effect": "Allow",
"actions": ["ec2:CreateTags"],
"resources": ["arn:aws:ec2:*::snapshot/*"],
},
])
dlm_lifecycle_role_policy = aws.iam.RolePolicy("dlm_lifecycle",
name="dlm-lifecycle-policy",
role=dlm_lifecycle_role.id,
policy=dlm_lifecycle.json)
example = aws.dlm.LifecyclePolicy("example",
description="example DLM lifecycle policy",
execution_role_arn=dlm_lifecycle_role.arn,
state="ENABLED",
policy_details={
"resource_types": "VOLUME",
"schedules": [{
"name": "2 weeks of daily snapshots",
"create_rule": {
"interval": 24,
"interval_unit": "HOURS",
"times": "23:45",
},
"retain_rule": {
"count": 14,
},
"tags_to_add": {
"snapshot_creator": "DLM",
},
"copy_tags": False,
}],
"target_tags": {
"snapshot": "true",
},
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/dlm"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Effect: pulumi.StringRef("Allow"),
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "Service",
Identifiers: []string{
"dlm.amazonaws.com",
},
},
},
Actions: []string{
"sts:AssumeRole",
},
},
},
}, nil)
if err != nil {
return err
}
dlmLifecycleRole, err := iam.NewRole(ctx, "dlm_lifecycle_role", &iam.RoleArgs{
Name: pulumi.String("dlm-lifecycle-role"),
AssumeRolePolicy: pulumi.String(assumeRole.Json),
})
if err != nil {
return err
}
dlmLifecycle, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Effect: pulumi.StringRef("Allow"),
Actions: []string{
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
"ec2:DeleteSnapshot",
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
},
Resources: []string{
"*",
},
},
{
Effect: pulumi.StringRef("Allow"),
Actions: []string{
"ec2:CreateTags",
},
Resources: []string{
"arn:aws:ec2:*::snapshot/*",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = iam.NewRolePolicy(ctx, "dlm_lifecycle", &iam.RolePolicyArgs{
Name: pulumi.String("dlm-lifecycle-policy"),
Role: dlmLifecycleRole.ID(),
Policy: pulumi.String(dlmLifecycle.Json),
})
if err != nil {
return err
}
_, err = dlm.NewLifecyclePolicy(ctx, "example", &dlm.LifecyclePolicyArgs{
Description: pulumi.String("example DLM lifecycle policy"),
ExecutionRoleArn: dlmLifecycleRole.Arn,
State: pulumi.String("ENABLED"),
PolicyDetails: &dlm.LifecyclePolicyPolicyDetailsArgs{
ResourceTypes: pulumi.StringArray("VOLUME"),
Schedules: dlm.LifecyclePolicyPolicyDetailsScheduleArray{
&dlm.LifecyclePolicyPolicyDetailsScheduleArgs{
Name: pulumi.String("2 weeks of daily snapshots"),
CreateRule: &dlm.LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs{
Interval: pulumi.Int(24),
IntervalUnit: pulumi.String("HOURS"),
Times: pulumi.String("23:45"),
},
RetainRule: &dlm.LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs{
Count: pulumi.Int(14),
},
TagsToAdd: pulumi.StringMap{
"SnapshotCreator": pulumi.String("DLM"),
},
CopyTags: pulumi.Bool(false),
},
},
TargetTags: pulumi.StringMap{
"Snapshot": pulumi.String("true"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var assumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Effect = "Allow",
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "Service",
Identifiers = new[]
{
"dlm.amazonaws.com",
},
},
},
Actions = new[]
{
"sts:AssumeRole",
},
},
},
});
var dlmLifecycleRole = new Aws.Iam.Role("dlm_lifecycle_role", new()
{
Name = "dlm-lifecycle-role",
AssumeRolePolicy = assumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
var dlmLifecycle = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Effect = "Allow",
Actions = new[]
{
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
"ec2:DeleteSnapshot",
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
},
Resources = new[]
{
"*",
},
},
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Effect = "Allow",
Actions = new[]
{
"ec2:CreateTags",
},
Resources = new[]
{
"arn:aws:ec2:*::snapshot/*",
},
},
},
});
var dlmLifecycleRolePolicy = new Aws.Iam.RolePolicy("dlm_lifecycle", new()
{
Name = "dlm-lifecycle-policy",
Role = dlmLifecycleRole.Id,
Policy = dlmLifecycle.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
var example = new Aws.Dlm.LifecyclePolicy("example", new()
{
Description = "example DLM lifecycle policy",
ExecutionRoleArn = dlmLifecycleRole.Arn,
State = "ENABLED",
PolicyDetails = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsArgs
{
ResourceTypes = "VOLUME",
Schedules = new[]
{
new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleArgs
{
Name = "2 weeks of daily snapshots",
CreateRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs
{
Interval = 24,
IntervalUnit = "HOURS",
Times = "23:45",
},
RetainRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs
{
Count = 14,
},
TagsToAdd =
{
{ "SnapshotCreator", "DLM" },
},
CopyTags = false,
},
},
TargetTags =
{
{ "Snapshot", "true" },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
import com.pulumi.aws.dlm.LifecyclePolicy;
import com.pulumi.aws.dlm.LifecyclePolicyArgs;
import com.pulumi.aws.dlm.inputs.LifecyclePolicyPolicyDetailsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("dlm.amazonaws.com")
.build())
.actions("sts:AssumeRole")
.build())
.build());
var dlmLifecycleRole = new Role("dlmLifecycleRole", RoleArgs.builder()
.name("dlm-lifecycle-role")
.assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
final var dlmLifecycle = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(
GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.actions(
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
"ec2:DeleteSnapshot",
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots")
.resources("*")
.build(),
GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.actions("ec2:CreateTags")
.resources("arn:aws:ec2:*::snapshot/*")
.build())
.build());
var dlmLifecycleRolePolicy = new RolePolicy("dlmLifecycleRolePolicy", RolePolicyArgs.builder()
.name("dlm-lifecycle-policy")
.role(dlmLifecycleRole.id())
.policy(dlmLifecycle.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var example = new LifecyclePolicy("example", LifecyclePolicyArgs.builder()
.description("example DLM lifecycle policy")
.executionRoleArn(dlmLifecycleRole.arn())
.state("ENABLED")
.policyDetails(LifecyclePolicyPolicyDetailsArgs.builder()
.resourceTypes("VOLUME")
.schedules(LifecyclePolicyPolicyDetailsScheduleArgs.builder()
.name("2 weeks of daily snapshots")
.createRule(LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs.builder()
.interval(24)
.intervalUnit("HOURS")
.times("23:45")
.build())
.retainRule(LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs.builder()
.count(14)
.build())
.tagsToAdd(Map.of("SnapshotCreator", "DLM"))
.copyTags(false)
.build())
.targetTags(Map.of("Snapshot", "true"))
.build())
.build());
}
}
resources:
dlmLifecycleRole:
type: aws:iam:Role
name: dlm_lifecycle_role
properties:
name: dlm-lifecycle-role
assumeRolePolicy: ${assumeRole.json}
dlmLifecycleRolePolicy:
type: aws:iam:RolePolicy
name: dlm_lifecycle
properties:
name: dlm-lifecycle-policy
role: ${dlmLifecycleRole.id}
policy: ${dlmLifecycle.json}
example:
type: aws:dlm:LifecyclePolicy
properties:
description: example DLM lifecycle policy
executionRoleArn: ${dlmLifecycleRole.arn}
state: ENABLED
policyDetails:
resourceTypes: VOLUME
schedules:
- name: 2 weeks of daily snapshots
createRule:
interval: 24
intervalUnit: HOURS
times: 23:45
retainRule:
count: 14
tagsToAdd:
SnapshotCreator: DLM
copyTags: false
targetTags:
Snapshot: 'true'
variables:
assumeRole:
fn::invoke:
Function: aws:iam:getPolicyDocument
Arguments:
statements:
- effect: Allow
principals:
- type: Service
identifiers:
- dlm.amazonaws.com
actions:
- sts:AssumeRole
dlmLifecycle:
fn::invoke:
Function: aws:iam:getPolicyDocument
Arguments:
statements:
- effect: Allow
actions:
- ec2:CreateSnapshot
- ec2:CreateSnapshots
- ec2:DeleteSnapshot
- ec2:DescribeInstances
- ec2:DescribeVolumes
- ec2:DescribeSnapshots
resources:
- '*'
- effect: Allow
actions:
- ec2:CreateTags
resources:
- arn:aws:ec2:*::snapshot/*
Example Cross-Region Snapshot Copy Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// ...other configuration...
const current = aws.getCallerIdentity({});
const key = current.then(current => aws.iam.getPolicyDocument({
statements: [{
sid: "Enable IAM User Permissions",
effect: "Allow",
principals: [{
type: "AWS",
identifiers: [`arn:aws:iam::${current.accountId}:root`],
}],
actions: ["kms:*"],
resources: ["*"],
}],
}));
const dlmCrossRegionCopyCmk = new aws.kms.Key("dlm_cross_region_copy_cmk", {
description: "Example Alternate Region KMS Key",
policy: key.then(key => key.json),
});
const example = new aws.dlm.LifecyclePolicy("example", {
description: "example DLM lifecycle policy",
executionRoleArn: dlmLifecycleRole.arn,
state: "ENABLED",
policyDetails: {
resourceTypes: "VOLUME",
schedules: [{
name: "2 weeks of daily snapshots",
createRule: {
interval: 24,
intervalUnit: "HOURS",
times: "23:45",
},
retainRule: {
count: 14,
},
tagsToAdd: {
SnapshotCreator: "DLM",
},
copyTags: false,
crossRegionCopyRules: [{
target: "us-west-2",
encrypted: true,
cmkArn: dlmCrossRegionCopyCmk.arn,
copyTags: true,
retainRule: {
interval: 30,
intervalUnit: "DAYS",
},
}],
}],
targetTags: {
Snapshot: "true",
},
},
});
import pulumi
import pulumi_aws as aws
# ...other configuration...
current = aws.get_caller_identity()
key = aws.iam.get_policy_document(statements=[{
"sid": "Enable IAM User Permissions",
"effect": "Allow",
"principals": [{
"type": "AWS",
"identifiers": [f"arn:aws:iam::{current.account_id}:root"],
}],
"actions": ["kms:*"],
"resources": ["*"],
}])
dlm_cross_region_copy_cmk = aws.kms.Key("dlm_cross_region_copy_cmk",
description="Example Alternate Region KMS Key",
policy=key.json)
example = aws.dlm.LifecyclePolicy("example",
description="example DLM lifecycle policy",
execution_role_arn=dlm_lifecycle_role["arn"],
state="ENABLED",
policy_details={
"resource_types": "VOLUME",
"schedules": [{
"name": "2 weeks of daily snapshots",
"create_rule": {
"interval": 24,
"interval_unit": "HOURS",
"times": "23:45",
},
"retain_rule": {
"count": 14,
},
"tags_to_add": {
"snapshot_creator": "DLM",
},
"copy_tags": False,
"cross_region_copy_rules": [{
"target": "us-west-2",
"encrypted": True,
"cmk_arn": dlm_cross_region_copy_cmk.arn,
"copy_tags": True,
"retain_rule": {
"interval": 30,
"interval_unit": "DAYS",
},
}],
}],
"target_tags": {
"snapshot": "true",
},
})
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/dlm"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// ...other configuration...
current, err := aws.GetCallerIdentity(ctx, nil, nil)
if err != nil {
return err
}
key, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Sid: pulumi.StringRef("Enable IAM User Permissions"),
Effect: pulumi.StringRef("Allow"),
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "AWS",
Identifiers: []string{
fmt.Sprintf("arn:aws:iam::%v:root", current.AccountId),
},
},
},
Actions: []string{
"kms:*",
},
Resources: []string{
"*",
},
},
},
}, nil)
if err != nil {
return err
}
dlmCrossRegionCopyCmk, err := kms.NewKey(ctx, "dlm_cross_region_copy_cmk", &kms.KeyArgs{
Description: pulumi.String("Example Alternate Region KMS Key"),
Policy: pulumi.String(key.Json),
})
if err != nil {
return err
}
_, err = dlm.NewLifecyclePolicy(ctx, "example", &dlm.LifecyclePolicyArgs{
Description: pulumi.String("example DLM lifecycle policy"),
ExecutionRoleArn: pulumi.Any(dlmLifecycleRole.Arn),
State: pulumi.String("ENABLED"),
PolicyDetails: &dlm.LifecyclePolicyPolicyDetailsArgs{
ResourceTypes: pulumi.StringArray("VOLUME"),
Schedules: dlm.LifecyclePolicyPolicyDetailsScheduleArray{
&dlm.LifecyclePolicyPolicyDetailsScheduleArgs{
Name: pulumi.String("2 weeks of daily snapshots"),
CreateRule: &dlm.LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs{
Interval: pulumi.Int(24),
IntervalUnit: pulumi.String("HOURS"),
Times: pulumi.String("23:45"),
},
RetainRule: &dlm.LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs{
Count: pulumi.Int(14),
},
TagsToAdd: pulumi.StringMap{
"SnapshotCreator": pulumi.String("DLM"),
},
CopyTags: pulumi.Bool(false),
CrossRegionCopyRules: dlm.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArray{
&dlm.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArgs{
Target: pulumi.String("us-west-2"),
Encrypted: pulumi.Bool(true),
CmkArn: dlmCrossRegionCopyCmk.Arn,
CopyTags: pulumi.Bool(true),
RetainRule: &dlm.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRuleArgs{
Interval: pulumi.Int(30),
IntervalUnit: pulumi.String("DAYS"),
},
},
},
},
},
TargetTags: pulumi.StringMap{
"Snapshot": pulumi.String("true"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
// ...other configuration...
var current = Aws.GetCallerIdentity.Invoke();
var key = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Sid = "Enable IAM User Permissions",
Effect = "Allow",
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "AWS",
Identifiers = new[]
{
$"arn:aws:iam::{current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId)}:root",
},
},
},
Actions = new[]
{
"kms:*",
},
Resources = new[]
{
"*",
},
},
},
});
var dlmCrossRegionCopyCmk = new Aws.Kms.Key("dlm_cross_region_copy_cmk", new()
{
Description = "Example Alternate Region KMS Key",
Policy = key.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
var example = new Aws.Dlm.LifecyclePolicy("example", new()
{
Description = "example DLM lifecycle policy",
ExecutionRoleArn = dlmLifecycleRole.Arn,
State = "ENABLED",
PolicyDetails = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsArgs
{
ResourceTypes = "VOLUME",
Schedules = new[]
{
new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleArgs
{
Name = "2 weeks of daily snapshots",
CreateRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs
{
Interval = 24,
IntervalUnit = "HOURS",
Times = "23:45",
},
RetainRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs
{
Count = 14,
},
TagsToAdd =
{
{ "SnapshotCreator", "DLM" },
},
CopyTags = false,
CrossRegionCopyRules = new[]
{
new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArgs
{
Target = "us-west-2",
Encrypted = true,
CmkArn = dlmCrossRegionCopyCmk.Arn,
CopyTags = true,
RetainRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRuleArgs
{
Interval = 30,
IntervalUnit = "DAYS",
},
},
},
},
},
TargetTags =
{
{ "Snapshot", "true" },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.kms.KeyArgs;
import com.pulumi.aws.dlm.LifecyclePolicy;
import com.pulumi.aws.dlm.LifecyclePolicyArgs;
import com.pulumi.aws.dlm.inputs.LifecyclePolicyPolicyDetailsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// ...other configuration...
final var current = AwsFunctions.getCallerIdentity();
final var key = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.sid("Enable IAM User Permissions")
.effect("Allow")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("AWS")
.identifiers(String.format("arn:aws:iam::%s:root", current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId())))
.build())
.actions("kms:*")
.resources("*")
.build())
.build());
var dlmCrossRegionCopyCmk = new Key("dlmCrossRegionCopyCmk", KeyArgs.builder()
.description("Example Alternate Region KMS Key")
.policy(key.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var example = new LifecyclePolicy("example", LifecyclePolicyArgs.builder()
.description("example DLM lifecycle policy")
.executionRoleArn(dlmLifecycleRole.arn())
.state("ENABLED")
.policyDetails(LifecyclePolicyPolicyDetailsArgs.builder()
.resourceTypes("VOLUME")
.schedules(LifecyclePolicyPolicyDetailsScheduleArgs.builder()
.name("2 weeks of daily snapshots")
.createRule(LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs.builder()
.interval(24)
.intervalUnit("HOURS")
.times("23:45")
.build())
.retainRule(LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs.builder()
.count(14)
.build())
.tagsToAdd(Map.of("SnapshotCreator", "DLM"))
.copyTags(false)
.crossRegionCopyRules(LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArgs.builder()
.target("us-west-2")
.encrypted(true)
.cmkArn(dlmCrossRegionCopyCmk.arn())
.copyTags(true)
.retainRule(LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRuleArgs.builder()
.interval(30)
.intervalUnit("DAYS")
.build())
.build())
.build())
.targetTags(Map.of("Snapshot", "true"))
.build())
.build());
}
}
resources:
dlmCrossRegionCopyCmk:
type: aws:kms:Key
name: dlm_cross_region_copy_cmk
properties:
description: Example Alternate Region KMS Key
policy: ${key.json}
example:
type: aws:dlm:LifecyclePolicy
properties:
description: example DLM lifecycle policy
executionRoleArn: ${dlmLifecycleRole.arn}
state: ENABLED
policyDetails:
resourceTypes: VOLUME
schedules:
- name: 2 weeks of daily snapshots
createRule:
interval: 24
intervalUnit: HOURS
times: 23:45
retainRule:
count: 14
tagsToAdd:
SnapshotCreator: DLM
copyTags: false
crossRegionCopyRules:
- target: us-west-2
encrypted: true
cmkArn: ${dlmCrossRegionCopyCmk.arn}
copyTags: true
retainRule:
interval: 30
intervalUnit: DAYS
targetTags:
Snapshot: 'true'
variables:
# ...other configuration...
current:
fn::invoke:
Function: aws:getCallerIdentity
Arguments: {}
key:
fn::invoke:
Function: aws:iam:getPolicyDocument
Arguments:
statements:
- sid: Enable IAM User Permissions
effect: Allow
principals:
- type: AWS
identifiers:
- arn:aws:iam::${current.accountId}:root
actions:
- kms:*
resources:
- '*'
Example Event Based Policy Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getCallerIdentity({});
const exampleLifecyclePolicy = new aws.dlm.LifecyclePolicy("example", {
description: "tf-acc-basic",
executionRoleArn: exampleAwsIamRole.arn,
policyDetails: {
policyType: "EVENT_BASED_POLICY",
action: {
name: "tf-acc-basic",
crossRegionCopies: [{
encryptionConfiguration: {},
retainRule: {
interval: 15,
intervalUnit: "MONTHS",
},
target: "us-east-1",
}],
},
eventSource: {
type: "MANAGED_CWE",
parameters: {
descriptionRegex: "^.*Created for policy: policy-1234567890abcdef0.*$",
eventType: "shareSnapshot",
snapshotOwners: [current.then(current => current.accountId)],
},
},
},
});
const example = aws.iam.getPolicy({
name: "AWSDataLifecycleManagerServiceRole",
});
const exampleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("example", {
role: exampleAwsIamRole.id,
policyArn: example.then(example => example.arn),
});
import pulumi
import pulumi_aws as aws
current = aws.get_caller_identity()
example_lifecycle_policy = aws.dlm.LifecyclePolicy("example",
description="tf-acc-basic",
execution_role_arn=example_aws_iam_role["arn"],
policy_details={
"policy_type": "EVENT_BASED_POLICY",
"action": {
"name": "tf-acc-basic",
"cross_region_copies": [{
"encryption_configuration": {},
"retain_rule": {
"interval": 15,
"interval_unit": "MONTHS",
},
"target": "us-east-1",
}],
},
"event_source": {
"type": "MANAGED_CWE",
"parameters": {
"description_regex": "^.*Created for policy: policy-1234567890abcdef0.*$",
"event_type": "shareSnapshot",
"snapshot_owners": [current.account_id],
},
},
})
example = aws.iam.get_policy(name="AWSDataLifecycleManagerServiceRole")
example_role_policy_attachment = aws.iam.RolePolicyAttachment("example",
role=example_aws_iam_role["id"],
policy_arn=example.arn)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/dlm"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := aws.GetCallerIdentity(ctx, nil, nil)
if err != nil {
return err
}
_, err = dlm.NewLifecyclePolicy(ctx, "example", &dlm.LifecyclePolicyArgs{
Description: pulumi.String("tf-acc-basic"),
ExecutionRoleArn: pulumi.Any(exampleAwsIamRole.Arn),
PolicyDetails: &dlm.LifecyclePolicyPolicyDetailsArgs{
PolicyType: pulumi.String("EVENT_BASED_POLICY"),
Action: &dlm.LifecyclePolicyPolicyDetailsActionArgs{
Name: pulumi.String("tf-acc-basic"),
CrossRegionCopies: dlm.LifecyclePolicyPolicyDetailsActionCrossRegionCopyArray{
&dlm.LifecyclePolicyPolicyDetailsActionCrossRegionCopyArgs{
EncryptionConfiguration: nil,
RetainRule: &dlm.LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRuleArgs{
Interval: pulumi.Int(15),
IntervalUnit: pulumi.String("MONTHS"),
},
Target: pulumi.String("us-east-1"),
},
},
},
EventSource: &dlm.LifecyclePolicyPolicyDetailsEventSourceArgs{
Type: pulumi.String("MANAGED_CWE"),
Parameters: &dlm.LifecyclePolicyPolicyDetailsEventSourceParametersArgs{
DescriptionRegex: pulumi.String("^.*Created for policy: policy-1234567890abcdef0.*$"),
EventType: pulumi.String("shareSnapshot"),
SnapshotOwners: pulumi.StringArray{
pulumi.String(current.AccountId),
},
},
},
},
})
if err != nil {
return err
}
example, err := iam.LookupPolicy(ctx, &iam.LookupPolicyArgs{
Name: pulumi.StringRef("AWSDataLifecycleManagerServiceRole"),
}, nil)
if err != nil {
return err
}
_, err = iam.NewRolePolicyAttachment(ctx, "example", &iam.RolePolicyAttachmentArgs{
Role: pulumi.Any(exampleAwsIamRole.Id),
PolicyArn: pulumi.String(example.Arn),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetCallerIdentity.Invoke();
var exampleLifecyclePolicy = new Aws.Dlm.LifecyclePolicy("example", new()
{
Description = "tf-acc-basic",
ExecutionRoleArn = exampleAwsIamRole.Arn,
PolicyDetails = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsArgs
{
PolicyType = "EVENT_BASED_POLICY",
Action = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsActionArgs
{
Name = "tf-acc-basic",
CrossRegionCopies = new[]
{
new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsActionCrossRegionCopyArgs
{
EncryptionConfiguration = null,
RetainRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRuleArgs
{
Interval = 15,
IntervalUnit = "MONTHS",
},
Target = "us-east-1",
},
},
},
EventSource = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsEventSourceArgs
{
Type = "MANAGED_CWE",
Parameters = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsEventSourceParametersArgs
{
DescriptionRegex = "^.*Created for policy: policy-1234567890abcdef0.*$",
EventType = "shareSnapshot",
SnapshotOwners = new[]
{
current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
},
},
},
},
});
var example = Aws.Iam.GetPolicy.Invoke(new()
{
Name = "AWSDataLifecycleManagerServiceRole",
});
var exampleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("example", new()
{
Role = exampleAwsIamRole.Id,
PolicyArn = example.Apply(getPolicyResult => getPolicyResult.Arn),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.dlm.LifecyclePolicy;
import com.pulumi.aws.dlm.LifecyclePolicyArgs;
import com.pulumi.aws.dlm.inputs.LifecyclePolicyPolicyDetailsArgs;
import com.pulumi.aws.dlm.inputs.LifecyclePolicyPolicyDetailsActionArgs;
import com.pulumi.aws.dlm.inputs.LifecyclePolicyPolicyDetailsEventSourceArgs;
import com.pulumi.aws.dlm.inputs.LifecyclePolicyPolicyDetailsEventSourceParametersArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var current = AwsFunctions.getCallerIdentity();
var exampleLifecyclePolicy = new LifecyclePolicy("exampleLifecyclePolicy", LifecyclePolicyArgs.builder()
.description("tf-acc-basic")
.executionRoleArn(exampleAwsIamRole.arn())
.policyDetails(LifecyclePolicyPolicyDetailsArgs.builder()
.policyType("EVENT_BASED_POLICY")
.action(LifecyclePolicyPolicyDetailsActionArgs.builder()
.name("tf-acc-basic")
.crossRegionCopies(LifecyclePolicyPolicyDetailsActionCrossRegionCopyArgs.builder()
.encryptionConfiguration()
.retainRule(LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRuleArgs.builder()
.interval(15)
.intervalUnit("MONTHS")
.build())
.target("us-east-1")
.build())
.build())
.eventSource(LifecyclePolicyPolicyDetailsEventSourceArgs.builder()
.type("MANAGED_CWE")
.parameters(LifecyclePolicyPolicyDetailsEventSourceParametersArgs.builder()
.descriptionRegex("^.*Created for policy: policy-1234567890abcdef0.*$")
.eventType("shareSnapshot")
.snapshotOwners(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
.build())
.build())
.build())
.build());
final var example = IamFunctions.getPolicy(GetPolicyArgs.builder()
.name("AWSDataLifecycleManagerServiceRole")
.build());
var exampleRolePolicyAttachment = new RolePolicyAttachment("exampleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()
.role(exampleAwsIamRole.id())
.policyArn(example.applyValue(getPolicyResult -> getPolicyResult.arn()))
.build());
}
}
resources:
exampleLifecyclePolicy:
type: aws:dlm:LifecyclePolicy
name: example
properties:
description: tf-acc-basic
executionRoleArn: ${exampleAwsIamRole.arn}
policyDetails:
policyType: EVENT_BASED_POLICY
action:
name: tf-acc-basic
crossRegionCopies:
- encryptionConfiguration: {}
retainRule:
interval: 15
intervalUnit: MONTHS
target: us-east-1
eventSource:
type: MANAGED_CWE
parameters:
descriptionRegex: '^.*Created for policy: policy-1234567890abcdef0.*$'
eventType: shareSnapshot
snapshotOwners:
- ${current.accountId}
exampleRolePolicyAttachment:
type: aws:iam:RolePolicyAttachment
name: example
properties:
role: ${exampleAwsIamRole.id}
policyArn: ${example.arn}
variables:
current:
fn::invoke:
Function: aws:getCallerIdentity
Arguments: {}
example:
fn::invoke:
Function: aws:iam:getPolicy
Arguments:
name: AWSDataLifecycleManagerServiceRole
Create LifecyclePolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LifecyclePolicy(name: string, args: LifecyclePolicyArgs, opts?: CustomResourceOptions);
@overload
def LifecyclePolicy(resource_name: str,
args: LifecyclePolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LifecyclePolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
execution_role_arn: Optional[str] = None,
policy_details: Optional[LifecyclePolicyPolicyDetailsArgs] = None,
state: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewLifecyclePolicy(ctx *Context, name string, args LifecyclePolicyArgs, opts ...ResourceOption) (*LifecyclePolicy, error)
public LifecyclePolicy(string name, LifecyclePolicyArgs args, CustomResourceOptions? opts = null)
public LifecyclePolicy(String name, LifecyclePolicyArgs args)
public LifecyclePolicy(String name, LifecyclePolicyArgs args, CustomResourceOptions options)
type: aws:dlm:LifecyclePolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LifecyclePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LifecyclePolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LifecyclePolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LifecyclePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LifecyclePolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var lifecyclePolicyResource = new Aws.Dlm.LifecyclePolicy("lifecyclePolicyResource", new()
{
Description = "string",
ExecutionRoleArn = "string",
PolicyDetails = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsArgs
{
Action = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsActionArgs
{
CrossRegionCopies = new[]
{
new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsActionCrossRegionCopyArgs
{
EncryptionConfiguration = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsActionCrossRegionCopyEncryptionConfigurationArgs
{
CmkArn = "string",
Encrypted = false,
},
Target = "string",
RetainRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRuleArgs
{
Interval = 0,
IntervalUnit = "string",
},
},
},
Name = "string",
},
EventSource = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsEventSourceArgs
{
Parameters = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsEventSourceParametersArgs
{
DescriptionRegex = "string",
EventType = "string",
SnapshotOwners = new[]
{
"string",
},
},
Type = "string",
},
Parameters = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsParametersArgs
{
ExcludeBootVolume = false,
NoReboot = false,
},
PolicyType = "string",
ResourceLocations = "string",
ResourceTypes = new[]
{
"string",
},
Schedules = new[]
{
new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleArgs
{
CreateRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs
{
CronExpression = "string",
Interval = 0,
IntervalUnit = "string",
Location = "string",
Times = "string",
},
Name = "string",
RetainRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs
{
Count = 0,
Interval = 0,
IntervalUnit = "string",
},
CopyTags = false,
CrossRegionCopyRules = new[]
{
new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArgs
{
Encrypted = false,
Target = "string",
CmkArn = "string",
CopyTags = false,
DeprecateRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleDeprecateRuleArgs
{
Interval = 0,
IntervalUnit = "string",
},
RetainRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRuleArgs
{
Interval = 0,
IntervalUnit = "string",
},
},
},
DeprecateRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleDeprecateRuleArgs
{
Count = 0,
Interval = 0,
IntervalUnit = "string",
},
FastRestoreRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleFastRestoreRuleArgs
{
AvailabilityZones = new[]
{
"string",
},
Count = 0,
Interval = 0,
IntervalUnit = "string",
},
ShareRule = new Aws.Dlm.Inputs.LifecyclePolicyPolicyDetailsScheduleShareRuleArgs
{
TargetAccounts = new[]
{
"string",
},
UnshareInterval = 0,
UnshareIntervalUnit = "string",
},
TagsToAdd =
{
{ "string", "string" },
},
VariableTags =
{
{ "string", "string" },
},
},
},
TargetTags =
{
{ "string", "string" },
},
},
State = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := dlm.NewLifecyclePolicy(ctx, "lifecyclePolicyResource", &dlm.LifecyclePolicyArgs{
Description: pulumi.String("string"),
ExecutionRoleArn: pulumi.String("string"),
PolicyDetails: &dlm.LifecyclePolicyPolicyDetailsArgs{
Action: &dlm.LifecyclePolicyPolicyDetailsActionArgs{
CrossRegionCopies: dlm.LifecyclePolicyPolicyDetailsActionCrossRegionCopyArray{
&dlm.LifecyclePolicyPolicyDetailsActionCrossRegionCopyArgs{
EncryptionConfiguration: &dlm.LifecyclePolicyPolicyDetailsActionCrossRegionCopyEncryptionConfigurationArgs{
CmkArn: pulumi.String("string"),
Encrypted: pulumi.Bool(false),
},
Target: pulumi.String("string"),
RetainRule: &dlm.LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRuleArgs{
Interval: pulumi.Int(0),
IntervalUnit: pulumi.String("string"),
},
},
},
Name: pulumi.String("string"),
},
EventSource: &dlm.LifecyclePolicyPolicyDetailsEventSourceArgs{
Parameters: &dlm.LifecyclePolicyPolicyDetailsEventSourceParametersArgs{
DescriptionRegex: pulumi.String("string"),
EventType: pulumi.String("string"),
SnapshotOwners: pulumi.StringArray{
pulumi.String("string"),
},
},
Type: pulumi.String("string"),
},
Parameters: &dlm.LifecyclePolicyPolicyDetailsParametersArgs{
ExcludeBootVolume: pulumi.Bool(false),
NoReboot: pulumi.Bool(false),
},
PolicyType: pulumi.String("string"),
ResourceLocations: pulumi.String("string"),
ResourceTypes: pulumi.StringArray{
pulumi.String("string"),
},
Schedules: dlm.LifecyclePolicyPolicyDetailsScheduleArray{
&dlm.LifecyclePolicyPolicyDetailsScheduleArgs{
CreateRule: &dlm.LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs{
CronExpression: pulumi.String("string"),
Interval: pulumi.Int(0),
IntervalUnit: pulumi.String("string"),
Location: pulumi.String("string"),
Times: pulumi.String("string"),
},
Name: pulumi.String("string"),
RetainRule: &dlm.LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs{
Count: pulumi.Int(0),
Interval: pulumi.Int(0),
IntervalUnit: pulumi.String("string"),
},
CopyTags: pulumi.Bool(false),
CrossRegionCopyRules: dlm.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArray{
&dlm.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArgs{
Encrypted: pulumi.Bool(false),
Target: pulumi.String("string"),
CmkArn: pulumi.String("string"),
CopyTags: pulumi.Bool(false),
DeprecateRule: &dlm.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleDeprecateRuleArgs{
Interval: pulumi.Int(0),
IntervalUnit: pulumi.String("string"),
},
RetainRule: &dlm.LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRuleArgs{
Interval: pulumi.Int(0),
IntervalUnit: pulumi.String("string"),
},
},
},
DeprecateRule: &dlm.LifecyclePolicyPolicyDetailsScheduleDeprecateRuleArgs{
Count: pulumi.Int(0),
Interval: pulumi.Int(0),
IntervalUnit: pulumi.String("string"),
},
FastRestoreRule: &dlm.LifecyclePolicyPolicyDetailsScheduleFastRestoreRuleArgs{
AvailabilityZones: pulumi.StringArray{
pulumi.String("string"),
},
Count: pulumi.Int(0),
Interval: pulumi.Int(0),
IntervalUnit: pulumi.String("string"),
},
ShareRule: &dlm.LifecyclePolicyPolicyDetailsScheduleShareRuleArgs{
TargetAccounts: pulumi.StringArray{
pulumi.String("string"),
},
UnshareInterval: pulumi.Int(0),
UnshareIntervalUnit: pulumi.String("string"),
},
TagsToAdd: pulumi.StringMap{
"string": pulumi.String("string"),
},
VariableTags: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
},
TargetTags: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
State: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var lifecyclePolicyResource = new LifecyclePolicy("lifecyclePolicyResource", LifecyclePolicyArgs.builder()
.description("string")
.executionRoleArn("string")
.policyDetails(LifecyclePolicyPolicyDetailsArgs.builder()
.action(LifecyclePolicyPolicyDetailsActionArgs.builder()
.crossRegionCopies(LifecyclePolicyPolicyDetailsActionCrossRegionCopyArgs.builder()
.encryptionConfiguration(LifecyclePolicyPolicyDetailsActionCrossRegionCopyEncryptionConfigurationArgs.builder()
.cmkArn("string")
.encrypted(false)
.build())
.target("string")
.retainRule(LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRuleArgs.builder()
.interval(0)
.intervalUnit("string")
.build())
.build())
.name("string")
.build())
.eventSource(LifecyclePolicyPolicyDetailsEventSourceArgs.builder()
.parameters(LifecyclePolicyPolicyDetailsEventSourceParametersArgs.builder()
.descriptionRegex("string")
.eventType("string")
.snapshotOwners("string")
.build())
.type("string")
.build())
.parameters(LifecyclePolicyPolicyDetailsParametersArgs.builder()
.excludeBootVolume(false)
.noReboot(false)
.build())
.policyType("string")
.resourceLocations("string")
.resourceTypes("string")
.schedules(LifecyclePolicyPolicyDetailsScheduleArgs.builder()
.createRule(LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs.builder()
.cronExpression("string")
.interval(0)
.intervalUnit("string")
.location("string")
.times("string")
.build())
.name("string")
.retainRule(LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs.builder()
.count(0)
.interval(0)
.intervalUnit("string")
.build())
.copyTags(false)
.crossRegionCopyRules(LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArgs.builder()
.encrypted(false)
.target("string")
.cmkArn("string")
.copyTags(false)
.deprecateRule(LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleDeprecateRuleArgs.builder()
.interval(0)
.intervalUnit("string")
.build())
.retainRule(LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRuleArgs.builder()
.interval(0)
.intervalUnit("string")
.build())
.build())
.deprecateRule(LifecyclePolicyPolicyDetailsScheduleDeprecateRuleArgs.builder()
.count(0)
.interval(0)
.intervalUnit("string")
.build())
.fastRestoreRule(LifecyclePolicyPolicyDetailsScheduleFastRestoreRuleArgs.builder()
.availabilityZones("string")
.count(0)
.interval(0)
.intervalUnit("string")
.build())
.shareRule(LifecyclePolicyPolicyDetailsScheduleShareRuleArgs.builder()
.targetAccounts("string")
.unshareInterval(0)
.unshareIntervalUnit("string")
.build())
.tagsToAdd(Map.of("string", "string"))
.variableTags(Map.of("string", "string"))
.build())
.targetTags(Map.of("string", "string"))
.build())
.state("string")
.tags(Map.of("string", "string"))
.build());
lifecycle_policy_resource = aws.dlm.LifecyclePolicy("lifecyclePolicyResource",
description="string",
execution_role_arn="string",
policy_details={
"action": {
"crossRegionCopies": [{
"encryptionConfiguration": {
"cmkArn": "string",
"encrypted": False,
},
"target": "string",
"retainRule": {
"interval": 0,
"intervalUnit": "string",
},
}],
"name": "string",
},
"eventSource": {
"parameters": {
"descriptionRegex": "string",
"eventType": "string",
"snapshotOwners": ["string"],
},
"type": "string",
},
"parameters": {
"excludeBootVolume": False,
"noReboot": False,
},
"policyType": "string",
"resourceLocations": "string",
"resourceTypes": ["string"],
"schedules": [{
"createRule": {
"cronExpression": "string",
"interval": 0,
"intervalUnit": "string",
"location": "string",
"times": "string",
},
"name": "string",
"retainRule": {
"count": 0,
"interval": 0,
"intervalUnit": "string",
},
"copyTags": False,
"crossRegionCopyRules": [{
"encrypted": False,
"target": "string",
"cmkArn": "string",
"copyTags": False,
"deprecateRule": {
"interval": 0,
"intervalUnit": "string",
},
"retainRule": {
"interval": 0,
"intervalUnit": "string",
},
}],
"deprecateRule": {
"count": 0,
"interval": 0,
"intervalUnit": "string",
},
"fastRestoreRule": {
"availabilityZones": ["string"],
"count": 0,
"interval": 0,
"intervalUnit": "string",
},
"shareRule": {
"targetAccounts": ["string"],
"unshareInterval": 0,
"unshareIntervalUnit": "string",
},
"tagsToAdd": {
"string": "string",
},
"variableTags": {
"string": "string",
},
}],
"targetTags": {
"string": "string",
},
},
state="string",
tags={
"string": "string",
})
const lifecyclePolicyResource = new aws.dlm.LifecyclePolicy("lifecyclePolicyResource", {
description: "string",
executionRoleArn: "string",
policyDetails: {
action: {
crossRegionCopies: [{
encryptionConfiguration: {
cmkArn: "string",
encrypted: false,
},
target: "string",
retainRule: {
interval: 0,
intervalUnit: "string",
},
}],
name: "string",
},
eventSource: {
parameters: {
descriptionRegex: "string",
eventType: "string",
snapshotOwners: ["string"],
},
type: "string",
},
parameters: {
excludeBootVolume: false,
noReboot: false,
},
policyType: "string",
resourceLocations: "string",
resourceTypes: ["string"],
schedules: [{
createRule: {
cronExpression: "string",
interval: 0,
intervalUnit: "string",
location: "string",
times: "string",
},
name: "string",
retainRule: {
count: 0,
interval: 0,
intervalUnit: "string",
},
copyTags: false,
crossRegionCopyRules: [{
encrypted: false,
target: "string",
cmkArn: "string",
copyTags: false,
deprecateRule: {
interval: 0,
intervalUnit: "string",
},
retainRule: {
interval: 0,
intervalUnit: "string",
},
}],
deprecateRule: {
count: 0,
interval: 0,
intervalUnit: "string",
},
fastRestoreRule: {
availabilityZones: ["string"],
count: 0,
interval: 0,
intervalUnit: "string",
},
shareRule: {
targetAccounts: ["string"],
unshareInterval: 0,
unshareIntervalUnit: "string",
},
tagsToAdd: {
string: "string",
},
variableTags: {
string: "string",
},
}],
targetTags: {
string: "string",
},
},
state: "string",
tags: {
string: "string",
},
});
type: aws:dlm:LifecyclePolicy
properties:
description: string
executionRoleArn: string
policyDetails:
action:
crossRegionCopies:
- encryptionConfiguration:
cmkArn: string
encrypted: false
retainRule:
interval: 0
intervalUnit: string
target: string
name: string
eventSource:
parameters:
descriptionRegex: string
eventType: string
snapshotOwners:
- string
type: string
parameters:
excludeBootVolume: false
noReboot: false
policyType: string
resourceLocations: string
resourceTypes:
- string
schedules:
- copyTags: false
createRule:
cronExpression: string
interval: 0
intervalUnit: string
location: string
times: string
crossRegionCopyRules:
- cmkArn: string
copyTags: false
deprecateRule:
interval: 0
intervalUnit: string
encrypted: false
retainRule:
interval: 0
intervalUnit: string
target: string
deprecateRule:
count: 0
interval: 0
intervalUnit: string
fastRestoreRule:
availabilityZones:
- string
count: 0
interval: 0
intervalUnit: string
name: string
retainRule:
count: 0
interval: 0
intervalUnit: string
shareRule:
targetAccounts:
- string
unshareInterval: 0
unshareIntervalUnit: string
tagsToAdd:
string: string
variableTags:
string: string
targetTags:
string: string
state: string
tags:
string: string
LifecyclePolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The LifecyclePolicy resource accepts the following input properties:
- Description string
- A description for the DLM lifecycle policy.
- Execution
Role stringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- Policy
Details LifecyclePolicy Policy Details - See the
policy_details
configuration block. Max of 1. - State string
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Description string
- A description for the DLM lifecycle policy.
- Execution
Role stringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- Policy
Details LifecyclePolicy Policy Details Args - See the
policy_details
configuration block. Max of 1. - State string
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - map[string]string
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- description String
- A description for the DLM lifecycle policy.
- execution
Role StringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy
Details LifecyclePolicy Policy Details - See the
policy_details
configuration block. Max of 1. - state String
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Map<String,String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- description string
- A description for the DLM lifecycle policy.
- execution
Role stringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy
Details LifecyclePolicy Policy Details - See the
policy_details
configuration block. Max of 1. - state string
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - {[key: string]: string}
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- description str
- A description for the DLM lifecycle policy.
- execution_
role_ strarn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy_
details LifecyclePolicy Policy Details Args - See the
policy_details
configuration block. Max of 1. - state str
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Mapping[str, str]
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- description String
- A description for the DLM lifecycle policy.
- execution
Role StringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy
Details Property Map - See the
policy_details
configuration block. Max of 1. - state String
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Map<String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the LifecyclePolicy resource produces the following output properties:
Look up Existing LifecyclePolicy Resource
Get an existing LifecyclePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LifecyclePolicyState, opts?: CustomResourceOptions): LifecyclePolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
description: Optional[str] = None,
execution_role_arn: Optional[str] = None,
policy_details: Optional[LifecyclePolicyPolicyDetailsArgs] = None,
state: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> LifecyclePolicy
func GetLifecyclePolicy(ctx *Context, name string, id IDInput, state *LifecyclePolicyState, opts ...ResourceOption) (*LifecyclePolicy, error)
public static LifecyclePolicy Get(string name, Input<string> id, LifecyclePolicyState? state, CustomResourceOptions? opts = null)
public static LifecyclePolicy get(String name, Output<String> id, LifecyclePolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- Amazon Resource Name (ARN) of the DLM Lifecycle Policy.
- Description string
- A description for the DLM lifecycle policy.
- Execution
Role stringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- Policy
Details LifecyclePolicy Policy Details - See the
policy_details
configuration block. Max of 1. - State string
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- Amazon Resource Name (ARN) of the DLM Lifecycle Policy.
- Description string
- A description for the DLM lifecycle policy.
- Execution
Role stringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- Policy
Details LifecyclePolicy Policy Details Args - See the
policy_details
configuration block. Max of 1. - State string
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - map[string]string
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- Amazon Resource Name (ARN) of the DLM Lifecycle Policy.
- description String
- A description for the DLM lifecycle policy.
- execution
Role StringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy
Details LifecyclePolicy Policy Details - See the
policy_details
configuration block. Max of 1. - state String
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Map<String,String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- Amazon Resource Name (ARN) of the DLM Lifecycle Policy.
- description string
- A description for the DLM lifecycle policy.
- execution
Role stringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy
Details LifecyclePolicy Policy Details - See the
policy_details
configuration block. Max of 1. - state string
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - {[key: string]: string}
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- Amazon Resource Name (ARN) of the DLM Lifecycle Policy.
- description str
- A description for the DLM lifecycle policy.
- execution_
role_ strarn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy_
details LifecyclePolicy Policy Details Args - See the
policy_details
configuration block. Max of 1. - state str
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Mapping[str, str]
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- Amazon Resource Name (ARN) of the DLM Lifecycle Policy.
- description String
- A description for the DLM lifecycle policy.
- execution
Role StringArn - The ARN of an IAM role that is able to be assumed by the DLM service.
- policy
Details Property Map - See the
policy_details
configuration block. Max of 1. - state String
- Whether the lifecycle policy should be enabled or disabled.
ENABLED
orDISABLED
are valid values. Defaults toENABLED
. - Map<String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
LifecyclePolicyPolicyDetails, LifecyclePolicyPolicyDetailsArgs
- Action
Lifecycle
Policy Policy Details Action - The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
action
configuration block. - Event
Source LifecyclePolicy Policy Details Event Source - The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
event_source
configuration block. - Parameters
Lifecycle
Policy Policy Details Parameters - Policy
Type string - The valid target resource types and actions a policy can manage. Specify
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. SpecifyIMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. SpecifyEVENT_BASED_POLICY
to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value isEBS_SNAPSHOT_MANAGEMENT
. - Resource
Locations string - The location of the resources to backup. If the source resources are located in an AWS Region, specify
CLOUD
. If the source resources are located on an Outpost in your account, specifyOUTPOST
. If you specifyOUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values areCLOUD
andOUTPOST
. - Resource
Types List<string> - A list of resource types that should be targeted by the lifecycle policy. Valid values are
VOLUME
andINSTANCE
. - Schedules
List<Lifecycle
Policy Policy Details Schedule> - See the
schedule
configuration block. - Dictionary<string, string>
A map of tag keys and their values. Any resources that match the
resource_types
and are tagged with any of these tags will be targeted.Note: You cannot have overlapping lifecycle policies that share the same
target_tags
. Pulumi is unable to detect this at plan time but it will fail during apply.
- Action
Lifecycle
Policy Policy Details Action - The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
action
configuration block. - Event
Source LifecyclePolicy Policy Details Event Source - The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
event_source
configuration block. - Parameters
Lifecycle
Policy Policy Details Parameters - Policy
Type string - The valid target resource types and actions a policy can manage. Specify
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. SpecifyIMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. SpecifyEVENT_BASED_POLICY
to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value isEBS_SNAPSHOT_MANAGEMENT
. - Resource
Locations string - The location of the resources to backup. If the source resources are located in an AWS Region, specify
CLOUD
. If the source resources are located on an Outpost in your account, specifyOUTPOST
. If you specifyOUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values areCLOUD
andOUTPOST
. - Resource
Types []string - A list of resource types that should be targeted by the lifecycle policy. Valid values are
VOLUME
andINSTANCE
. - Schedules
[]Lifecycle
Policy Policy Details Schedule - See the
schedule
configuration block. - map[string]string
A map of tag keys and their values. Any resources that match the
resource_types
and are tagged with any of these tags will be targeted.Note: You cannot have overlapping lifecycle policies that share the same
target_tags
. Pulumi is unable to detect this at plan time but it will fail during apply.
- action
Lifecycle
Policy Policy Details Action - The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
action
configuration block. - event
Source LifecyclePolicy Policy Details Event Source - The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
event_source
configuration block. - parameters
Lifecycle
Policy Policy Details Parameters - policy
Type String - The valid target resource types and actions a policy can manage. Specify
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. SpecifyIMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. SpecifyEVENT_BASED_POLICY
to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value isEBS_SNAPSHOT_MANAGEMENT
. - resource
Locations String - The location of the resources to backup. If the source resources are located in an AWS Region, specify
CLOUD
. If the source resources are located on an Outpost in your account, specifyOUTPOST
. If you specifyOUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values areCLOUD
andOUTPOST
. - resource
Types List<String> - A list of resource types that should be targeted by the lifecycle policy. Valid values are
VOLUME
andINSTANCE
. - schedules
List<Lifecycle
Policy Policy Details Schedule> - See the
schedule
configuration block. - Map<String,String>
A map of tag keys and their values. Any resources that match the
resource_types
and are tagged with any of these tags will be targeted.Note: You cannot have overlapping lifecycle policies that share the same
target_tags
. Pulumi is unable to detect this at plan time but it will fail during apply.
- action
Lifecycle
Policy Policy Details Action - The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
action
configuration block. - event
Source LifecyclePolicy Policy Details Event Source - The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
event_source
configuration block. - parameters
Lifecycle
Policy Policy Details Parameters - policy
Type string - The valid target resource types and actions a policy can manage. Specify
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. SpecifyIMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. SpecifyEVENT_BASED_POLICY
to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value isEBS_SNAPSHOT_MANAGEMENT
. - resource
Locations string - The location of the resources to backup. If the source resources are located in an AWS Region, specify
CLOUD
. If the source resources are located on an Outpost in your account, specifyOUTPOST
. If you specifyOUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values areCLOUD
andOUTPOST
. - resource
Types string[] - A list of resource types that should be targeted by the lifecycle policy. Valid values are
VOLUME
andINSTANCE
. - schedules
Lifecycle
Policy Policy Details Schedule[] - See the
schedule
configuration block. - {[key: string]: string}
A map of tag keys and their values. Any resources that match the
resource_types
and are tagged with any of these tags will be targeted.Note: You cannot have overlapping lifecycle policies that share the same
target_tags
. Pulumi is unable to detect this at plan time but it will fail during apply.
- action
Lifecycle
Policy Policy Details Action - The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
action
configuration block. - event_
source LifecyclePolicy Policy Details Event Source - The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
event_source
configuration block. - parameters
Lifecycle
Policy Policy Details Parameters - policy_
type str - The valid target resource types and actions a policy can manage. Specify
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. SpecifyIMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. SpecifyEVENT_BASED_POLICY
to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value isEBS_SNAPSHOT_MANAGEMENT
. - resource_
locations str - The location of the resources to backup. If the source resources are located in an AWS Region, specify
CLOUD
. If the source resources are located on an Outpost in your account, specifyOUTPOST
. If you specifyOUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values areCLOUD
andOUTPOST
. - resource_
types Sequence[str] - A list of resource types that should be targeted by the lifecycle policy. Valid values are
VOLUME
andINSTANCE
. - schedules
Sequence[Lifecycle
Policy Policy Details Schedule] - See the
schedule
configuration block. - Mapping[str, str]
A map of tag keys and their values. Any resources that match the
resource_types
and are tagged with any of these tags will be targeted.Note: You cannot have overlapping lifecycle policies that share the same
target_tags
. Pulumi is unable to detect this at plan time but it will fail during apply.
- action Property Map
- The actions to be performed when the event-based policy is triggered. You can specify only one action per policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
action
configuration block. - event
Source Property Map - The event that triggers the event-based policy. This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter. See the
event_source
configuration block. - parameters Property Map
- policy
Type String - The valid target resource types and actions a policy can manage. Specify
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. SpecifyIMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. SpecifyEVENT_BASED_POLICY
to create an event-based policy that performs specific actions when a defined event occurs in your AWS account. Default value isEBS_SNAPSHOT_MANAGEMENT
. - resource
Locations String - The location of the resources to backup. If the source resources are located in an AWS Region, specify
CLOUD
. If the source resources are located on an Outpost in your account, specifyOUTPOST
. If you specifyOUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account. Valid values areCLOUD
andOUTPOST
. - resource
Types List<String> - A list of resource types that should be targeted by the lifecycle policy. Valid values are
VOLUME
andINSTANCE
. - schedules List<Property Map>
- See the
schedule
configuration block. - Map<String>
A map of tag keys and their values. Any resources that match the
resource_types
and are tagged with any of these tags will be targeted.Note: You cannot have overlapping lifecycle policies that share the same
target_tags
. Pulumi is unable to detect this at plan time but it will fail during apply.
LifecyclePolicyPolicyDetailsAction, LifecyclePolicyPolicyDetailsActionArgs
- Cross
Region List<LifecycleCopies Policy Policy Details Action Cross Region Copy> - The rule for copying shared snapshots across Regions. See the
cross_region_copy
configuration block. - Name string
- Cross
Region []LifecycleCopies Policy Policy Details Action Cross Region Copy - The rule for copying shared snapshots across Regions. See the
cross_region_copy
configuration block. - Name string
- cross
Region List<LifecycleCopies Policy Policy Details Action Cross Region Copy> - The rule for copying shared snapshots across Regions. See the
cross_region_copy
configuration block. - name String
- cross
Region LifecycleCopies Policy Policy Details Action Cross Region Copy[] - The rule for copying shared snapshots across Regions. See the
cross_region_copy
configuration block. - name string
- cross_
region_ Sequence[Lifecyclecopies Policy Policy Details Action Cross Region Copy] - The rule for copying shared snapshots across Regions. See the
cross_region_copy
configuration block. - name str
- cross
Region List<Property Map>Copies - The rule for copying shared snapshots across Regions. See the
cross_region_copy
configuration block. - name String
LifecyclePolicyPolicyDetailsActionCrossRegionCopy, LifecyclePolicyPolicyDetailsActionCrossRegionCopyArgs
- Encryption
Configuration LifecyclePolicy Policy Details Action Cross Region Copy Encryption Configuration - The encryption settings for the copied snapshot. See the
encryption_configuration
block. Max of 1 per action. - Target string
- Retain
Rule LifecyclePolicy Policy Details Action Cross Region Copy Retain Rule
- Encryption
Configuration LifecyclePolicy Policy Details Action Cross Region Copy Encryption Configuration - The encryption settings for the copied snapshot. See the
encryption_configuration
block. Max of 1 per action. - Target string
- Retain
Rule LifecyclePolicy Policy Details Action Cross Region Copy Retain Rule
- encryption
Configuration LifecyclePolicy Policy Details Action Cross Region Copy Encryption Configuration - The encryption settings for the copied snapshot. See the
encryption_configuration
block. Max of 1 per action. - target String
- retain
Rule LifecyclePolicy Policy Details Action Cross Region Copy Retain Rule
- encryption
Configuration LifecyclePolicy Policy Details Action Cross Region Copy Encryption Configuration - The encryption settings for the copied snapshot. See the
encryption_configuration
block. Max of 1 per action. - target string
- retain
Rule LifecyclePolicy Policy Details Action Cross Region Copy Retain Rule
- encryption_
configuration LifecyclePolicy Policy Details Action Cross Region Copy Encryption Configuration - The encryption settings for the copied snapshot. See the
encryption_configuration
block. Max of 1 per action. - target str
- retain_
rule LifecyclePolicy Policy Details Action Cross Region Copy Retain Rule
- encryption
Configuration Property Map - The encryption settings for the copied snapshot. See the
encryption_configuration
block. Max of 1 per action. - target String
- retain
Rule Property Map
LifecyclePolicyPolicyDetailsActionCrossRegionCopyEncryptionConfiguration, LifecyclePolicyPolicyDetailsActionCrossRegionCopyEncryptionConfigurationArgs
LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRule, LifecyclePolicyPolicyDetailsActionCrossRegionCopyRetainRuleArgs
- Interval int
- Interval
Unit string
- Interval int
- Interval
Unit string
- interval Integer
- interval
Unit String
- interval number
- interval
Unit string
- interval int
- interval_
unit str
- interval Number
- interval
Unit String
LifecyclePolicyPolicyDetailsEventSource, LifecyclePolicyPolicyDetailsEventSourceArgs
- Parameters
Lifecycle
Policy Policy Details Event Source Parameters - Type string
- The source of the event. Currently only managed CloudWatch Events rules are supported. Valid values are
MANAGED_CWE
.
- Parameters
Lifecycle
Policy Policy Details Event Source Parameters - Type string
- The source of the event. Currently only managed CloudWatch Events rules are supported. Valid values are
MANAGED_CWE
.
- parameters
Lifecycle
Policy Policy Details Event Source Parameters - type String
- The source of the event. Currently only managed CloudWatch Events rules are supported. Valid values are
MANAGED_CWE
.
- parameters
Lifecycle
Policy Policy Details Event Source Parameters - type string
- The source of the event. Currently only managed CloudWatch Events rules are supported. Valid values are
MANAGED_CWE
.
- parameters
Lifecycle
Policy Policy Details Event Source Parameters - type str
- The source of the event. Currently only managed CloudWatch Events rules are supported. Valid values are
MANAGED_CWE
.
- parameters Property Map
- type String
- The source of the event. Currently only managed CloudWatch Events rules are supported. Valid values are
MANAGED_CWE
.
LifecyclePolicyPolicyDetailsEventSourceParameters, LifecyclePolicyPolicyDetailsEventSourceParametersArgs
- Description
Regex string - 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.
- Event
Type string - The type of event. Currently, only
shareSnapshot
events are supported. - Snapshot
Owners List<string> - 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.
- Description
Regex string - 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.
- Event
Type string - The type of event. Currently, only
shareSnapshot
events are supported. - Snapshot
Owners []string - 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.
- description
Regex String - 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.
- event
Type String - The type of event. Currently, only
shareSnapshot
events are supported. - snapshot
Owners List<String> - 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.
- description
Regex string - 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.
- event
Type string - The type of event. Currently, only
shareSnapshot
events are supported. - snapshot
Owners string[] - 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.
- description_
regex 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.
- event_
type str - The type of event. Currently, only
shareSnapshot
events are supported. - snapshot_
owners 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.
- description
Regex String - 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.
- event
Type String - The type of event. Currently, only
shareSnapshot
events are supported. - snapshot
Owners List<String> - 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.
LifecyclePolicyPolicyDetailsParameters, LifecyclePolicyPolicyDetailsParametersArgs
- Exclude
Boot boolVolume - Indicates whether to exclude the root volume from snapshots created using CreateSnapshots. The default is
false
. - No
Reboot bool - Applies to AMI lifecycle 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 istrue
(instances are not rebooted).
- Exclude
Boot boolVolume - Indicates whether to exclude the root volume from snapshots created using CreateSnapshots. The default is
false
. - No
Reboot bool - Applies to AMI lifecycle 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 istrue
(instances are not rebooted).
- exclude
Boot BooleanVolume - Indicates whether to exclude the root volume from snapshots created using CreateSnapshots. The default is
false
. - no
Reboot Boolean - Applies to AMI lifecycle 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 istrue
(instances are not rebooted).
- exclude
Boot booleanVolume - Indicates whether to exclude the root volume from snapshots created using CreateSnapshots. The default is
false
. - no
Reboot boolean - Applies to AMI lifecycle 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 istrue
(instances are not rebooted).
- exclude_
boot_ boolvolume - Indicates whether to exclude the root volume from snapshots created using CreateSnapshots. The default is
false
. - no_
reboot bool - Applies to AMI lifecycle 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 istrue
(instances are not rebooted).
- exclude
Boot BooleanVolume - Indicates whether to exclude the root volume from snapshots created using CreateSnapshots. The default is
false
. - no
Reboot Boolean - Applies to AMI lifecycle 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 istrue
(instances are not rebooted).
LifecyclePolicyPolicyDetailsSchedule, LifecyclePolicyPolicyDetailsScheduleArgs
- Create
Rule LifecyclePolicy Policy Details Schedule Create Rule - See the
create_rule
block. Max of 1 per schedule. - Name string
- Retain
Rule LifecyclePolicy Policy Details Schedule Retain Rule - bool
- Cross
Region List<LifecycleCopy Rules Policy Policy Details Schedule Cross Region Copy Rule> - See the
cross_region_copy_rule
block. Max of 3 per schedule. - Deprecate
Rule LifecyclePolicy Policy Details Schedule Deprecate Rule - Fast
Restore LifecycleRule Policy Policy Details Schedule Fast Restore Rule - See the
fast_restore_rule
block. Max of 1 per schedule. - Lifecycle
Policy Policy Details Schedule Share Rule - See the
share_rule
block. Max of 1 per schedule. - Dictionary<string, string>
- A map of tag keys and their values. DLM lifecycle policies will already tag the snapshot with the tags on the volume. This configuration adds extra tags on top of these.
- Dictionary<string, string>
- A map of tag keys and variable values, where the values are determined when the policy is executed. Only
$(instance-id)
or$(timestamp)
are valid values. Can only be used whenresource_types
isINSTANCE
.
- Create
Rule LifecyclePolicy Policy Details Schedule Create Rule - See the
create_rule
block. Max of 1 per schedule. - Name string
- Retain
Rule LifecyclePolicy Policy Details Schedule Retain Rule - bool
- Cross
Region []LifecycleCopy Rules Policy Policy Details Schedule Cross Region Copy Rule - See the
cross_region_copy_rule
block. Max of 3 per schedule. - Deprecate
Rule LifecyclePolicy Policy Details Schedule Deprecate Rule - Fast
Restore LifecycleRule Policy Policy Details Schedule Fast Restore Rule - See the
fast_restore_rule
block. Max of 1 per schedule. - Lifecycle
Policy Policy Details Schedule Share Rule - See the
share_rule
block. Max of 1 per schedule. - map[string]string
- A map of tag keys and their values. DLM lifecycle policies will already tag the snapshot with the tags on the volume. This configuration adds extra tags on top of these.
- map[string]string
- A map of tag keys and variable values, where the values are determined when the policy is executed. Only
$(instance-id)
or$(timestamp)
are valid values. Can only be used whenresource_types
isINSTANCE
.
- create
Rule LifecyclePolicy Policy Details Schedule Create Rule - See the
create_rule
block. Max of 1 per schedule. - name String
- retain
Rule LifecyclePolicy Policy Details Schedule Retain Rule - Boolean
- cross
Region List<LifecycleCopy Rules Policy Policy Details Schedule Cross Region Copy Rule> - See the
cross_region_copy_rule
block. Max of 3 per schedule. - deprecate
Rule LifecyclePolicy Policy Details Schedule Deprecate Rule - fast
Restore LifecycleRule Policy Policy Details Schedule Fast Restore Rule - See the
fast_restore_rule
block. Max of 1 per schedule. - Lifecycle
Policy Policy Details Schedule Share Rule - See the
share_rule
block. Max of 1 per schedule. - Map<String,String>
- A map of tag keys and their values. DLM lifecycle policies will already tag the snapshot with the tags on the volume. This configuration adds extra tags on top of these.
- Map<String,String>
- A map of tag keys and variable values, where the values are determined when the policy is executed. Only
$(instance-id)
or$(timestamp)
are valid values. Can only be used whenresource_types
isINSTANCE
.
- create
Rule LifecyclePolicy Policy Details Schedule Create Rule - See the
create_rule
block. Max of 1 per schedule. - name string
- retain
Rule LifecyclePolicy Policy Details Schedule Retain Rule - boolean
- cross
Region LifecycleCopy Rules Policy Policy Details Schedule Cross Region Copy Rule[] - See the
cross_region_copy_rule
block. Max of 3 per schedule. - deprecate
Rule LifecyclePolicy Policy Details Schedule Deprecate Rule - fast
Restore LifecycleRule Policy Policy Details Schedule Fast Restore Rule - See the
fast_restore_rule
block. Max of 1 per schedule. - Lifecycle
Policy Policy Details Schedule Share Rule - See the
share_rule
block. Max of 1 per schedule. - {[key: string]: string}
- A map of tag keys and their values. DLM lifecycle policies will already tag the snapshot with the tags on the volume. This configuration adds extra tags on top of these.
- {[key: string]: string}
- A map of tag keys and variable values, where the values are determined when the policy is executed. Only
$(instance-id)
or$(timestamp)
are valid values. Can only be used whenresource_types
isINSTANCE
.
- create_
rule LifecyclePolicy Policy Details Schedule Create Rule - See the
create_rule
block. Max of 1 per schedule. - name str
- retain_
rule LifecyclePolicy Policy Details Schedule Retain Rule - bool
- cross_
region_ Sequence[Lifecyclecopy_ rules Policy Policy Details Schedule Cross Region Copy Rule] - See the
cross_region_copy_rule
block. Max of 3 per schedule. - deprecate_
rule LifecyclePolicy Policy Details Schedule Deprecate Rule - fast_
restore_ Lifecyclerule Policy Policy Details Schedule Fast Restore Rule - See the
fast_restore_rule
block. Max of 1 per schedule. - Lifecycle
Policy Policy Details Schedule Share Rule - See the
share_rule
block. Max of 1 per schedule. - Mapping[str, str]
- A map of tag keys and their values. DLM lifecycle policies will already tag the snapshot with the tags on the volume. This configuration adds extra tags on top of these.
- Mapping[str, str]
- A map of tag keys and variable values, where the values are determined when the policy is executed. Only
$(instance-id)
or$(timestamp)
are valid values. Can only be used whenresource_types
isINSTANCE
.
- create
Rule Property Map - See the
create_rule
block. Max of 1 per schedule. - name String
- retain
Rule Property Map - Boolean
- cross
Region List<Property Map>Copy Rules - See the
cross_region_copy_rule
block. Max of 3 per schedule. - deprecate
Rule Property Map - fast
Restore Property MapRule - See the
fast_restore_rule
block. Max of 1 per schedule. - Property Map
- See the
share_rule
block. Max of 1 per schedule. - Map<String>
- A map of tag keys and their values. DLM lifecycle policies will already tag the snapshot with the tags on the volume. This configuration adds extra tags on top of these.
- Map<String>
- A map of tag keys and variable values, where the values are determined when the policy is executed. Only
$(instance-id)
or$(timestamp)
are valid values. Can only be used whenresource_types
isINSTANCE
.
LifecyclePolicyPolicyDetailsScheduleCreateRule, LifecyclePolicyPolicyDetailsScheduleCreateRuleArgs
- Cron
Expression string - The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. Conflicts with
interval
,interval_unit
, andtimes
. - Interval int
- Interval
Unit string - Location string
- Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify
CLOUD
. To create snapshots on the same Outpost as the source resource, specifyOUTPOST_LOCAL
. If you omit this parameter,CLOUD
is used by default. If the policy targets resources in an AWS Region, then you must create snapshots in the same Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost. Valid values areCLOUD
andOUTPOST_LOCAL
. - Times string
- A list of times in 24 hour clock format that sets when the lifecycle policy should be evaluated. Max of 1. Conflicts with
cron_expression
. Must be set ifinterval
is set.
- Cron
Expression string - The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. Conflicts with
interval
,interval_unit
, andtimes
. - Interval int
- Interval
Unit string - Location string
- Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify
CLOUD
. To create snapshots on the same Outpost as the source resource, specifyOUTPOST_LOCAL
. If you omit this parameter,CLOUD
is used by default. If the policy targets resources in an AWS Region, then you must create snapshots in the same Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost. Valid values areCLOUD
andOUTPOST_LOCAL
. - Times string
- A list of times in 24 hour clock format that sets when the lifecycle policy should be evaluated. Max of 1. Conflicts with
cron_expression
. Must be set ifinterval
is set.
- cron
Expression String - The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. Conflicts with
interval
,interval_unit
, andtimes
. - interval Integer
- interval
Unit String - location String
- Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify
CLOUD
. To create snapshots on the same Outpost as the source resource, specifyOUTPOST_LOCAL
. If you omit this parameter,CLOUD
is used by default. If the policy targets resources in an AWS Region, then you must create snapshots in the same Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost. Valid values areCLOUD
andOUTPOST_LOCAL
. - times String
- A list of times in 24 hour clock format that sets when the lifecycle policy should be evaluated. Max of 1. Conflicts with
cron_expression
. Must be set ifinterval
is set.
- cron
Expression string - The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. Conflicts with
interval
,interval_unit
, andtimes
. - interval number
- interval
Unit string - location string
- Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify
CLOUD
. To create snapshots on the same Outpost as the source resource, specifyOUTPOST_LOCAL
. If you omit this parameter,CLOUD
is used by default. If the policy targets resources in an AWS Region, then you must create snapshots in the same Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost. Valid values areCLOUD
andOUTPOST_LOCAL
. - times string
- A list of times in 24 hour clock format that sets when the lifecycle policy should be evaluated. Max of 1. Conflicts with
cron_expression
. Must be set ifinterval
is set.
- cron_
expression str - The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. Conflicts with
interval
,interval_unit
, andtimes
. - interval int
- interval_
unit str - location str
- Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify
CLOUD
. To create snapshots on the same Outpost as the source resource, specifyOUTPOST_LOCAL
. If you omit this parameter,CLOUD
is used by default. If the policy targets resources in an AWS Region, then you must create snapshots in the same Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost. Valid values areCLOUD
andOUTPOST_LOCAL
. - times str
- A list of times in 24 hour clock format that sets when the lifecycle policy should be evaluated. Max of 1. Conflicts with
cron_expression
. Must be set ifinterval
is set.
- cron
Expression String - The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. Conflicts with
interval
,interval_unit
, andtimes
. - interval Number
- interval
Unit String - location String
- Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify
CLOUD
. To create snapshots on the same Outpost as the source resource, specifyOUTPOST_LOCAL
. If you omit this parameter,CLOUD
is used by default. If the policy targets resources in an AWS Region, then you must create snapshots in the same Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost. Valid values areCLOUD
andOUTPOST_LOCAL
. - times String
- A list of times in 24 hour clock format that sets when the lifecycle policy should be evaluated. Max of 1. Conflicts with
cron_expression
. Must be set ifinterval
is set.
LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRule, LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleArgs
- encrypted Boolean
- target String
- cmk
Arn String - Boolean
- deprecate
Rule Property Map - retain
Rule Property Map
LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleDeprecateRule, LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleDeprecateRuleArgs
- Interval int
- Interval
Unit string
- Interval int
- Interval
Unit string
- interval Integer
- interval
Unit String
- interval number
- interval
Unit string
- interval int
- interval_
unit str
- interval Number
- interval
Unit String
LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRule, LifecyclePolicyPolicyDetailsScheduleCrossRegionCopyRuleRetainRuleArgs
- Interval int
- Interval
Unit string
- Interval int
- Interval
Unit string
- interval Integer
- interval
Unit String
- interval number
- interval
Unit string
- interval int
- interval_
unit str
- interval Number
- interval
Unit String
LifecyclePolicyPolicyDetailsScheduleDeprecateRule, LifecyclePolicyPolicyDetailsScheduleDeprecateRuleArgs
- Count int
- Interval int
- Interval
Unit string
- Count int
- Interval int
- Interval
Unit string
- count Integer
- interval Integer
- interval
Unit String
- count number
- interval number
- interval
Unit string
- count int
- interval int
- interval_
unit str
- count Number
- interval Number
- interval
Unit String
LifecyclePolicyPolicyDetailsScheduleFastRestoreRule, LifecyclePolicyPolicyDetailsScheduleFastRestoreRuleArgs
- Availability
Zones List<string> - The Availability Zones in which to enable fast snapshot restore.
- Count int
- Interval int
- Interval
Unit string
- Availability
Zones []string - The Availability Zones in which to enable fast snapshot restore.
- Count int
- Interval int
- Interval
Unit string
- availability
Zones List<String> - The Availability Zones in which to enable fast snapshot restore.
- count Integer
- interval Integer
- interval
Unit String
- availability
Zones string[] - The Availability Zones in which to enable fast snapshot restore.
- count number
- interval number
- interval
Unit string
- availability_
zones Sequence[str] - The Availability Zones in which to enable fast snapshot restore.
- count int
- interval int
- interval_
unit str
- availability
Zones List<String> - The Availability Zones in which to enable fast snapshot restore.
- count Number
- interval Number
- interval
Unit String
LifecyclePolicyPolicyDetailsScheduleRetainRule, LifecyclePolicyPolicyDetailsScheduleRetainRuleArgs
- Count int
- Interval int
- Interval
Unit string
- Count int
- Interval int
- Interval
Unit string
- count Integer
- interval Integer
- interval
Unit String
- count number
- interval number
- interval
Unit string
- count int
- interval int
- interval_
unit str
- count Number
- interval Number
- interval
Unit String
LifecyclePolicyPolicyDetailsScheduleShareRule, LifecyclePolicyPolicyDetailsScheduleShareRuleArgs
- Target
Accounts List<string> - The IDs of the AWS accounts with which to share the snapshots.
- int
- The period after which snapshots that are shared with other AWS accounts are automatically unshared.
- string
- The unit of time for the automatic unsharing interval. Valid values are
DAYS
,WEEKS
,MONTHS
,YEARS
.
- Target
Accounts []string - The IDs of the AWS accounts with which to share the snapshots.
- int
- The period after which snapshots that are shared with other AWS accounts are automatically unshared.
- string
- The unit of time for the automatic unsharing interval. Valid values are
DAYS
,WEEKS
,MONTHS
,YEARS
.
- target
Accounts List<String> - The IDs of the AWS accounts with which to share the snapshots.
- Integer
- The period after which snapshots that are shared with other AWS accounts are automatically unshared.
- String
- The unit of time for the automatic unsharing interval. Valid values are
DAYS
,WEEKS
,MONTHS
,YEARS
.
- target
Accounts string[] - The IDs of the AWS accounts with which to share the snapshots.
- number
- The period after which snapshots that are shared with other AWS accounts are automatically unshared.
- string
- The unit of time for the automatic unsharing interval. Valid values are
DAYS
,WEEKS
,MONTHS
,YEARS
.
- target_
accounts Sequence[str] - The IDs of the AWS accounts with which to share the snapshots.
- int
- The period after which snapshots that are shared with other AWS accounts are automatically unshared.
- str
- The unit of time for the automatic unsharing interval. Valid values are
DAYS
,WEEKS
,MONTHS
,YEARS
.
- target
Accounts List<String> - The IDs of the AWS accounts with which to share the snapshots.
- Number
- The period after which snapshots that are shared with other AWS accounts are automatically unshared.
- String
- The unit of time for the automatic unsharing interval. Valid values are
DAYS
,WEEKS
,MONTHS
,YEARS
.
Import
Using pulumi import
, import DLM lifecycle policies using their policy ID. For example:
$ pulumi import aws:dlm/lifecyclePolicy:LifecyclePolicy example policy-abcdef12345678901
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.