createApplication method

Future<CreateApplicationResponse> createApplication({
  1. required Definition definition,
  2. required EngineType engineType,
  3. required String name,
  4. String? clientToken,
  5. String? description,
  6. String? kmsKeyId,
  7. String? roleArn,
  8. Map<String, String>? tags,
})

Creates a new application with given parameters. Requires an existing runtime environment and application definition file.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter definition : The application definition for this application. You can specify either inline JSON or an S3 bucket location.

Parameter engineType : The type of the target platform for this application.

Parameter name : The unique identifier of the application.

Parameter clientToken : A client token is a unique, case-sensitive string of up to 128 ASCII characters with ASCII values of 33-126 inclusive. It's generated by the client to ensure idempotent operations, allowing for safe retries without unintended side effects.

Parameter description : The description of the application.

Parameter kmsKeyId : The identifier of a customer managed key.

Parameter roleArn : The Amazon Resource Name (ARN) that identifies a role that the application uses to access Amazon Web Services resources that are not part of the application or are in a different Amazon Web Services account.

Parameter tags : A list of tags to apply to the application.

Implementation

Future<CreateApplicationResponse> createApplication({
  required Definition definition,
  required EngineType engineType,
  required String name,
  String? clientToken,
  String? description,
  String? kmsKeyId,
  String? roleArn,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'definition': definition,
    'engineType': engineType.value,
    'name': name,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (kmsKeyId != null) 'kmsKeyId': kmsKeyId,
    if (roleArn != null) 'roleArn': roleArn,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/applications',
    exceptionFnMap: _exceptionFns,
  );
  return CreateApplicationResponse.fromJson(response);
}