Class CfnApp
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
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();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnApp
.static interface
Defines a physical resource identifier.static interface
Defines a resource mapping.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAssessment execution schedule with 'Daily' or 'Disabled' values.A JSON string that provides information about your application structure.The Amazon Resource Name (ARN) of the app.The optional description for an app.getName()
The name for the application.The Amazon Resource Name (ARN) of the resiliency policy.An array of ResourceMapping objects.getTags()
The tags assigned to the resource.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAppAssessmentSchedule
(String value) Assessment execution schedule with 'Daily' or 'Disabled' values.void
setAppTemplateBody
(String value) A JSON string that provides information about your application structure.void
setDescription
(String value) The optional description for an app.void
The name for the application.void
setResiliencyPolicyArn
(String value) The Amazon Resource Name (ARN) of the resiliency policy.void
setResourceMappings
(List<Object> value) An array of ResourceMapping objects.void
setResourceMappings
(IResolvable value) An array of ResourceMapping objects.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 newAWS::ResilienceHub::App
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrAppArn
The Amazon Resource Name (ARN) of the app. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
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
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
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
The name for the application. -
setName
The name for the application. -
getResourceMappings
An array of ResourceMapping objects. -
setResourceMappings
An array of ResourceMapping objects. -
setResourceMappings
An array of ResourceMapping objects. -
getAppAssessmentSchedule
Assessment execution schedule with 'Daily' or 'Disabled' values. -
setAppAssessmentSchedule
Assessment execution schedule with 'Daily' or 'Disabled' values. -
getDescription
The optional description for an app. -
setDescription
The optional description for an app. -
getResiliencyPolicyArn
The Amazon Resource Name (ARN) of the resiliency policy. -
setResiliencyPolicyArn
The Amazon Resource Name (ARN) of the resiliency policy.
-