createAppVersionResource method
Adds a resource to the Resilience Hub application and assigns it to the specified Application Components. If you specify a new Application Component, Resilience Hub will automatically create the Application Component.
- This action has no effect outside Resilience Hub.
-
This API updates the Resilience Hub application draft version. To use this
resource for running resiliency assessments, you must publish the
Resilience Hub application using the
PublishAppVersionAPI. -
To update application version with new
physicalResourceID, you must callResolveAppVersionResourcesAPI.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter appArn :
Amazon Resource Name (ARN) of the Resilience Hub application. The format
for this ARN is:
arn:partition:resiliencehub:region:account:app/app-id.
For more information about ARNs, see
Amazon Resource Names (ARNs) in the Amazon Web Services General
Reference guide.
Parameter appComponents :
List of Application Components that this resource belongs to. If an
Application Component is not part of the Resilience Hub application, it
will be added.
Parameter logicalResourceId :
Logical identifier of the resource.
Parameter physicalResourceId :
Physical identifier of the resource.
Parameter resourceType :
Type of resource.
Parameter additionalInfo :
Currently, there is no supported additional information for resources.
Parameter awsAccountId :
Amazon Web Services account that owns the physical resource.
Parameter awsRegion :
Amazon Web Services region that owns the physical resource.
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 resourceName :
Name of the resource.
Implementation
Future<CreateAppVersionResourceResponse> createAppVersionResource({
required String appArn,
required List<String> appComponents,
required LogicalResourceId logicalResourceId,
required String physicalResourceId,
required String resourceType,
Map<String, List<String>>? additionalInfo,
String? awsAccountId,
String? awsRegion,
String? clientToken,
String? resourceName,
}) async {
final $payload = <String, dynamic>{
'appArn': appArn,
'appComponents': appComponents,
'logicalResourceId': logicalResourceId,
'physicalResourceId': physicalResourceId,
'resourceType': resourceType,
if (additionalInfo != null) 'additionalInfo': additionalInfo,
if (awsAccountId != null) 'awsAccountId': awsAccountId,
if (awsRegion != null) 'awsRegion': awsRegion,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (resourceName != null) 'resourceName': resourceName,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/create-app-version-resource',
exceptionFnMap: _exceptionFns,
);
return CreateAppVersionResourceResponse.fromJson(response);
}