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

@Generated(value="jsii-pacmak/1.133.0 (build 0f43e37)", date="2026-06-16T16:14:31.924Z") @Stability(Stable) public class CfnPolicy extends CfnResource implements IInspectable, IPolicyRef, ITaggableV2
Creates a resilience policy that defines availability and disaster recovery requirements.

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.resiliencehubv2.*;
 CfnPolicy cfnPolicy = CfnPolicy.Builder.create(this, "MyCfnPolicy")
         .name("name")
         // the properties below are optional
         .availabilitySlo(AvailabilitySloProperty.builder()
                 .target(123)
                 .build())
         .dataRecovery(DataRecoveryTargetsProperty.builder()
                 .timeBetweenBackupsInMinutes(123)
                 .build())
         .description("description")
         .kmsKeyId("kmsKeyId")
         .multiAz(MultiAzTargetsProperty.builder()
                 .disasterRecoveryApproach("disasterRecoveryApproach")
                 .rpoInMinutes(123)
                 .rtoInMinutes(123)
                 .build())
         .multiRegion(MultiRegionTargetsProperty.builder()
                 .disasterRecoveryApproach("disasterRecoveryApproach")
                 .rpoInMinutes(123)
                 .rtoInMinutes(123)
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • 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

    • CfnPolicy

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

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

      @Stability(Stable) public CfnPolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnPolicyProps props)
      Create a new AWS::ResilienceHubV2::Policy.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • arnForPolicy

      @Stability(Stable) @NotNull public static String arnForPolicy(@NotNull IPolicyRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnPolicy

      @Stability(Stable) @NotNull public static Boolean isCfnPolicy(@NotNull Object x)
      Checks whether the given object is a CfnPolicy.

      Parameters:
      x - This parameter is required.
    • 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.
    • getAttrAssociatedServiceCount

      @Stability(Stable) @NotNull public Number getAttrAssociatedServiceCount()
      The number of services associated with this policy.
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The timestamp when the policy was created.
    • getAttrPolicyArn

      @Stability(Stable) @NotNull public String getAttrPolicyArn()
      The ARN of the policy.
    • getAttrUpdatedAt

      @Stability(Stable) @NotNull public String getAttrUpdatedAt()
      The timestamp when the policy was last updated.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

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

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getPolicyRef

      @Stability(Stable) @NotNull public PolicyReference getPolicyRef()
      A reference to a Policy resource.
      Specified by:
      getPolicyRef in interface IPolicyRef
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the policy.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the policy.
    • getAvailabilitySlo

      @Stability(Stable) @Nullable public Object getAvailabilitySlo()
    • setAvailabilitySlo

      @Stability(Stable) public void setAvailabilitySlo(@Nullable IResolvable value)
    • setAvailabilitySlo

      @Stability(Stable) public void setAvailabilitySlo(@Nullable CfnPolicy.AvailabilitySloProperty value)
    • getDataRecovery

      @Stability(Stable) @Nullable public Object getDataRecovery()
    • setDataRecovery

      @Stability(Stable) public void setDataRecovery(@Nullable IResolvable value)
    • setDataRecovery

      @Stability(Stable) public void setDataRecovery(@Nullable CfnPolicy.DataRecoveryTargetsProperty value)
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the policy.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the policy.
    • getKmsKeyId

      @Stability(Stable) @Nullable public String getKmsKeyId()
      The KMS key ID for encrypting policy data.
    • setKmsKeyId

      @Stability(Stable) public void setKmsKeyId(@Nullable String value)
      The KMS key ID for encrypting policy data.
    • getMultiAz

      @Stability(Stable) @Nullable public Object getMultiAz()
    • setMultiAz

      @Stability(Stable) public void setMultiAz(@Nullable IResolvable value)
    • setMultiAz

      @Stability(Stable) public void setMultiAz(@Nullable CfnPolicy.MultiAzTargetsProperty value)
    • getMultiRegion

      @Stability(Stable) @Nullable public Object getMultiRegion()
    • setMultiRegion

      @Stability(Stable) public void setMultiRegion(@Nullable IResolvable value)
    • setMultiRegion

      @Stability(Stable) public void setMultiRegion(@Nullable CfnPolicy.MultiRegionTargetsProperty value)
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      Tags assigned to the policy.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      Tags assigned to the policy.