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

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:12.849Z") @Stability(Stable) public class CfnApp extends CfnResource implements IInspectable, ITaggable
Creates an AWS Resilience Hub application.

An AWS Resilience Hub application is a collection of AWS resources structured to prevent and recover AWS application disruptions. To describe a AWS Resilience Hub application, you provide an application name, resources from one or more AWS CloudFormation stacks, AWS Resource Groups , Terraform state files, AppRegistry applications, and an appropriate resiliency policy. In addition, you can also add resources that are located on Amazon Elastic Kubernetes Service (Amazon EKS) clusters as optional resources. For more information about the number of resources supported per application, see Service quotas .

After you create an AWS Resilience Hub application, you publish it so that you can run a resiliency assessment on it. You can then use recommendations from the assessment to improve resiliency by running another assessment, comparing results, and then iterating the process until you achieve your goals for recovery time objective (RTO) and recovery point objective (RPO).

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.resiliencehub.*;
 CfnApp cfnApp = CfnApp.Builder.create(this, "MyCfnApp")
         .appTemplateBody("appTemplateBody")
         .name("name")
         .resourceMappings(List.of(ResourceMappingProperty.builder()
                 .mappingType("mappingType")
                 .physicalResourceId(PhysicalResourceIdProperty.builder()
                         .identifier("identifier")
                         .type("type")
                         // the properties below are optional
                         .awsAccountId("awsAccountId")
                         .awsRegion("awsRegion")
                         .build())
                 // the properties below are optional
                 .eksSourceName("eksSourceName")
                 .logicalStackName("logicalStackName")
                 .resourceName("resourceName")
                 .terraformSourceName("terraformSourceName")
                 .build()))
         // the properties below are optional
         .appAssessmentSchedule("appAssessmentSchedule")
         .description("description")
         .eventSubscriptions(List.of(EventSubscriptionProperty.builder()
                 .eventType("eventType")
                 .name("name")
                 // the properties below are optional
                 .snsTopicArn("snsTopicArn")
                 .build()))
         .permissionModel(PermissionModelProperty.builder()
                 .type("type")
                 // the properties below are optional
                 .crossAccountRoleArns(List.of("crossAccountRoleArns"))
                 .invokerRoleName("invokerRoleName")
                 .build())
         .resiliencyPolicyArn("resiliencyPolicyArn")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .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

    • CfnApp

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

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

      @Stability(Stable) public CfnApp(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAppProps props)
      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

    • 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.
    • getAttrAppArn

      @Stability(Stable) @NotNull public String getAttrAppArn()
      The Amazon Resource Name (ARN) of the applcation.
    • getAttrDriftStatus

      @Stability(Stable) @NotNull public String getAttrDriftStatus()
      Indicates if compliance drifts (deviations) were detected while running an assessment for your application.
    • getCfnProperties

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

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

      @Stability(Stable) @NotNull public String getAppTemplateBody()
      A JSON string that provides information about your application structure.
    • setAppTemplateBody

      @Stability(Stable) public void setAppTemplateBody(@NotNull String value)
      A JSON string that provides information about your application structure.
    • getName

      @Stability(Stable) @NotNull public String getName()
      Name for the application.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      Name for the application.
    • getResourceMappings

      @Stability(Stable) @NotNull public Object getResourceMappings()
      An array of ResourceMapping objects.
    • setResourceMappings

      @Stability(Stable) public void setResourceMappings(@NotNull IResolvable value)
      An array of ResourceMapping objects.
    • setResourceMappings

      @Stability(Stable) public void setResourceMappings(@NotNull List<Object> value)
      An array of ResourceMapping objects.
    • getAppAssessmentSchedule

      @Stability(Stable) @Nullable public String getAppAssessmentSchedule()
      Assessment execution schedule with 'Daily' or 'Disabled' values.
    • setAppAssessmentSchedule

      @Stability(Stable) public void setAppAssessmentSchedule(@Nullable String value)
      Assessment execution schedule with 'Daily' or 'Disabled' values.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      Optional description for an application.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      Optional description for an application.
    • getEventSubscriptions

      @Stability(Stable) @Nullable public Object getEventSubscriptions()
      The list of events you would like to subscribe and get notification for.
    • setEventSubscriptions

      @Stability(Stable) public void setEventSubscriptions(@Nullable IResolvable value)
      The list of events you would like to subscribe and get notification for.
    • setEventSubscriptions

      @Stability(Stable) public void setEventSubscriptions(@Nullable List<Object> value)
      The list of events you would like to subscribe and get notification for.
    • getPermissionModel

      @Stability(Stable) @Nullable public Object getPermissionModel()
      Defines the roles and credentials that AWS Resilience Hub would use while creating the application, importing its resources, and running an assessment.
    • setPermissionModel

      @Stability(Stable) public void setPermissionModel(@Nullable IResolvable value)
      Defines the roles and credentials that AWS Resilience Hub would use while creating the application, importing its resources, and running an assessment.
    • setPermissionModel

      @Stability(Stable) public void setPermissionModel(@Nullable CfnApp.PermissionModelProperty value)
      Defines the roles and credentials that AWS Resilience Hub would use while creating the application, importing its resources, and running an assessment.
    • getResiliencyPolicyArn

      @Stability(Stable) @Nullable public String getResiliencyPolicyArn()
      The Amazon Resource Name (ARN) of the resiliency policy.
    • setResiliencyPolicyArn

      @Stability(Stable) public void setResiliencyPolicyArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the resiliency policy.
    • getTagsRaw

      @Stability(Stable) @Nullable public Map<String,String> getTagsRaw()
      Tags assigned to the resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Map<String,String> value)
      Tags assigned to the resource.