Skip to content

update_network_connector

update_network_connector(
    identifier: NetworkConnectorIdentifier,
    *,
    config_overrides: Optional[LambdaCoreClientConfig] = None,
    configuration: Optional[NetworkConnectorConfiguration] = None,
    operator_role: Optional[NetworkConnectorRoleArn] = None,
    client_token: Optional[ClientTokenString] = None,
) -> UpdateNetworkConnectorResponse

Updates the VPC configuration or operator role of an existing network connector. You can modify the subnet IDs, security group IDs, network protocol, or operator role. The connector must be in ACTIVE state to accept updates.

This operation is asynchronous. The connector remains in ACTIVE state during the update — existing workloads that reference this connector are not disrupted. Use GetNetworkConnector to monitor the LastUpdateStatus field, which transitions through InProgress to Successful or Failed. If the update fails, the LastUpdateStatusReasonCode field provides a specific error code for troubleshooting. This operation is idempotent when you provide a ClientToken.

Each successful configuration change creates a new immutable version. A connector can have a limited number of versions; once that limit is reached, further updates fail with NetworkConnectorLimitExceededException until you delete older versions.

Parameters:

  • identifier (NetworkConnectorIdentifier) –

    The identifier of the network connector to update. You can specify the connector ID, name, or full ARN.

  • configuration (Optional[NetworkConnectorConfiguration], default: None ) –

    The updated network configuration for the connector. Provide the full VpcEgressConfiguration including all subnet IDs and security group IDs — this replaces the existing configuration.

  • operator_role (Optional[NetworkConnectorRoleArn], default: None ) –

    The updated ARN of the IAM role that Lambda assumes to manage ENIs. Use this to change the operator role without recreating the connector.

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

    A unique, case-sensitive identifier to ensure idempotency of the update request.

Raises:

  • InvalidParameterValueException –

    One of the parameters in the request is not valid. Check the error message for details about which parameter failed validation.

  • NetworkConnectorLimitExceededException –

    The request would exceed a network connector limit. For CreateNetworkConnector, the account has reached the maximum number of network connectors allowed. For UpdateNetworkConnector, the connector has reached the maximum number of versions allowed.

  • ResourceConflictException –

    The request could not be completed due to a conflict with the current state of the resource. For example, attempting to update a connector that is not in ACTIVE state.

  • ResourceNotFoundException –

    The specified network connector does not exist. Verify the identifier (ID, name, or ARN) and Region.

  • ServiceException –

    An internal service error occurred. Retry the request with exponential backoff.

  • TooManyRequestsException –

    The request was throttled due to exceeding the allowed request rate. Retry the request after a brief wait using exponential backoff.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lambda_core/_services/lambda_core.py
def update_network_connector(
    self,
    identifier: "capo_lambda_core.types.network_connector_identifier.NetworkConnectorIdentifier",
    *,
    config_overrides: Optional[LambdaCoreClientConfig] = None,
    configuration: Optional[
        "capo_lambda_core.types.network_connector_configuration.NetworkConnectorConfiguration"
    ] = None,
    operator_role: Optional[
        "capo_lambda_core.types.network_connector_role_arn.NetworkConnectorRoleArn"
    ] = None,
    client_token: Optional[
        "capo_lambda_core.types.client_token_string.ClientTokenString"
    ] = None,
) -> "capo_lambda_core.types.update_network_connector_response.UpdateNetworkConnectorResponse":
    """<p>Updates the VPC configuration or operator role of an existing network connector. You can modify the subnet IDs, security group IDs, network protocol, or operator role. The connector must be in <code>ACTIVE</code> state to accept updates.</p> <p>This operation is asynchronous. The connector remains in <code>ACTIVE</code> state during the update — existing workloads that reference this connector are not disrupted. Use <code>GetNetworkConnector</code> to monitor the <code>LastUpdateStatus</code> field, which transitions through <code>InProgress</code> to <code>Successful</code> or <code>Failed</code>. If the update fails, the <code>LastUpdateStatusReasonCode</code> field provides a specific error code for troubleshooting. This operation is idempotent when you provide a <code>ClientToken</code>.</p> <p>Each successful configuration change creates a new immutable version. A connector can have a limited number of versions; once that limit is reached, further updates fail with <code>NetworkConnectorLimitExceededException</code> until you delete older versions.</p>

    Args:
        identifier: <p>The identifier of the network connector to update. You can specify the connector ID, name, or full ARN.</p>
        configuration: <p>The updated network configuration for the connector. Provide the full <code>VpcEgressConfiguration</code> including all subnet IDs and security group IDs — this replaces the existing configuration.</p>
        operator_role: <p>The updated ARN of the IAM role that Lambda assumes to manage ENIs. Use this to change the operator role without recreating the connector.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotency of the update request.</p>

    Raises:
        capo_lambda_core.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid. Check the error message for details about which parameter failed validation.</p>
        capo_lambda_core.errors.network_connector_limit_exceeded_exception.NetworkConnectorLimitExceededException: <p>The request would exceed a network connector limit. For <code>CreateNetworkConnector</code>, the account has reached the maximum number of network connectors allowed. For <code>UpdateNetworkConnector</code>, the connector has reached the maximum number of versions allowed.</p>
        capo_lambda_core.errors.resource_conflict_exception.ResourceConflictException: <p>The request could not be completed due to a conflict with the current state of the resource. For example, attempting to update a connector that is not in <code>ACTIVE</code> state.</p>
        capo_lambda_core.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified network connector does not exist. Verify the identifier (ID, name, or ARN) and Region.</p>
        capo_lambda_core.errors.service_exception.ServiceException: <p>An internal service error occurred. Retry the request with exponential backoff.</p>
        capo_lambda_core.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was throttled due to exceeding the allowed request rate. Retry the request after a brief wait using exponential backoff.</p>
        capo_lambda_core.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lambda_core.types.update_network_connector_request.UpdateNetworkConnectorRequest]",
    ) -> OperationResponse[
        "capo_lambda_core.types.update_network_connector_response.UpdateNetworkConnectorResponse"
    ]:
        import capo_lambda_core._operations.lambda_core_api_service.update_network_connector

        output, http_response = (
            capo_lambda_core._operations.lambda_core_api_service.update_network_connector.update_network_connector(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateNetworkConnector")
    )
    input_: capo_lambda_core.types.update_network_connector_request.UpdateNetworkConnectorRequest = {
        "identifier": identifier
    }
    if configuration is not None:
        input_["configuration"] = configuration
    if operator_role is not None:
        input_["operator_role"] = operator_role
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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