@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-14T16:25:21.417Z") public class CfnLifecyclePolicy extends CfnResource implements IInspectable
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 software.amazon.awscdk.services.dlm.*; CfnLifecyclePolicy cfnLifecyclePolicy = CfnLifecyclePolicy.Builder.create(this, "MyCfnLifecyclePolicy") .description("description") .executionRoleArn("executionRoleArn") .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())) .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()) .parameters(ParametersProperty.builder() .excludeBootVolume(false) .excludeDataVolumeTags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .noReboot(false) .build()) .policyType("policyType") .resourceLocations(List.of("resourceLocations")) .resourceTypes(List.of("resourceTypes")) .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") .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() .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()) .state("state") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static interface |
CfnLifecyclePolicy.ActionProperty
*[Event-based policies only]* Specifies an action for an event-based policy.
|
static interface |
CfnLifecyclePolicy.ArchiveRetainRuleProperty
*[Snapshot policies only]* Specifies information about the archive storage tier retention period.
|
static interface |
CfnLifecyclePolicy.ArchiveRuleProperty
*[Snapshot policies only]* Specifies a snapshot archiving rule for a schedule.
|
static class |
CfnLifecyclePolicy.Builder
A fluent builder for
CfnLifecyclePolicy . |
static interface |
CfnLifecyclePolicy.CreateRuleProperty
*[Snapshot and AMI policies only]* Specifies when the policy should create snapshots or AMIs.
|
static interface |
CfnLifecyclePolicy.CrossRegionCopyActionProperty
*[Event-based policies only]* Specifies a cross-Region copy action for event-based policies.
|
static interface |
CfnLifecyclePolicy.CrossRegionCopyDeprecateRuleProperty
*[AMI policies only]* Specifies an AMI deprecation rule for cross-Region AMI copies created by an AMI policy.
|
static interface |
CfnLifecyclePolicy.CrossRegionCopyRetainRuleProperty
Specifies a retention rule for cross-Region snapshot copies created by snapshot or event-based policies, or cross-Region AMI copies created by AMI policies.
|
static interface |
CfnLifecyclePolicy.CrossRegionCopyRuleProperty
*[Snapshot and AMI policies only]* Specifies a cross-Region copy rule for snapshot and AMI policies.
|
static interface |
CfnLifecyclePolicy.DeprecateRuleProperty
*[AMI policies only]* Specifies an AMI deprecation rule for AMIs created by an AMI lifecycle policy.
|
static interface |
CfnLifecyclePolicy.EncryptionConfigurationProperty
*[Event-based policies only]* Specifies the encryption settings for cross-Region snapshot copies created by event-based policies.
|
static interface |
CfnLifecyclePolicy.EventParametersProperty
*[Event-based policies only]* Specifies an event that activates an event-based policy.
|
static interface |
CfnLifecyclePolicy.EventSourceProperty
*[Event-based policies only]* Specifies an event that activates an event-based policy.
|
static interface |
CfnLifecyclePolicy.FastRestoreRuleProperty
*[Snapshot policies only]* Specifies a rule for enabling fast snapshot restore for snapshots created by snapshot policies.
|
static interface |
CfnLifecyclePolicy.ParametersProperty
*[Snapshot and AMI policies only]* Specifies optional parameters for snapshot and AMI policies.
|
static interface |
CfnLifecyclePolicy.PolicyDetailsProperty
*[All policy types]* Specifies the configuration of a lifecycle policy.
|
static interface |
CfnLifecyclePolicy.RetainRuleProperty
*[Snapshot and AMI policies only]* Specifies a retention rule for snapshots created by snapshot policies, or for AMIs created by AMI policies.
|
static interface |
CfnLifecyclePolicy.RetentionArchiveTierProperty
*[Snapshot policies only]* Describes the retention rule for archived snapshots.
|
static interface |
CfnLifecyclePolicy.ScheduleProperty
*[Snapshot and AMI policies only]* Specifies a schedule for a snapshot or AMI lifecycle policy.
|
static interface |
CfnLifecyclePolicy.ShareRuleProperty
*[Snapshot policies only]* Specifies a rule for sharing snapshots across AWS accounts .
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnLifecyclePolicy(Construct scope,
java.lang.String id)
Create a new `AWS::DLM::LifecyclePolicy`.
|
|
CfnLifecyclePolicy(Construct scope,
java.lang.String id,
CfnLifecyclePolicyProps props)
Create a new `AWS::DLM::LifecyclePolicy`.
|
protected |
CfnLifecyclePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnLifecyclePolicy(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrArn()
The Amazon Resource Name (ARN) of the lifecycle policy.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getDescription()
A description of the lifecycle policy.
|
java.lang.String |
getExecutionRoleArn()
The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
|
java.lang.Object |
getPolicyDetails()
The configuration details of the lifecycle policy.
|
java.lang.String |
getState()
The activation state of the lifecycle policy.
|
TagManager |
getTags()
The tags to apply to the lifecycle policy during creation.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setDescription(java.lang.String value)
A description of the lifecycle policy.
|
void |
setExecutionRoleArn(java.lang.String value)
The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
|
void |
setPolicyDetails(CfnLifecyclePolicy.PolicyDetailsProperty value)
The configuration details of the lifecycle policy.
|
void |
setPolicyDetails(IResolvable value)
The configuration details of the lifecycle policy.
|
void |
setState(java.lang.String value)
The activation state of the lifecycle policy.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnLifecyclePolicy(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnLifecyclePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnLifecyclePolicy(Construct scope, java.lang.String id, CfnLifecyclePolicyProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties.public CfnLifecyclePolicy(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getDescription()
The characters ^[0-9A-Za-z _-]+$ are supported.
public void setDescription(java.lang.String value)
The characters ^[0-9A-Za-z _-]+$ are supported.
public java.lang.String getExecutionRoleArn()
public void setExecutionRoleArn(java.lang.String value)
public java.lang.Object getPolicyDetails()
public void setPolicyDetails(CfnLifecyclePolicy.PolicyDetailsProperty value)
public void setPolicyDetails(IResolvable value)
public java.lang.String getState()
public void setState(java.lang.String value)