Skip to content

associate_customer_gateway async

associate_customer_gateway(
    customer_gateway_arn: CustomerGatewayArn,
    global_network_id: GlobalNetworkId,
    device_id: DeviceId,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    link_id: Optional[LinkId] = None,
) -> AssociateCustomerGatewayResponse

Associates a customer gateway with a device and optionally, with a link. If you specify a link, it must be associated with the specified device.

You can only associate customer gateways that are connected to a VPN attachment on a transit gateway or core network registered in your global network. When you register a transit gateway or core network, customer gateways that are connected to the transit gateway are automatically included in the global network. To list customer gateways that are connected to a transit gateway, use the DescribeVpnConnections EC2 API and filter by transit-gateway-id.

You cannot associate a customer gateway with more than one device and link.

Parameters:

  • customer_gateway_arn (CustomerGatewayArn) –

    The Amazon Resource Name (ARN) of the customer gateway.

  • global_network_id (GlobalNetworkId) –

    The ID of the global network.

  • device_id (DeviceId) –

    The ID of the device.

  • link_id (Optional[LinkId], default: None ) –

    The ID of the link.

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def associate_customer_gateway(
    self,
    customer_gateway_arn: "capo_networkmanager.types.customer_gateway_arn.CustomerGatewayArn",
    global_network_id: "capo_networkmanager.types.global_network_id.GlobalNetworkId",
    device_id: "capo_networkmanager.types.device_id.DeviceId",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    link_id: Optional["capo_networkmanager.types.link_id.LinkId"] = None,
) -> "capo_networkmanager.types.associate_customer_gateway_response.AssociateCustomerGatewayResponse":
    """<p>Associates a customer gateway with a device and optionally, with a link. If you specify a link, it must be associated with the specified device. </p> <p>You can only associate customer gateways that are connected to a VPN attachment on a transit gateway or core network registered in your global network. When you register a transit gateway or core network, customer gateways that are connected to the transit gateway are automatically included in the global network. To list customer gateways that are connected to a transit gateway, use the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpnConnections.html">DescribeVpnConnections</a> EC2 API and filter by <code>transit-gateway-id</code>.</p> <p>You cannot associate a customer gateway with more than one device and link. </p>

    Args:
        customer_gateway_arn: <p>The Amazon Resource Name (ARN) of the customer gateway.</p>
        global_network_id: <p>The ID of the global network.</p>
        device_id: <p>The ID of the device.</p>
        link_id: <p>The ID of the link.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.conflict_exception.ConflictException: <p>There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service limit was exceeded.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmanager.types.associate_customer_gateway_request.AssociateCustomerGatewayRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.associate_customer_gateway_response.AssociateCustomerGatewayResponse"
    ]:
        import capo_networkmanager._operations.network_manager.associate_customer_gateway

        (
            output,
            http_response,
        ) = await capo_networkmanager._operations.network_manager.associate_customer_gateway.async_associate_customer_gateway(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateCustomerGateway")
    )
    input_: capo_networkmanager.types.associate_customer_gateway_request.AssociateCustomerGatewayRequest = {
        "customer_gateway_arn": customer_gateway_arn,
        "global_network_id": global_network_id,
        "device_id": device_id,
    }
    if link_id is not None:
        input_["link_id"] = link_id

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