Skip to content

create_application

create_application(
    name: EntityName,
    engine_type: EngineType,
    definition: Definition,
    *,
    config_overrides: Optional[m2ClientConfig] = None,
    description: Optional[EntityDescription] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
    kms_key_id: Optional[str] = None,
    role_arn: Optional[Arn] = None,
) -> CreateApplicationResponse

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

Parameters:

  • name (EntityName) –

    The unique identifier of the application.

  • description (Optional[EntityDescription], default: None ) –

    The description of the application.

  • engine_type (EngineType) –

    The type of the target platform for this application.

  • definition (Definition) –

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

  • tags (Optional[TagMap], default: None ) –

    A list of tags to apply to the application.

  • client_token (Optional[ClientToken], default: None ) –

    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.

  • kms_key_id (Optional[str], default: None ) –

    The identifier of a customer managed key.

  • role_arn (Optional[Arn], default: None ) –

    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.

Raises:

Source code in docs_src/capo_m2/_services/m2.py
def create_application(
    self,
    name: "capo_m2.types.entity_name.EntityName",
    engine_type: "capo_m2.types.engine_type.EngineType",
    definition: "capo_m2.types.definition.Definition",
    *,
    config_overrides: Optional[m2ClientConfig] = None,
    description: Optional[
        "capo_m2.types.entity_description.EntityDescription"
    ] = None,
    tags: Optional["capo_m2.types.tag_map.TagMap"] = None,
    client_token: Optional["capo_m2.types.client_token.ClientToken"] = None,
    kms_key_id: Optional[str] = None,
    role_arn: Optional["capo_m2.types.arn.Arn"] = None,
) -> "capo_m2.types.create_application_response.CreateApplicationResponse":
    """<p>Creates a new application with given parameters. Requires an existing runtime environment and application definition file.</p>

    Args:
        name: <p>The unique identifier of the application.</p>
        description: <p>The description of the application.</p>
        engine_type: <p>The type of the target platform for this application.</p>
        definition: <p>The application definition for this application. You can specify either inline JSON or an S3 bucket location.</p>
        tags: <p>A list of tags to apply to the application.</p>
        client_token: <p>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.</p>
        kms_key_id: <p>The identifier of a customer managed key.</p>
        role_arn: <p>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.</p>

    Raises:
        capo_m2.errors.access_denied_exception.AccessDeniedException: <p>The account or role doesn't have the right permissions to make the request.</p>
        capo_m2.errors.conflict_exception.ConflictException: <p>The parameters provided in the request conflict with existing resources.</p>
        capo_m2.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_m2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit.</p>
        capo_m2.errors.throttling_exception.ThrottlingException: <p>The number of requests made exceeds the limit.</p>
        capo_m2.errors.validation_exception.ValidationException: <p>One or more parameters provided in the request is not valid.</p>
        capo_m2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_m2.types.create_application_request.CreateApplicationRequest]",
    ) -> OperationResponse[
        "capo_m2.types.create_application_response.CreateApplicationResponse"
    ]:
        import capo_m2._operations.aws_supernova_control_plane_service.create_application

        output, http_response = (
            capo_m2._operations.aws_supernova_control_plane_service.create_application.create_application(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateApplication")
    )
    input_: capo_m2.types.create_application_request.CreateApplicationRequest = {
        "name": name,
        "engine_type": engine_type,
        "definition": definition,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if role_arn is not None:
        input_["role_arn"] = role_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output