Skip to content

create_application async

create_application(
    name: ApplicationName,
    environment_identifier: EnvironmentId,
    vpc_id: VpcId,
    proxy_type: ProxyType,
    *,
    config_overrides: Optional[AsyncMigrationHubRefactorSpacesClientConfig] = None,
    api_gateway_proxy: Optional[ApiGatewayProxyInput] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateApplicationResponse

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.

Parameters:

  • name (ApplicationName) –

    The name to use for the application.

  • environment_identifier (EnvironmentId) –

    The unique identifier of the environment.

  • vpc_id (VpcId) –

    The ID of the virtual private cloud (VPC).

  • proxy_type (ProxyType) –

    The proxy type of the proxy created within the application.

  • api_gateway_proxy (Optional[ApiGatewayProxyInput], default: None ) –

    A wrapper object holding the API Gateway endpoint type and stage name for the proxy.

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

    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.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_migration_hub_refactor_spaces/_services/async_migration_hub_refactor_spaces.py
async def create_application(
    self,
    name: "capo_migration_hub_refactor_spaces.types.application_name.ApplicationName",
    environment_identifier: "capo_migration_hub_refactor_spaces.types.environment_id.EnvironmentId",
    vpc_id: "capo_migration_hub_refactor_spaces.types.vpc_id.VpcId",
    proxy_type: "capo_migration_hub_refactor_spaces.types.proxy_type.ProxyType",
    *,
    config_overrides: Optional[AsyncMigrationHubRefactorSpacesClientConfig] = None,
    api_gateway_proxy: Optional[
        "capo_migration_hub_refactor_spaces.types.api_gateway_proxy_input.ApiGatewayProxyInput"
    ] = None,
    tags: Optional[
        "capo_migration_hub_refactor_spaces.types.tag_map.TagMap"
    ] = None,
    client_token: Optional[
        "capo_migration_hub_refactor_spaces.types.client_token.ClientToken"
    ] = None,
) -> "capo_migration_hub_refactor_spaces.types.create_application_response.CreateApplicationResponse":
    """<p>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.</p> <p>In environments created with a <a href="https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html#migrationhubrefactorspaces-CreateEnvironment-request-NetworkFabricType">CreateEnvironment:NetworkFabricType</a> of <code>NONE</code> you need to configure <a href="https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/amazon-vpc-to-amazon-vpc-connectivity-options.html"> VPC to VPC connectivity</a> 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 <a href="https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/userguide/getting-started-create-application.html"> Create an application</a> in the <i>Refactor Spaces User Guide</i>. </p>

    Args:
        name: <p>The name to use for the application. </p>
        environment_identifier: <p>The unique identifier of the environment.</p>
        vpc_id: <p>The ID of the virtual private cloud (VPC).</p>
        proxy_type: <p>The proxy type of the proxy created within the application. </p>
        api_gateway_proxy: <p>A wrapper object holding the API Gateway endpoint type and stage name for the proxy. </p>
        tags: <p>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.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>

    Raises:
        capo_migration_hub_refactor_spaces.errors.access_denied_exception.AccessDeniedException: <p>The user does not have sufficient access to perform this action. </p>
        capo_migration_hub_refactor_spaces.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_migration_hub_refactor_spaces.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing the request.</p>
        capo_migration_hub_refactor_spaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist. </p>
        capo_migration_hub_refactor_spaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota to be exceeded. </p>
        capo_migration_hub_refactor_spaces.errors.throttling_exception.ThrottlingException: <p>Request was denied because the request was throttled. </p>
        capo_migration_hub_refactor_spaces.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Service. </p>
        capo_migration_hub_refactor_spaces.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_migration_hub_refactor_spaces.types.create_application_request.CreateApplicationRequest]",
    ) -> AsyncOperationResponse[
        "capo_migration_hub_refactor_spaces.types.create_application_response.CreateApplicationResponse"
    ]:
        import capo_migration_hub_refactor_spaces._operations.refactor_spaces.create_application

        (
            output,
            http_response,
        ) = await capo_migration_hub_refactor_spaces._operations.refactor_spaces.create_application.async_create_application(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_migration_hub_refactor_spaces.types.create_application_request.CreateApplicationRequest",
    ) -> dict[str, Any]:
        import capo_migration_hub_refactor_spaces.types.create_application_request

        return capo_migration_hub_refactor_spaces.types.create_application_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_migration_hub_refactor_spaces.types.create_application_response.CreateApplicationResponse",
    ) -> dict[str, Any]:
        import capo_migration_hub_refactor_spaces.types.create_application_response

        return capo_migration_hub_refactor_spaces.types.create_application_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateApplication",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_migration_hub_refactor_spaces.types.create_application_request.CreateApplicationRequest = {
        "name": name,
        "environment_identifier": environment_identifier,
        "vpc_id": vpc_id,
        "proxy_type": proxy_type,
    }
    if api_gateway_proxy is not None:
        input_["api_gateway_proxy"] = api_gateway_proxy
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output