Skip to content

create_direct_connect_gateway async

create_direct_connect_gateway(
    direct_connect_gateway_name: DirectConnectGatewayName,
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
    tags: Optional[TagList] = None,
    amazon_side_asn: Optional[LongAsn] = None,
) -> CreateDirectConnectGatewayResult

Creates a Direct Connect gateway, which is an intermediate object that enables you to connect a set of virtual interfaces and virtual private gateways. A Direct Connect gateway is global and visible in any Amazon Web Services Region after it is created. The virtual interfaces and virtual private gateways that are connected through a Direct Connect gateway can be in different Amazon Web Services Regions. This enables you to connect to a VPC in any Region, regardless of the Region in which the virtual interfaces are located, and pass traffic between them.

Parameters:

  • direct_connect_gateway_name (DirectConnectGatewayName) –

    The name of the Direct Connect gateway.

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

    The key-value pair tags associated with the request.

  • amazon_side_asn (Optional[LongAsn], default: None ) –

    The autonomous system number (ASN) for Border Gateway Protocol (BGP) to be configured on the Amazon side of the connection. The ASN must be in the private range of 64,512 to 65,534 or 4,200,000,000 to 4,294,967,294. The default is 64512.

Raises:

Source code in docs_src/capo_direct_connect/_services/async_direct_connect.py
async def create_direct_connect_gateway(
    self,
    direct_connect_gateway_name: "capo_direct_connect.types.direct_connect_gateway_name.DirectConnectGatewayName",
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
    tags: Optional["capo_direct_connect.types.tag_list.TagList"] = None,
    amazon_side_asn: Optional["capo_direct_connect.types.long_asn.LongAsn"] = None,
) -> "capo_direct_connect.types.create_direct_connect_gateway_result.CreateDirectConnectGatewayResult":
    """<p>Creates a Direct Connect gateway, which is an intermediate object that enables you to connect a set of virtual interfaces and virtual private gateways. A Direct Connect gateway is global and visible in any Amazon Web Services Region after it is created. The virtual interfaces and virtual private gateways that are connected through a Direct Connect gateway can be in different Amazon Web Services Regions. This enables you to connect to a VPC in any Region, regardless of the Region in which the virtual interfaces are located, and pass traffic between them.</p>

    Args:
        direct_connect_gateway_name: <p>The name of the Direct Connect gateway.</p>
        tags: <p>The key-value pair tags associated with the request.</p>
        amazon_side_asn: <p>The autonomous system number (ASN) for Border Gateway Protocol (BGP) to be configured on the Amazon side of the connection. The ASN must be in the private range of 64,512 to 65,534 or 4,200,000,000 to 4,294,967,294. The default is 64512.</p>

    Raises:
        capo_direct_connect.errors.direct_connect_client_exception.DirectConnectClientException: <p>One or more parameters are not valid.</p>
        capo_direct_connect.errors.direct_connect_server_exception.DirectConnectServerException: <p>A server-side error occurred.</p>
        capo_direct_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_direct_connect.types.create_direct_connect_gateway_request.CreateDirectConnectGatewayRequest]",
    ) -> AsyncOperationResponse[
        "capo_direct_connect.types.create_direct_connect_gateway_result.CreateDirectConnectGatewayResult"
    ]:
        import capo_direct_connect._operations.overture_service.create_direct_connect_gateway

        (
            output,
            http_response,
        ) = await capo_direct_connect._operations.overture_service.create_direct_connect_gateway.async_create_direct_connect_gateway(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDirectConnectGateway")
    )
    input_: capo_direct_connect.types.create_direct_connect_gateway_request.CreateDirectConnectGatewayRequest = {
        "direct_connect_gateway_name": direct_connect_gateway_name
    }
    if tags is not None:
        input_["tags"] = tags
    if amazon_side_asn is not None:
        input_["amazon_side_asn"] = amazon_side_asn

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