Class CfnLifecyclePolicy.PolicyDetailsProperty
Specifies the configuration of a lifecycle policy.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.DLM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PolicyDetailsProperty : Object, CfnLifecyclePolicy.IPolicyDetailsProperty
Syntax (vb)
Public Class PolicyDetailsProperty
Inherits Object
Implements CfnLifecyclePolicy.IPolicyDetailsProperty
Remarks
ExampleMetadata: fixture=_generated
Examples
// 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 crossRegionCopyTargets;
var excludeTags;
var excludeVolumeTypes;
var policyDetailsProperty = 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 = crossRegionCopyTargets,
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 = excludeTags,
ExcludeVolumeTypes = 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 {
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"
} }
};
Synopsis
Constructors
PolicyDetailsProperty() |
Properties
Actions | [Event-based policies only] The actions to be performed when the event-based policy is activated. |
CopyTags | [Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI. |
CreateInterval | [Default policies only] Specifies how often the policy should run and create snapshots or AMIs. |
CrossRegionCopyTargets | [Default policies only] Specifies destination Regions for snapshot or AMI copies. |
EventSource | [Event-based policies only] The event that activates the event-based policy. |
Exclusions | [Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs. |
ExtendDeletion | [Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state. |
Parameters | [Custom snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies. |
PolicyLanguage | The type of policy to create. Specify one of the following:. |
PolicyType | The type of policy. |
ResourceLocations | [Custom snapshot and AMI policies only] The location of the resources to backup. |
ResourceType | [Default policies only] Specify the type of default policy to create. |
ResourceTypes | [Custom snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. |
RetainInterval | [Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them. |
Schedules | [Custom snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle policies. |
TargetTags | [Custom snapshot and AMI policies only] The single tag that identifies targeted resources for this policy. |
Constructors
PolicyDetailsProperty()
public PolicyDetailsProperty()
Properties
Actions
[Event-based policies only] The actions to be performed when the event-based policy is activated.
public object Actions { get; set; }
Property Value
System.Object
Remarks
You can specify only one action per policy.
CopyTags
[Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.
public object CopyTags { get; set; }
Property Value
System.Object
Remarks
If you do not specify a value, the default is false
.
Default: false
CreateInterval
[Default policies only] Specifies how often the policy should run and create snapshots or AMIs.
public Nullable<double> CreateInterval { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
The creation frequency can range from 1 to 7 days. If you do not specify a value, the default is 1.
Default: 1
CrossRegionCopyTargets
[Default policies only] Specifies destination Regions for snapshot or AMI copies.
public object CrossRegionCopyTargets { get; set; }
Property Value
System.Object
Remarks
You can specify up to 3 destination Regions. If you do not want to create cross-Region copies, omit this parameter.
EventSource
[Event-based policies only] The event that activates the event-based policy.
public object EventSource { get; set; }
Property Value
System.Object
Remarks
Exclusions
[Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs.
public object Exclusions { get; set; }
Property Value
System.Object
Remarks
The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.
ExtendDeletion
[Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.
public object ExtendDeletion { get; set; }
Property Value
System.Object
Remarks
By default ( ExtendDeletion=false ):
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
Parameters
[Custom snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies.
public object Parameters { get; set; }
Property Value
System.Object
Remarks
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.
PolicyLanguage
The type of policy to create. Specify one of the following:.
public string PolicyLanguage { get; set; }
Property Value
System.String
Remarks
PolicyType
The type of policy.
public string PolicyType { get; set; }
Property Value
System.String
Remarks
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
.
ResourceLocations
[Custom snapshot and AMI policies only] The location of the resources to backup.
public string[] ResourceLocations { get; set; }
Property Value
System.String[]
Remarks
If the source resources are located in an AWS Region , specify CLOUD
. If the source resources are located on an Outpost in your account, specify OUTPOST
.
If you specify OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account.
ResourceType
[Default policies only] Specify the type of default policy to create.
public string ResourceType { get; set; }
Property Value
System.String
Remarks
ResourceTypes
[Custom snapshot policies only] The target resource type for snapshot and AMI lifecycle policies.
public string[] ResourceTypes { get; set; }
Property Value
System.String[]
Remarks
Use VOLUME
to create snapshots of individual volumes or use INSTANCE
to create multi-volume snapshots from the volumes for an instance.
RetainInterval
[Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them.
public Nullable<double> RetainInterval { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
Schedules
[Custom snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle policies.
public object Schedules { get; set; }
Property Value
System.Object
Remarks
A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.
TargetTags
[Custom snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.
public object TargetTags { get; set; }
Property Value
System.Object