ScheduleProperty Struct
[Custom snapshot and AMI policies only] Specifies a schedule for a snapshot or AMI lifecycle policy.
| Source | |
|---|---|
| Type last changed |
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 scheduleProperty: dlm.CfnLifecyclePolicy.ScheduleProperty = {
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',
}],
};
from aws_cdk import 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
schedule_property = 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"
)]
)
// 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.*;
ScheduleProperty scheduleProperty = 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();
// 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 scheduleProperty = 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"
} }
};
// 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"
scheduleProperty := &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"),
},
},
}
Properties
archiveRuleoptionalIResolvable | CfnLifecyclePolicy.archive_ruleoptionaltyping.Union[IResolvable, ArchiveRuleProperty]archiveRuleoptionalIResolvableArchiveRuleoptionalIResolvableArchiveRuleoptionalinterface{} #notes
When you specify an archiving rule, snapshots are automatically moved from the standard tier to the archive tier once the schedule's retention threshold is met. Snapshots are then retained in the archive tier for the archive retention period that you specify.
For more information about using snapshot archiving, see Considerations for snapshot lifecycle policies .
copyTagsoptionalboolean | IResolvablecopy_tagsoptionaltyping.Union[bool, IResolvable]copyTagsoptionalBooleanCopyTagsoptionalboolCopyTagsoptionalinterface{} #createRuleoptionalIResolvable | CfnLifecyclePolicy.create_ruleoptionaltyping.Union[IResolvable, CreateRuleProperty]createRuleoptionalIResolvableCreateRuleoptionalIResolvableCreateRuleoptionalinterface{} #crossRegionCopyRulesoptionalIResolvable | IResolvable | CfnLifecyclePolicy.cross_region_copy_rulesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CrossRegionCopyRuleProperty]]]crossRegionCopyRulesoptionalIResolvableCrossRegionCopyRulesoptionalIResolvableCrossRegionCopyRulesoptionalinterface{} #You can't specify cross-Region copy rules for policies that create snapshots on an Outpost or in a Local Zone. If the policy creates snapshots in a Region, then snapshots can be copied to up to three Regions or Outposts.
deprecateRuleoptionalIResolvable | CfnLifecyclePolicy.deprecate_ruleoptionaltyping.Union[IResolvable, DeprecateRuleProperty]deprecateRuleoptionalIResolvableDeprecateRuleoptionalIResolvableDeprecateRuleoptionalinterface{} #fastRestoreRuleoptionalIResolvable | CfnLifecyclePolicy.fast_restore_ruleoptionaltyping.Union[IResolvable, FastRestoreRuleProperty]fastRestoreRuleoptionalIResolvableFastRestoreRuleoptionalIResolvableFastRestoreRuleoptionalinterface{} #retainRuleoptionalIResolvable | CfnLifecyclePolicy.retain_ruleoptionaltyping.Union[IResolvable, RetainRuleProperty]retainRuleoptionalIResolvableRetainRuleoptionalIResolvableRetainRuleoptionalinterface{} #tagsToAddoptionalIResolvable | IResolvable | CfnTag[]tags_to_addoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CfnTag]]]tagsToAddoptionalIResolvableTagsToAddoptionalIResolvableTagsToAddoptionalinterface{} #These user-defined tags are in addition to the AWS -added lifecycle tags.
variableTagsoptionalIResolvable | IResolvable | CfnTag[]variable_tagsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CfnTag]]]variableTagsoptionalIResolvableVariableTagsoptionalIResolvableVariableTagsoptionalinterface{} #Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: $(instance-id) or $(timestamp) . Variable tags are only valid for EBS Snapshot Management – Instance policies.