CfnLifecyclePolicyProps Struct
Properties for defining a CfnLifecyclePolicy.
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 cfnLifecyclePolicyProps: dlm.CfnLifecyclePolicyProps = {
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',
}],
};
Properties
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