createApplication method
Creates an Amazon Web Services Migration Hub Refactor Spaces application. The account that owns the environment also owns the applications created inside the environment, regardless of the account that creates the application. Refactor Spaces provisions an Amazon API Gateway, API Gateway VPC link, and Network Load Balancer for the application proxy inside your account.
In environments created with a CreateEnvironment:NetworkFabricType
of NONE you need to configure
VPC to VPC connectivity between your service VPC and the application
proxy VPC to route traffic through the application proxy to a service with
a private URL endpoint. For more information, see
Create an application in the Refactor Spaces User Guide.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter environmentIdentifier :
The unique identifier of the environment.
Parameter name :
The name to use for the application.
Parameter proxyType :
The proxy type of the proxy created within the application.
Parameter vpcId :
The ID of the virtual private cloud (VPC).
Parameter apiGatewayProxy :
A wrapper object holding the API Gateway endpoint type and stage name for
the proxy.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter tags :
The tags to assign to the application. A tag is a label that you assign to
an Amazon Web Services resource. Each tag consists of a key-value pair.
Implementation
Future<CreateApplicationResponse> createApplication({
required String environmentIdentifier,
required String name,
required ProxyType proxyType,
required String vpcId,
ApiGatewayProxyInput? apiGatewayProxy,
String? clientToken,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Name': name,
'ProxyType': proxyType.value,
'VpcId': vpcId,
if (apiGatewayProxy != null) 'ApiGatewayProxy': apiGatewayProxy,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/environments/${Uri.encodeComponent(environmentIdentifier)}/applications',
exceptionFnMap: _exceptionFns,
);
return CreateApplicationResponse.fromJson(response);
}