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:30:34.946Z") @Stability(Stable) public class CfnApp extends CfnResource implements IInspectable
A CloudFormation AWS::ResilienceHub::App.

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")
         .resiliencyPolicyArn("resiliencyPolicyArn")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .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

    • CfnApp

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

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

      @Stability(Stable) public CfnApp(@NotNull Construct scope, @NotNull String id, @NotNull CfnAppProps props)
      Create a new AWS::ResilienceHub::App.

      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.
      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 app.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      The tags assigned to the resource.

      A tag is a label that you assign to an AWS resource. Each tag consists of a key/value pair.

    • getAppTemplateBody

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

      To learn more about the appTemplateBody template, see the sample template provided in the Examples section.

      The appTemplateBody JSON string has the following structure:

      • resources

      The list of logical resources that needs to be included in the AWS Resilience Hub application.

      Type: Array

      Don't add the resources that you want to exclude.

      Each resources array item includes the following fields:

      • logicalResourceId

      The logical identifier of the resource.

      Type: Object

      Each logicalResourceId object includes the following fields:

      • identifier

      The identifier of the resource.

      Type: String

      • logicalStackName

      The name of the AWS CloudFormation stack this resource belongs to.

      Type: String

      • resourceGroupName

      The name of the resource group this resource belongs to.

      Type: String

      • terraformSourceName

      The name of the Terraform S3 state file this resource belongs to.

      Type: String

      • eksSourceName

      The name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.

      This parameter accepts values in "eks-cluster/namespace" format.

      Type: String

      • type

      The type of resource.

      Type: string

      • name

      The name of the resource.

      Type: String

      • additionalInfo

      Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additionalInfo through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

      Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

      Key: "failover-regions"

      Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

      • appComponents

      The list of Application Components (AppComponent) that this resource belongs to. If an AppComponent is not part of the AWS Resilience Hub application, it will be added.

      Type: Array

      Each appComponents array item includes the following fields:

      • name

      The name of the AppComponent.

      Type: String

      • type

      The type of AppComponent. For more information about the types of AppComponent, see Grouping resources in an AppComponent .

      Type: String

      • resourceNames

      The list of included resources that are assigned to the AppComponent.

      Type: Array of strings

      • additionalInfo

      Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additionalInfo through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

      Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

      Key: "failover-regions"

      Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

      • excludedResources

      The list of logical resource identifiers to be excluded from the application.

      Type: Array

      Don't add the resources that you want to include.

      Each excludedResources array item includes the following fields:

      • logicalResourceIds

      The logical identifier of the resource.

      Type: Object

      You can configure only one of the following fields:

      • logicalStackName
      • resourceGroupName
      • terraformSourceName
      • eksSourceName

      Each logicalResourceIds object includes the following fields:

      • identifier

      The identifier of the resource.

      Type: String

      • logicalStackName

      The name of the AWS CloudFormation stack this resource belongs to.

      Type: String

      • resourceGroupName

      The name of the resource group this resource belongs to.

      Type: String

      • terraformSourceName

      The name of the Terraform S3 state file this resource belongs to.

      Type: String

      • eksSourceName

      The name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.

      This parameter accepts values in "eks-cluster/namespace" format.

      Type: String

      • version

      The AWS Resilience Hub application version.

      • additionalInfo

      Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additionalInfo through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

      Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

      Key: "failover-regions"

      Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

    • setAppTemplateBody

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

      To learn more about the appTemplateBody template, see the sample template provided in the Examples section.

      The appTemplateBody JSON string has the following structure:

      • resources

      The list of logical resources that needs to be included in the AWS Resilience Hub application.

      Type: Array

      Don't add the resources that you want to exclude.

      Each resources array item includes the following fields:

      • logicalResourceId

      The logical identifier of the resource.

      Type: Object

      Each logicalResourceId object includes the following fields:

      • identifier

      The identifier of the resource.

      Type: String

      • logicalStackName

      The name of the AWS CloudFormation stack this resource belongs to.

      Type: String

      • resourceGroupName

      The name of the resource group this resource belongs to.

      Type: String

      • terraformSourceName

      The name of the Terraform S3 state file this resource belongs to.

      Type: String

      • eksSourceName

      The name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.

      This parameter accepts values in "eks-cluster/namespace" format.

      Type: String

      • type

      The type of resource.

      Type: string

      • name

      The name of the resource.

      Type: String

      • additionalInfo

      Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additionalInfo through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

      Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

      Key: "failover-regions"

      Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

      • appComponents

      The list of Application Components (AppComponent) that this resource belongs to. If an AppComponent is not part of the AWS Resilience Hub application, it will be added.

      Type: Array

      Each appComponents array item includes the following fields:

      • name

      The name of the AppComponent.

      Type: String

      • type

      The type of AppComponent. For more information about the types of AppComponent, see Grouping resources in an AppComponent .

      Type: String

      • resourceNames

      The list of included resources that are assigned to the AppComponent.

      Type: Array of strings

      • additionalInfo

      Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additionalInfo through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

      Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

      Key: "failover-regions"

      Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

      • excludedResources

      The list of logical resource identifiers to be excluded from the application.

      Type: Array

      Don't add the resources that you want to include.

      Each excludedResources array item includes the following fields:

      • logicalResourceIds

      The logical identifier of the resource.

      Type: Object

      You can configure only one of the following fields:

      • logicalStackName
      • resourceGroupName
      • terraformSourceName
      • eksSourceName

      Each logicalResourceIds object includes the following fields:

      • identifier

      The identifier of the resource.

      Type: String

      • logicalStackName

      The name of the AWS CloudFormation stack this resource belongs to.

      Type: String

      • resourceGroupName

      The name of the resource group this resource belongs to.

      Type: String

      • terraformSourceName

      The name of the Terraform S3 state file this resource belongs to.

      Type: String

      • eksSourceName

      The name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.

      This parameter accepts values in "eks-cluster/namespace" format.

      Type: String

      • version

      The AWS Resilience Hub application version.

      • additionalInfo

      Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additionalInfo through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

      Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

      Key: "failover-regions"

      Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

    • getName

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

      @Stability(Stable) public void setName(@NotNull String value)
      The 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()
      The optional description for an app.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The optional description for an app.
    • 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.