Skip to content

create_connection async

create_connection(
    connection_name: ConnectionName,
    provider_type: ProviderType,
    *,
    config_overrides: Optional[AsyncAppRunnerClientConfig] = None,
    tags: Optional[TagList] = None,
) -> CreateConnectionResponse

Create an App Runner connection resource. App Runner requires a connection resource when you create App Runner services that access private repositories from certain third-party providers. You can share a connection across multiple services.

A connection resource is needed to access GitHub and Bitbucket repositories. Both require a user interface approval process through the App Runner console before you can use the connection.

Parameters:

  • connection_name (ConnectionName) –

    A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.

  • provider_type (ProviderType) –

    The source repository provider.

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

    A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.

Raises:

Source code in docs_src/capo_apprunner/_services/async_app_runner.py
async def create_connection(
    self,
    connection_name: "capo_apprunner.types.connection_name.ConnectionName",
    provider_type: "capo_apprunner.types.provider_type.ProviderType",
    *,
    config_overrides: Optional[AsyncAppRunnerClientConfig] = None,
    tags: Optional["capo_apprunner.types.tag_list.TagList"] = None,
) -> "capo_apprunner.types.create_connection_response.CreateConnectionResponse":
    """<p>Create an App Runner connection resource. App Runner requires a connection resource when you create App Runner services that access private repositories from certain third-party providers. You can share a connection across multiple services.</p> <p>A connection resource is needed to access GitHub and Bitbucket repositories. Both require a user interface approval process through the App Runner console before you can use the connection.</p>

    Args:
        connection_name: <p>A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.</p>
        provider_type: <p>The source repository provider.</p>
        tags: <p>A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.</p>

    Raises:
        capo_apprunner.errors.internal_service_error_exception.InternalServiceErrorException: <p>An unexpected service exception occurred.</p>
        capo_apprunner.errors.invalid_request_exception.InvalidRequestException: <p>One or more input parameters aren't valid. Refer to the API action's document page, correct the input parameters, and try the action again.</p>
        capo_apprunner.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>App Runner can't create this resource. You've reached your account quota for this resource type.</p> <p>For App Runner per-resource quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/apprunner.html">App Runner endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
        capo_apprunner.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_apprunner.types.create_connection_request.CreateConnectionRequest]",
    ) -> AsyncOperationResponse[
        "capo_apprunner.types.create_connection_response.CreateConnectionResponse"
    ]:
        import capo_apprunner._operations.app_runner.create_connection

        (
            output,
            http_response,
        ) = await capo_apprunner._operations.app_runner.create_connection.async_create_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateConnection")
    )
    input_: capo_apprunner.types.create_connection_request.CreateConnectionRequest = {
        "connection_name": connection_name,
        "provider_type": provider_type,
    }
    if tags is not None:
        input_["tags"] = tags

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