CfnLifecyclePolicy L1 construct
Specifies a lifecycle policy, which is used to automate operations on Amazon EBS resources.
The properties are required when you add a lifecycle policy and optional when you update a lifecycle policy.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_dlm as dlm } from 'aws-cdk-lib';
const cfnLifecyclePolicy = new dlm.CfnLifecyclePolicy(this, 'MyCfnLifecyclePolicy', /* all optional props */ {
copyTags: false,
createInterval: 123,
crossRegionCopyTargets: [{
targetRegion: 'targetRegion',
}],
defaultPolicy: 'defaultPolicy',
description: 'description',
exclusions: {
excludeBootVolumes: false,
excludeTags: [{
key: 'key',
value: 'value',
}],
excludeVolumeTypes: ['excludeVolumeTypes'],
},
executionRoleArn: 'executionRoleArn',
extendDeletion: false,
policyDetails: {
actions: [{
crossRegionCopy: [{
encryptionConfiguration: {
encrypted: false,
// the properties below are optional
cmkArn: 'cmkArn',
},
target: 'target',
// the properties below are optional
retainRule: {
interval: 123,
intervalUnit: 'intervalUnit',
},
}],
name: 'name',
}],
copyTags: false,
createInterval: 123,
crossRegionCopyTargets: [{
targetRegion: 'targetRegion',
}],
eventSource: {
type: 'type',
// the properties below are optional
parameters: {
eventType: 'eventType',
snapshotOwner: ['snapshotOwner'],
// the properties below are optional
descriptionRegex: 'descriptionRegex',
},
},
exclusions: {
excludeBootVolumes: false,
excludeTags: [{
key: 'key',
value: 'value',
}],
excludeVolumeTypes: ['excludeVolumeTypes'],
},
extendDeletion: false,
parameters: {
excludeBootVolume: false,
excludeDataVolumeTags: [{
key: 'key',
value: 'value',
}],
noReboot: false,
},
policyLanguage: 'policyLanguage',
policyType: 'policyType',
resourceLocations: ['resourceLocations'],
resourceType: 'resourceType',
resourceTypes: ['resourceTypes'],
retainInterval: 123,
schedules: [{
archiveRule: {
retainRule: {
retentionArchiveTier: {
count: 123,
interval: 123,
intervalUnit: 'intervalUnit',
},
},
},
copyTags: false,
createRule: {
cronExpression: 'cronExpression',
interval: 123,
intervalUnit: 'intervalUnit',
location: 'location',
scripts: [{
executeOperationOnScriptFailure: false,
executionHandler: 'executionHandler',
executionHandlerService: 'executionHandlerService',
executionTimeout: 123,
maximumRetryCount: 123,
stages: ['stages'],
}],
times: ['times'],
},
crossRegionCopyRules: [{
encrypted: false,
// the properties below are optional
cmkArn: 'cmkArn',
copyTags: false,
deprecateRule: {
interval: 123,
intervalUnit: 'intervalUnit',
},
retainRule: {
interval: 123,
intervalUnit: 'intervalUnit',
},
target: 'target',
targetRegion: 'targetRegion',
}],
deprecateRule: {
count: 123,
interval: 123,
intervalUnit: 'intervalUnit',
},
fastRestoreRule: {
availabilityZoneIds: ['availabilityZoneIds'],
availabilityZones: ['availabilityZones'],
count: 123,
interval: 123,
intervalUnit: 'intervalUnit',
},
name: 'name',
retainRule: {
count: 123,
interval: 123,
intervalUnit: 'intervalUnit',
},
shareRules: [{
targetAccounts: ['targetAccounts'],
unshareInterval: 123,
unshareIntervalUnit: 'unshareIntervalUnit',
}],
tagsToAdd: [{
key: 'key',
value: 'value',
}],
variableTags: [{
key: 'key',
value: 'value',
}],
}],
targetTags: [{
key: 'key',
value: 'value',
}],
},
retainInterval: 123,
state: 'state',
tags: [{
key: 'key',
value: 'value',
}],
});
from aws_cdk import CfnTag, CfnTag, CfnTag, CfnTag, CfnTag, CfnTag, CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_dlm as dlm
cfn_lifecycle_policy = dlm.CfnLifecyclePolicy(self, "MyCfnLifecyclePolicy",
copy_tags=False,
create_interval=123,
cross_region_copy_targets=[dlm.CfnLifecyclePolicy.CrossRegionCopyTargetProperty(
target_region="targetRegion"
)],
default_policy="defaultPolicy",
description="description",
exclusions=dlm.CfnLifecyclePolicy.ExclusionsProperty(
exclude_boot_volumes=False,
exclude_tags=[CfnTag(
key="key",
value="value"
)],
exclude_volume_types=["excludeVolumeTypes"]
),
execution_role_arn="executionRoleArn",
extend_deletion=False,
policy_details=dlm.CfnLifecyclePolicy.PolicyDetailsProperty(
actions=[dlm.CfnLifecyclePolicy.ActionProperty(
cross_region_copy=[dlm.CfnLifecyclePolicy.CrossRegionCopyActionProperty(
encryption_configuration=dlm.CfnLifecyclePolicy.EncryptionConfigurationProperty(
encrypted=False,
# the properties below are optional
cmk_arn="cmkArn"
),
target="target",
# the properties below are optional
retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
interval=123,
interval_unit="intervalUnit"
)
)],
name="name"
)],
copy_tags=False,
create_interval=123,
cross_region_copy_targets=[dlm.CfnLifecyclePolicy.CrossRegionCopyTargetProperty(
target_region="targetRegion"
)],
event_source=dlm.CfnLifecyclePolicy.EventSourceProperty(
type="type",
# the properties below are optional
parameters=dlm.CfnLifecyclePolicy.EventParametersProperty(
event_type="eventType",
snapshot_owner=["snapshotOwner"],
# the properties below are optional
description_regex="descriptionRegex"
)
),
exclusions=dlm.CfnLifecyclePolicy.ExclusionsProperty(
exclude_boot_volumes=False,
exclude_tags=[CfnTag(
key="key",
value="value"
)],
exclude_volume_types=["excludeVolumeTypes"]
),
extend_deletion=False,
parameters=dlm.CfnLifecyclePolicy.ParametersProperty(
exclude_boot_volume=False,
exclude_data_volume_tags=[CfnTag(
key="key",
value="value"
)],
no_reboot=False
),
policy_language="policyLanguage",
policy_type="policyType",
resource_locations=["resourceLocations"],
resource_type="resourceType",
resource_types=["resourceTypes"],
retain_interval=123,
schedules=[dlm.CfnLifecyclePolicy.ScheduleProperty(
archive_rule=dlm.CfnLifecyclePolicy.ArchiveRuleProperty(
retain_rule=dlm.CfnLifecyclePolicy.ArchiveRetainRuleProperty(
retention_archive_tier=dlm.CfnLifecyclePolicy.RetentionArchiveTierProperty(
count=123,
interval=123,
interval_unit="intervalUnit"
)
)
),
copy_tags=False,
create_rule=dlm.CfnLifecyclePolicy.CreateRuleProperty(
cron_expression="cronExpression",
interval=123,
interval_unit="intervalUnit",
location="location",
scripts=[dlm.CfnLifecyclePolicy.ScriptProperty(
execute_operation_on_script_failure=False,
execution_handler="executionHandler",
execution_handler_service="executionHandlerService",
execution_timeout=123,
maximum_retry_count=123,
stages=["stages"]
)],
times=["times"]
),
cross_region_copy_rules=[dlm.CfnLifecyclePolicy.CrossRegionCopyRuleProperty(
encrypted=False,
# the properties below are optional
cmk_arn="cmkArn",
copy_tags=False,
deprecate_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty(
interval=123,
interval_unit="intervalUnit"
),
retain_rule=dlm.CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty(
interval=123,
interval_unit="intervalUnit"
),
target="target",
target_region="targetRegion"
)],
deprecate_rule=dlm.CfnLifecyclePolicy.DeprecateRuleProperty(
count=123,
interval=123,
interval_unit="intervalUnit"
),
fast_restore_rule=dlm.CfnLifecyclePolicy.FastRestoreRuleProperty(
availability_zone_ids=["availabilityZoneIds"],
availability_zones=["availabilityZones"],
count=123,
interval=123,
interval_unit="intervalUnit"
),
name="name",
retain_rule=dlm.CfnLifecyclePolicy.RetainRuleProperty(
count=123,
interval=123,
interval_unit="intervalUnit"
),
share_rules=[dlm.CfnLifecyclePolicy.ShareRuleProperty(
target_accounts=["targetAccounts"],
unshare_interval=123,
unshare_interval_unit="unshareIntervalUnit"
)],
tags_to_add=[CfnTag(
key="key",
value="value"
)],
variable_tags=[CfnTag(
key="key",
value="value"
)]
)],
target_tags=[CfnTag(
key="key",
value="value"
)]
),
retain_interval=123,
state="state",
tags=[CfnTag(
key="key",
value="value"
)]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.dlm.*;
CfnLifecyclePolicy cfnLifecyclePolicy = CfnLifecyclePolicy.Builder.create(this, "MyCfnLifecyclePolicy")
.copyTags(false)
.createInterval(123)
.crossRegionCopyTargets(List.of(CrossRegionCopyTargetProperty.builder()
.targetRegion("targetRegion")
.build()))
.defaultPolicy("defaultPolicy")
.description("description")
.exclusions(ExclusionsProperty.builder()
.excludeBootVolumes(false)
.excludeTags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.excludeVolumeTypes(List.of("excludeVolumeTypes"))
.build())
.executionRoleArn("executionRoleArn")
.extendDeletion(false)
.policyDetails(PolicyDetailsProperty.builder()
.actions(List.of(ActionProperty.builder()
.crossRegionCopy(List.of(CrossRegionCopyActionProperty.builder()
.encryptionConfiguration(EncryptionConfigurationProperty.builder()
.encrypted(false)
// the properties below are optional
.cmkArn("cmkArn")
.build())
.target("target")
// the properties below are optional
.retainRule(CrossRegionCopyRetainRuleProperty.builder()
.interval(123)
.intervalUnit("intervalUnit")
.build())
.build()))
.name("name")
.build()))
.copyTags(false)
.createInterval(123)
.crossRegionCopyTargets(List.of(CrossRegionCopyTargetProperty.builder()
.targetRegion("targetRegion")
.build()))
.eventSource(EventSourceProperty.builder()
.type("type")
// the properties below are optional
.parameters(EventParametersProperty.builder()
.eventType("eventType")
.snapshotOwner(List.of("snapshotOwner"))
// the properties below are optional
.descriptionRegex("descriptionRegex")
.build())
.build())
.exclusions(ExclusionsProperty.builder()
.excludeBootVolumes(false)
.excludeTags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.excludeVolumeTypes(List.of("excludeVolumeTypes"))
.build())
.extendDeletion(false)
.parameters(ParametersProperty.builder()
.excludeBootVolume(false)
.excludeDataVolumeTags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.noReboot(false)
.build())
.policyLanguage("policyLanguage")
.policyType("policyType")
.resourceLocations(List.of("resourceLocations"))
.resourceType("resourceType")
.resourceTypes(List.of("resourceTypes"))
.retainInterval(123)
.schedules(List.of(ScheduleProperty.builder()
.archiveRule(ArchiveRuleProperty.builder()
.retainRule(ArchiveRetainRuleProperty.builder()
.retentionArchiveTier(RetentionArchiveTierProperty.builder()
.count(123)
.interval(123)
.intervalUnit("intervalUnit")
.build())
.build())
.build())
.copyTags(false)
.createRule(CreateRuleProperty.builder()
.cronExpression("cronExpression")
.interval(123)
.intervalUnit("intervalUnit")
.location("location")
.scripts(List.of(ScriptProperty.builder()
.executeOperationOnScriptFailure(false)
.executionHandler("executionHandler")
.executionHandlerService("executionHandlerService")
.executionTimeout(123)
.maximumRetryCount(123)
.stages(List.of("stages"))
.build()))
.times(List.of("times"))
.build())
.crossRegionCopyRules(List.of(CrossRegionCopyRuleProperty.builder()
.encrypted(false)
// the properties below are optional
.cmkArn("cmkArn")
.copyTags(false)
.deprecateRule(CrossRegionCopyDeprecateRuleProperty.builder()
.interval(123)
.intervalUnit("intervalUnit")
.build())
.retainRule(CrossRegionCopyRetainRuleProperty.builder()
.interval(123)
.intervalUnit("intervalUnit")
.build())
.target("target")
.targetRegion("targetRegion")
.build()))
.deprecateRule(DeprecateRuleProperty.builder()
.count(123)
.interval(123)
.intervalUnit("intervalUnit")
.build())
.fastRestoreRule(FastRestoreRuleProperty.builder()
.availabilityZoneIds(List.of("availabilityZoneIds"))
.availabilityZones(List.of("availabilityZones"))
.count(123)
.interval(123)
.intervalUnit("intervalUnit")
.build())
.name("name")
.retainRule(RetainRuleProperty.builder()
.count(123)
.interval(123)
.intervalUnit("intervalUnit")
.build())
.shareRules(List.of(ShareRuleProperty.builder()
.targetAccounts(List.of("targetAccounts"))
.unshareInterval(123)
.unshareIntervalUnit("unshareIntervalUnit")
.build()))
.tagsToAdd(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.variableTags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build()))
.targetTags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build())
.retainInterval(123)
.state("state")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DLM;
var cfnLifecyclePolicy = new CfnLifecyclePolicy(this, "MyCfnLifecyclePolicy", new CfnLifecyclePolicyProps {
CopyTags = false,
CreateInterval = 123,
CrossRegionCopyTargets = new [] { new CrossRegionCopyTargetProperty {
TargetRegion = "targetRegion"
} },
DefaultPolicy = "defaultPolicy",
Description = "description",
Exclusions = new ExclusionsProperty {
ExcludeBootVolumes = false,
ExcludeTags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
ExcludeVolumeTypes = new [] { "excludeVolumeTypes" }
},
ExecutionRoleArn = "executionRoleArn",
ExtendDeletion = false,
PolicyDetails = new PolicyDetailsProperty {
Actions = new [] { new ActionProperty {
CrossRegionCopy = new [] { new CrossRegionCopyActionProperty {
EncryptionConfiguration = new EncryptionConfigurationProperty {
Encrypted = false,
// the properties below are optional
CmkArn = "cmkArn"
},
Target = "target",
// the properties below are optional
RetainRule = new CrossRegionCopyRetainRuleProperty {
Interval = 123,
IntervalUnit = "intervalUnit"
}
} },
Name = "name"
} },
CopyTags = false,
CreateInterval = 123,
CrossRegionCopyTargets = new [] { new CrossRegionCopyTargetProperty {
TargetRegion = "targetRegion"
} },
EventSource = new EventSourceProperty {
Type = "type",
// the properties below are optional
Parameters = new EventParametersProperty {
EventType = "eventType",
SnapshotOwner = new [] { "snapshotOwner" },
// the properties below are optional
DescriptionRegex = "descriptionRegex"
}
},
Exclusions = new ExclusionsProperty {
ExcludeBootVolumes = false,
ExcludeTags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
ExcludeVolumeTypes = new [] { "excludeVolumeTypes" }
},
ExtendDeletion = false,
Parameters = new ParametersProperty {
ExcludeBootVolume = false,
ExcludeDataVolumeTags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
NoReboot = false
},
PolicyLanguage = "policyLanguage",
PolicyType = "policyType",
ResourceLocations = new [] { "resourceLocations" },
ResourceType = "resourceType",
ResourceTypes = new [] { "resourceTypes" },
RetainInterval = 123,
Schedules = new [] { new ScheduleProperty {
ArchiveRule = new ArchiveRuleProperty {
RetainRule = new ArchiveRetainRuleProperty {
RetentionArchiveTier = new RetentionArchiveTierProperty {
Count = 123,
Interval = 123,
IntervalUnit = "intervalUnit"
}
}
},
CopyTags = false,
CreateRule = new CreateRuleProperty {
CronExpression = "cronExpression",
Interval = 123,
IntervalUnit = "intervalUnit",
Location = "location",
Scripts = new [] { new ScriptProperty {
ExecuteOperationOnScriptFailure = false,
ExecutionHandler = "executionHandler",
ExecutionHandlerService = "executionHandlerService",
ExecutionTimeout = 123,
MaximumRetryCount = 123,
Stages = new [] { "stages" }
} },
Times = new [] { "times" }
},
CrossRegionCopyRules = new [] { new CrossRegionCopyRuleProperty {
Encrypted = false,
// the properties below are optional
CmkArn = "cmkArn",
CopyTags = false,
DeprecateRule = new CrossRegionCopyDeprecateRuleProperty {
Interval = 123,
IntervalUnit = "intervalUnit"
},
RetainRule = new CrossRegionCopyRetainRuleProperty {
Interval = 123,
IntervalUnit = "intervalUnit"
},
Target = "target",
TargetRegion = "targetRegion"
} },
DeprecateRule = new DeprecateRuleProperty {
Count = 123,
Interval = 123,
IntervalUnit = "intervalUnit"
},
FastRestoreRule = new FastRestoreRuleProperty {
AvailabilityZoneIds = new [] { "availabilityZoneIds" },
AvailabilityZones = new [] { "availabilityZones" },
Count = 123,
Interval = 123,
IntervalUnit = "intervalUnit"
},
Name = "name",
RetainRule = new RetainRuleProperty {
Count = 123,
Interval = 123,
IntervalUnit = "intervalUnit"
},
ShareRules = new [] { new ShareRuleProperty {
TargetAccounts = new [] { "targetAccounts" },
UnshareInterval = 123,
UnshareIntervalUnit = "unshareIntervalUnit"
} },
TagsToAdd = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
VariableTags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
} },
TargetTags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
},
RetainInterval = 123,
State = "state",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnLifecyclePolicy := awscdk.Aws_dlm.NewCfnLifecyclePolicy(this, jsii.String("MyCfnLifecyclePolicy"), &CfnLifecyclePolicyProps{
CopyTags: jsii.Boolean(false),
CreateInterval: jsii.Number(123),
CrossRegionCopyTargets: []interface{}{
&CrossRegionCopyTargetProperty{
TargetRegion: jsii.String("targetRegion"),
},
},
DefaultPolicy: jsii.String("defaultPolicy"),
Description: jsii.String("description"),
Exclusions: &ExclusionsProperty{
ExcludeBootVolumes: jsii.Boolean(false),
ExcludeTags: []interface{}{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
ExcludeVolumeTypes: []*string{
jsii.String("excludeVolumeTypes"),
},
},
ExecutionRoleArn: jsii.String("executionRoleArn"),
ExtendDeletion: jsii.Boolean(false),
PolicyDetails: &PolicyDetailsProperty{
Actions: []interface{}{
&ActionProperty{
CrossRegionCopy: []interface{}{
&CrossRegionCopyActionProperty{
EncryptionConfiguration: &EncryptionConfigurationProperty{
Encrypted: jsii.Boolean(false),
// the properties below are optional
CmkArn: jsii.String("cmkArn"),
},
Target: jsii.String("target"),
// the properties below are optional
RetainRule: &CrossRegionCopyRetainRuleProperty{
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
},
},
},
Name: jsii.String("name"),
},
},
CopyTags: jsii.Boolean(false),
CreateInterval: jsii.Number(123),
CrossRegionCopyTargets: []interface{}{
&CrossRegionCopyTargetProperty{
TargetRegion: jsii.String("targetRegion"),
},
},
EventSource: &EventSourceProperty{
Type: jsii.String("type"),
// the properties below are optional
Parameters: &EventParametersProperty{
EventType: jsii.String("eventType"),
SnapshotOwner: []*string{
jsii.String("snapshotOwner"),
},
// the properties below are optional
DescriptionRegex: jsii.String("descriptionRegex"),
},
},
Exclusions: &ExclusionsProperty{
ExcludeBootVolumes: jsii.Boolean(false),
ExcludeTags: []interface{}{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
ExcludeVolumeTypes: []*string{
jsii.String("excludeVolumeTypes"),
},
},
ExtendDeletion: jsii.Boolean(false),
Parameters: &ParametersProperty{
ExcludeBootVolume: jsii.Boolean(false),
ExcludeDataVolumeTags: []interface{}{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
NoReboot: jsii.Boolean(false),
},
PolicyLanguage: jsii.String("policyLanguage"),
PolicyType: jsii.String("policyType"),
ResourceLocations: []*string{
jsii.String("resourceLocations"),
},
ResourceType: jsii.String("resourceType"),
ResourceTypes: []*string{
jsii.String("resourceTypes"),
},
RetainInterval: jsii.Number(123),
Schedules: []interface{}{
&ScheduleProperty{
ArchiveRule: &ArchiveRuleProperty{
RetainRule: &ArchiveRetainRuleProperty{
RetentionArchiveTier: &RetentionArchiveTierProperty{
Count: jsii.Number(123),
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
},
},
},
CopyTags: jsii.Boolean(false),
CreateRule: &CreateRuleProperty{
CronExpression: jsii.String("cronExpression"),
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
Location: jsii.String("location"),
Scripts: []interface{}{
&ScriptProperty{
ExecuteOperationOnScriptFailure: jsii.Boolean(false),
ExecutionHandler: jsii.String("executionHandler"),
ExecutionHandlerService: jsii.String("executionHandlerService"),
ExecutionTimeout: jsii.Number(123),
MaximumRetryCount: jsii.Number(123),
Stages: []*string{
jsii.String("stages"),
},
},
},
Times: []*string{
jsii.String("times"),
},
},
CrossRegionCopyRules: []interface{}{
&CrossRegionCopyRuleProperty{
Encrypted: jsii.Boolean(false),
// the properties below are optional
CmkArn: jsii.String("cmkArn"),
CopyTags: jsii.Boolean(false),
DeprecateRule: &CrossRegionCopyDeprecateRuleProperty{
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
},
RetainRule: &CrossRegionCopyRetainRuleProperty{
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
},
Target: jsii.String("target"),
TargetRegion: jsii.String("targetRegion"),
},
},
DeprecateRule: &DeprecateRuleProperty{
Count: jsii.Number(123),
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
},
FastRestoreRule: &FastRestoreRuleProperty{
AvailabilityZoneIds: []*string{
jsii.String("availabilityZoneIds"),
},
AvailabilityZones: []*string{
jsii.String("availabilityZones"),
},
Count: jsii.Number(123),
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
},
Name: jsii.String("name"),
RetainRule: &RetainRuleProperty{
Count: jsii.Number(123),
Interval: jsii.Number(123),
IntervalUnit: jsii.String("intervalUnit"),
},
ShareRules: []interface{}{
&ShareRuleProperty{
TargetAccounts: []*string{
jsii.String("targetAccounts"),
},
UnshareInterval: jsii.Number(123),
UnshareIntervalUnit: jsii.String("unshareIntervalUnit"),
},
},
TagsToAdd: []interface{}{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
VariableTags: []interface{}{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
},
},
TargetTags: []interface{}{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
},
RetainInterval: jsii.Number(123),
State: jsii.String("state"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
})
Initializer
new CfnLifecyclePolicy(scope: Construct, id: string, props?: CfnLifecyclePolicyProps)
CfnLifecyclePolicy(scope: Construct, id: str, props: typing.Optional[CfnLifecyclePolicyProps] = None)
new CfnLifecyclePolicy(Construct scope, String id, CfnLifecyclePolicyProps props)
new CfnLifecyclePolicy(Construct scope, string id, CfnLifecyclePolicyProps? props = null)
NewCfnLifecyclePolicy(Scope Construct, Id *string, Props CfnLifecyclePolicyProps)
Construct Props
copyTagsoptionalboolean | IResolvablecopy_tagsoptionaltyping.Union[bool, IResolvable]copyTagsoptionalBooleanCopyTagsoptionalboolCopyTagsoptionalinterface{}#If you do not specify a value, the default is false .
Default: false
createIntervaloptionalnumbercreate_intervaloptionalint | floatcreateIntervaloptionalNumberCreateIntervaloptionaldoubleCreateIntervaloptional*float64#The creation frequency can range from 1 to 7 days. If you do not specify a value, the default is 1.
Default: 1
crossRegionCopyTargetsoptionalIResolvable | IResolvable | CfnLifecyclePolicy.CrossRegionCopyTargetProperty[]cross_region_copy_targetsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CrossRegionCopyTargetProperty]]]crossRegionCopyTargetsoptionalIResolvableCrossRegionCopyTargetsoptionalIResolvableCrossRegionCopyTargetsoptionalinterface{}#You can specify up to 3 destination Regions. If you do not want to create cross-Region copies, omit this parameter.
defaultPolicyoptionalstringdefault_policyoptionalstrdefaultPolicyoptionalStringDefaultPolicyoptionalstringDefaultPolicyoptional*string#notes
- To create a default policy for EBS snapshots, that creates snapshots of all volumes in the Region that do not have recent backups, specify
VOLUME. - To create a default policy for EBS-backed AMIs, that creates EBS-backed AMIs from all instances in the Region that do not have recent backups, specify
INSTANCE.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#The characters ^[0-9A-Za-z _-]+$ are supported.
exclusionsoptionalIResolvable | CfnLifecyclePolicy.ExclusionsPropertyexclusionsoptionaltyping.Union[IResolvable, ExclusionsProperty]exclusionsoptionalIResolvableExclusionsoptionalIResolvableExclusionsoptionalinterface{}#The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.
executionRoleArnoptionalstringexecution_role_arnoptionalstrexecutionRoleArnoptionalStringExecutionRoleArnoptionalstringExecutionRoleArnoptional*string#extendDeletionoptionalboolean | IResolvableextend_deletionoptionaltyping.Union[bool, IResolvable]extendDeletionoptionalBooleanExtendDeletionoptionalboolExtendDeletionoptionalinterface{}#notes
By default ( ExtendDeletion=false ):
- If a source resource is deleted, Amazon Data Lifecycle Manager will continue to delete previously created snapshots or AMIs, up to but not including the last one, based on the specified retention period. If you want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, including the last one, specify
true. - If a policy enters the error, disabled, or deleted state, Amazon Data Lifecycle Manager stops deleting snapshots and AMIs. If you want Amazon Data Lifecycle Manager to continue deleting snapshots or AMIs, including the last one, if the policy enters one of these states, specify
true.
If you enable extended deletion ( ExtendDeletion=true ), you override both default behaviors simultaneously.
If you do not specify a value, the default is false .
Default: false
policyDetailsoptionalIResolvable | CfnLifecyclePolicy.PolicyDetailsPropertypolicy_detailsoptionaltyping.Union[IResolvable, PolicyDetailsProperty]policyDetailsoptionalIResolvablePolicyDetailsoptionalIResolvablePolicyDetailsoptionalinterface{}#If you create a default policy, you can specify the request parameters either in the request body, or in the PolicyDetails request structure, but not both.
retainIntervaloptionalnumberretain_intervaloptionalint | floatretainIntervaloptionalNumberRetainIntervaloptionaldoubleRetainIntervaloptional*float64#notes
The retention period can range from 2 to 14 days, but it must be greater than the creation frequency to ensure that the policy retains at least 1 snapshot or AMI at any given time. If you do not specify a value, the default is 7.
Default: 7
Properties
CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringrequiredstatic#cfnOptionsICfnResourceOptionscfn_optionsICfnResourceOptionscfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptionsrequired#cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*stringrequired#copyTagsmay be undefinedboolean | IResolvablecopy_tagsmay be undefinedtyping.Union[bool, IResolvable]copyTagsmay be undefinedBooleanCopyTagsmay be undefinedboolCopyTagsmay be undefinedinterface{}#createIntervalmay be undefinednumbercreate_intervalmay be undefinedint | floatcreateIntervalmay be undefinedNumberCreateIntervalmay be undefineddoubleCreateIntervalmay be undefined*float64#creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*stringrequired#crossRegionCopyTargetsmay be undefinedIResolvable | IResolvable | CfnLifecyclePolicy.CrossRegionCopyTargetProperty[]cross_region_copy_targetsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CrossRegionCopyTargetProperty]]]crossRegionCopyTargetsmay be undefinedIResolvableCrossRegionCopyTargetsmay be undefinedIResolvableCrossRegionCopyTargetsmay be undefinedinterface{}#defaultPolicymay be undefinedstringdefault_policymay be undefinedstrdefaultPolicymay be undefinedStringDefaultPolicymay be undefinedstringDefaultPolicymay be undefined*string#descriptionmay be undefinedstringdescriptionmay be undefinedstrdescriptionmay be undefinedStringDescriptionmay be undefinedstringDescriptionmay be undefined*string#exclusionsmay be undefinedIResolvable | CfnLifecyclePolicy.ExclusionsPropertyexclusionsmay be undefinedtyping.Union[IResolvable, ExclusionsProperty]exclusionsmay be undefinedIResolvableExclusionsmay be undefinedIResolvableExclusionsmay be undefinedinterface{}#executionRoleArnmay be undefinedstringexecution_role_arnmay be undefinedstrexecutionRoleArnmay be undefinedStringExecutionRoleArnmay be undefinedstringExecutionRoleArnmay be undefined*string#extendDeletionmay be undefinedboolean | IResolvableextend_deletionmay be undefinedtyping.Union[bool, IResolvable]extendDeletionmay be undefinedBooleanExtendDeletionmay be undefinedboolExtendDeletionmay be undefinedinterface{}#lifecyclePolicyRefLifecyclePolicyReferencelifecycle_policy_refLifecyclePolicyReferencelifecyclePolicyRefLifecyclePolicyReferenceLifecyclePolicyRefLifecyclePolicyReferenceLifecyclePolicyRefLifecyclePolicyReferencerequired#The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId).
policyDetailsmay be undefinedIResolvable | CfnLifecyclePolicy.PolicyDetailsPropertypolicy_detailsmay be undefinedtyping.Union[IResolvable, PolicyDetailsProperty]policyDetailsmay be undefinedIResolvablePolicyDetailsmay be undefinedIResolvablePolicyDetailsmay be undefinedinterface{}#If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).
retainIntervalmay be undefinednumberretain_intervalmay be undefinedint | floatretainIntervalmay be undefinedNumberRetainIntervalmay be undefineddoubleRetainIntervalmay be undefined*float64#CfnElements must be defined within a stack scope (directly or indirectly).
statemay be undefinedstringstatemay be undefinedstrstatemay be undefinedStringStatemay be undefinedstringStatemay be undefined*string#Methods
addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#1 parameter
Parameters
pathpathpathpathPath— The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.
addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.
addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#notes · 2 parameters
To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).
If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.
For example,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
would add the overrides
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.
Parameters
pathpathpathpathPath— - The path of the property, you can use dot notation to override values in complex types.valuevaluevaluevalueValue— - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#1 parameter
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#Syntactic sugar for addOverride("Properties.<...>", value).
2 parameters
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path of the property.valuevaluevaluevalueValue— The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.
1 parameter
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#notes
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:
arnForLifecyclePolicy(resource: ILifecyclePolicyRef): string@staticmethod def arn_for_lifecycle_policy(resource: ILifecyclePolicyRef) -> strpublic static String arnForLifecyclePolicy(ILifecyclePolicyRef resource)public static string ArnForLifecyclePolicy(ILifecyclePolicyRef resource)func ArnForLifecyclePolicy(Resource ILifecyclePolicyRef) *stringstatic#cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#fromLifecyclePolicyArn(scope: Construct, id: string, arn: string): ILifecyclePolicyRef@staticmethod def from_lifecycle_policy_arn(scope: Construct, id: str, arn: str) -> ILifecyclePolicyRefpublic static ILifecyclePolicyRef fromLifecyclePolicyArn(Construct scope, String id, String arn)public static ILifecyclePolicyRef FromLifecyclePolicyArn(Construct scope, string id, string arn)func FromLifecyclePolicyArn(Scope Construct, Id *string, Arn *string) ILifecyclePolicyRefstatic#fromPolicyId(scope: Construct, id: string, policyId: string): ILifecyclePolicyRef@staticmethod def from_policy_id(scope: Construct, id: str, policy_id: str) -> ILifecyclePolicyRefpublic static ILifecyclePolicyRef fromPolicyId(Construct scope, String id, String policyId)public static ILifecyclePolicyRef FromPolicyId(Construct scope, string id, string policyId)func FromPolicyId(Scope Construct, Id *string, PolicyId *string) ILifecyclePolicyRefstatic#getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference#Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.
1 parameter
Parameters
attributeNameattribute_nameattributeNameattributeNameAttributeName— The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#1 parameter
Parameters
inspectorinspectorinspectorinspectorInspector— tree inspector to collect and process attributes.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.
returns
Returns: The construct as a stack element or undefined if it is not a stack element.
isCfnLifecyclePolicy(x: any): boolean@staticmethod def is_cfn_lifecycle_policy(x: Any) -> boolpublic static Boolean isCfnLifecyclePolicy(Object x)public static bool IsCfnLifecyclePolicy(object x)func IsCfnLifecyclePolicy(X interface{}) *boolstatic#isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.
overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#1 parameter
Parameters
newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId— The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#2 parameters
Parameters
targettargettargettargetTarget— The dependency to replace.newTargetnew_targetnewTargetnewTargetNewTarget— The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#returns
Returns: a string representation of this resource
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.