PolicyDetailsProperty Struct
Specifies the configuration of 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 policyDetailsProperty: dlm.CfnLifecyclePolicy.PolicyDetailsProperty = {
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',
}],
};
Properties
actionsIResolvable | IResolvable | CfnLifecyclePolicy.ActionProperty[]actionstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ActionProperty]]]actionsIResolvableActionsIResolvableActionsinterface{}#You can specify only one action per policy.
copyTagsboolean | IResolvablecopy_tagstyping.Union[bool, IResolvable]copyTagsBooleanCopyTagsboolCopyTagsinterface{}#If you do not specify a value, the default is false .
Default: false
createIntervalnumbercreate_intervalint | floatcreateIntervalNumberCreateIntervaldoubleCreateInterval*float64#The creation frequency can range from 1 to 7 days. If you do not specify a value, the default is 1.
Default: 1
crossRegionCopyTargetsIResolvable | IResolvable | CfnLifecyclePolicy.CrossRegionCopyTargetProperty[]cross_region_copy_targetstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CrossRegionCopyTargetProperty]]]crossRegionCopyTargetsIResolvableCrossRegionCopyTargetsIResolvableCrossRegionCopyTargetsinterface{}#You can specify up to 3 destination Regions. If you do not want to create cross-Region copies, omit this parameter.
eventSourceIResolvable | CfnLifecyclePolicy.EventSourcePropertyevent_sourcetyping.Union[IResolvable, EventSourceProperty]eventSourceIResolvableEventSourceIResolvableEventSourceinterface{}#exclusionsIResolvable | CfnLifecyclePolicy.ExclusionsPropertyexclusionstyping.Union[IResolvable, ExclusionsProperty]exclusionsIResolvableExclusionsIResolvableExclusionsinterface{}#The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.
extendDeletionboolean | IResolvableextend_deletiontyping.Union[bool, IResolvable]extendDeletionBooleanExtendDeletionboolExtendDeletioninterface{}#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
parametersIResolvable | CfnLifecyclePolicy.ParametersPropertyparameterstyping.Union[IResolvable, ParametersProperty]parametersIResolvableParametersIResolvableParametersinterface{}#notes
If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle Manager console, then you must include this parameter and specify either the default values or the new values that you require. You can't omit this parameter or set its values to null.
policyLanguagestringpolicy_languagestrpolicyLanguageStringPolicyLanguagestringPolicyLanguage*string#SIMPLIFIEDTo create a default policy.STANDARDTo create a custom policy.
notes
Specify EBS_SNAPSHOT_MANAGEMENT to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify IMAGE_MANAGEMENT to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create an event-based policy that performs specific actions when a defined event occurs in your AWS account .
The default is EBS_SNAPSHOT_MANAGEMENT .
resourceLocationsstring[]resource_locationstyping.List[str]resourceLocationsList<String>ResourceLocationsstring[]ResourceLocations*[]*string#notes
- If the source resources are located in a Region, specify
CLOUD. In this case, the policy targets all resources of the specified type with matching target tags across all Availability Zones in the Region. - [Custom snapshot policies only] If the source resources are located in a Local Zone, specify
LOCAL_ZONE. In this case, the policy targets all resources of the specified type with matching target tags across all Local Zones in the Region. - If the source resources are located on an Outpost in your account, specify
OUTPOST. In this case, the policy targets all resources of the specified type with matching target tags across all of the Outposts in your account.
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.
resourceTypesstring[]resource_typestyping.List[str]resourceTypesList<String>ResourceTypesstring[]ResourceTypes*[]*string#Use VOLUME to create snapshots of individual volumes or use INSTANCE to create multi-volume snapshots from the volumes for an instance.
retainIntervalnumberretain_intervalint | floatretainIntervalNumberRetainIntervaldoubleRetainInterval*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
schedulesIResolvable | IResolvable | CfnLifecyclePolicy.ScheduleProperty[]schedulestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ScheduleProperty]]]schedulesIResolvableSchedulesIResolvableSchedulesinterface{}#A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.
targetTagsIResolvable | IResolvable | CfnTag[]target_tagstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CfnTag]]]targetTagsIResolvableTargetTagsIResolvableTargetTagsinterface{}#