Class CfnLifecyclePolicy

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:56.279Z") @Stability(Stable) public class CfnLifecyclePolicy extends CfnResource implements IInspectable
A CloudFormation AWS::DLM::LifecyclePolicy.

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();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnLifecyclePolicy

      protected CfnLifecyclePolicy(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnLifecyclePolicy

      protected CfnLifecyclePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnLifecyclePolicy

      @Stability(Stable) public CfnLifecyclePolicy(@NotNull Construct scope, @NotNull String id, @Nullable CfnLifecyclePolicyProps props)
      Create a new AWS::DLM::LifecyclePolicy.

      Parameters:
      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.
    • CfnLifecyclePolicy

      @Stability(Stable) public CfnLifecyclePolicy(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::DLM::LifecyclePolicy.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the lifecycle policy.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The tags to apply to the lifecycle policy during creation.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A description of the lifecycle policy.

      The characters ^[0-9A-Za-z _-]+$ are supported.

    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description of the lifecycle policy.

      The characters ^[0-9A-Za-z _-]+$ are supported.

    • getExecutionRoleArn

      @Stability(Stable) @Nullable public String getExecutionRoleArn()
      The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
    • setExecutionRoleArn

      @Stability(Stable) public void setExecutionRoleArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
    • getPolicyDetails

      @Stability(Stable) @Nullable public Object getPolicyDetails()
      The configuration details of the lifecycle policy.
    • setPolicyDetails

      @Stability(Stable) public void setPolicyDetails(@Nullable CfnLifecyclePolicy.PolicyDetailsProperty value)
      The configuration details of the lifecycle policy.
    • setPolicyDetails

      @Stability(Stable) public void setPolicyDetails(@Nullable IResolvable value)
      The configuration details of the lifecycle policy.
    • getState

      @Stability(Stable) @Nullable public String getState()
      The activation state of the lifecycle policy.
    • setState

      @Stability(Stable) public void setState(@Nullable String value)
      The activation state of the lifecycle policy.