createApp method
Creates an Resilience Hub application. An Resilience Hub application is a collection of Amazon Web Services resources structured to prevent and recover Amazon Web Services application disruptions. To describe a Resilience Hub application, you provide an application name, resources from one or more CloudFormation stacks, 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 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).
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
Name of the application.
Parameter assessmentSchedule :
Assessment execution schedule with 'Daily' or 'Disabled' values.
Parameter awsApplicationArn :
Amazon Resource Name (ARN) of Resource Groups group that is integrated
with an AppRegistry application. For more information about ARNs, see
Amazon Resource Names (ARNs) in the Amazon Web Services General
Reference guide.
Parameter clientToken :
Used for an idempotency token. A client token is a unique, case-sensitive
string of up to 64 ASCII characters. You should not reuse the same client
token for other API requests.
Parameter description :
The optional description for an app.
Parameter eventSubscriptions :
The list of events you would like to subscribe and get notification for.
Currently, Resilience Hub supports only Drift detected and
Scheduled assessment failure events notification.
Parameter permissionModel :
Defines the roles and credentials that Resilience Hub would use while
creating the application, importing its resources, and running an
assessment.
Parameter policyArn :
Amazon Resource Name (ARN) of the resiliency policy. The format for this
ARN is:
arn:partition:resiliencehub:region:account:resiliency-policy/policy-id.
For more information about ARNs, see
Amazon Resource Names (ARNs) in the Amazon Web Services General
Reference guide.
Parameter tags :
Tags assigned to the resource. A tag is a label that you assign to an
Amazon Web Services resource. Each tag consists of a key/value pair.
Implementation
Future<CreateAppResponse> createApp({
required String name,
AppAssessmentScheduleType? assessmentSchedule,
String? awsApplicationArn,
String? clientToken,
String? description,
List<EventSubscription>? eventSubscriptions,
PermissionModel? permissionModel,
String? policyArn,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'name': name,
if (assessmentSchedule != null)
'assessmentSchedule': assessmentSchedule.value,
if (awsApplicationArn != null) 'awsApplicationArn': awsApplicationArn,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (eventSubscriptions != null) 'eventSubscriptions': eventSubscriptions,
if (permissionModel != null) 'permissionModel': permissionModel,
if (policyArn != null) 'policyArn': policyArn,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/create-app',
exceptionFnMap: _exceptionFns,
);
return CreateAppResponse.fromJson(response);
}