Skip to content

associate_connection_with_lag

associate_connection_with_lag(
    connection_id: ConnectionId,
    lag_id: LagId,
    *,
    config_overrides: Optional[DirectConnectClientConfig] = None,
) -> Connection

Associates an existing connection with a link aggregation group (LAG). The connection is interrupted and re-established as a member of the LAG (connectivity to Amazon Web Services is interrupted). The connection must be hosted on the same Direct Connect endpoint as the LAG, and its bandwidth must match the bandwidth for the LAG. You can re-associate a connection that's currently associated with a different LAG; however, if removing the connection would cause the original LAG to fall below its setting for minimum number of operational connections, the request fails.

Any virtual interfaces that are directly associated with the connection are automatically re-associated with the LAG. If the connection was originally associated with a different LAG, the virtual interfaces remain associated with the original LAG.

For interconnects, any hosted connections are automatically re-associated with the LAG. If the interconnect was originally associated with a different LAG, the hosted connections remain associated with the original LAG.

Parameters:

  • connection_id (ConnectionId) –

    The ID of the connection.

  • lag_id (LagId) –

    The ID of the LAG with which to associate the connection.

Raises:

Source code in docs_src/capo_direct_connect/_services/direct_connect.py
def associate_connection_with_lag(
    self,
    connection_id: "capo_direct_connect.types.connection_id.ConnectionId",
    lag_id: "capo_direct_connect.types.lag_id.LagId",
    *,
    config_overrides: Optional[DirectConnectClientConfig] = None,
) -> "capo_direct_connect.types.connection.Connection":
    """<p>Associates an existing connection with a link aggregation group (LAG). The connection is interrupted and re-established as a member of the LAG (connectivity to Amazon Web Services is interrupted). The connection must be hosted on the same Direct Connect endpoint as the LAG, and its bandwidth must match the bandwidth for the LAG. You can re-associate a connection that's currently associated with a different LAG; however, if removing the connection would cause the original LAG to fall below its setting for minimum number of operational connections, the request fails.</p> <p>Any virtual interfaces that are directly associated with the connection are automatically re-associated with the LAG. If the connection was originally associated with a different LAG, the virtual interfaces remain associated with the original LAG.</p> <p>For interconnects, any hosted connections are automatically re-associated with the LAG. If the interconnect was originally associated with a different LAG, the hosted connections remain associated with the original LAG.</p>

    Args:
        connection_id: <p>The ID of the connection.</p>
        lag_id: <p>The ID of the LAG with which to associate the connection.</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.limit_exceeded_exception.LimitExceededException: <p>The rate limiter limit has been exceeded for the connection. You cannot add more rate limiters to virtual interfaces on this connection.</p>
        capo_direct_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_direct_connect.types.associate_connection_with_lag_request.AssociateConnectionWithLagRequest]",
    ) -> OperationResponse["capo_direct_connect.types.connection.Connection"]:
        import capo_direct_connect._operations.overture_service.associate_connection_with_lag

        output, http_response = (
            capo_direct_connect._operations.overture_service.associate_connection_with_lag.associate_connection_with_lag(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateConnectionWithLag")
    )
    input_: capo_direct_connect.types.associate_connection_with_lag_request.AssociateConnectionWithLagRequest = {
        "connection_id": connection_id,
        "lag_id": lag_id,
    }

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