updateNetworkConnector method

Future<UpdateNetworkConnectorResponse> updateNetworkConnector({
  1. required String identifier,
  2. String? clientToken,
  3. NetworkConnectorConfiguration? configuration,
  4. String? operatorRole,
})

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.

May throw InvalidParameterValueException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw ServiceException. May throw TooManyRequestsException.

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

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

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

Implementation

Future<UpdateNetworkConnectorResponse> updateNetworkConnector({
  required String identifier,
  String? clientToken,
  NetworkConnectorConfiguration? configuration,
  String? operatorRole,
}) async {
  final $payload = <String, dynamic>{
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (configuration != null) 'Configuration': configuration,
    if (operatorRole != null) 'OperatorRole': operatorRole,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/2026-04-04/network-connectors/${Uri.encodeComponent(identifier)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateNetworkConnectorResponse.fromJson(response);
}