updateAddon method

Future<UpdateAddonResponse> updateAddon({
  1. required String addonName,
  2. required String clusterName,
  3. String? addonVersion,
  4. String? clientRequestToken,
  5. ResolveConflicts? resolveConflicts,
  6. String? serviceAccountRoleArn,
})

Updates an Amazon EKS add-on.

May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ResourceInUseException. May throw ClientException. May throw ServerException.

Parameter addonName : The name of the add-on. The name must match one of the names returned by ListAddons .

Parameter clusterName : The name of the cluster.

Parameter addonVersion : The version of the add-on. The version must match one of the versions returned by DescribeAddonVersions .

Parameter clientRequestToken : Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter resolveConflicts : How to resolve parameter value conflicts when applying the new version of the add-on to the cluster.

Parameter serviceAccountRoleArn : The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's service account. The role must be assigned the IAM permissions required by the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions assigned to the node IAM role. For more information, see Amazon EKS node IAM role in the Amazon EKS User Guide.

Implementation

Future<UpdateAddonResponse> updateAddon({
  required String addonName,
  required String clusterName,
  String? addonVersion,
  String? clientRequestToken,
  ResolveConflicts? resolveConflicts,
  String? serviceAccountRoleArn,
}) async {
  ArgumentError.checkNotNull(addonName, 'addonName');
  ArgumentError.checkNotNull(clusterName, 'clusterName');
  _s.validateStringLength(
    'clusterName',
    clusterName,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'serviceAccountRoleArn',
    serviceAccountRoleArn,
    1,
    255,
  );
  final $payload = <String, dynamic>{
    if (addonVersion != null) 'addonVersion': addonVersion,
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (resolveConflicts != null)
      'resolveConflicts': resolveConflicts.toValue(),
    if (serviceAccountRoleArn != null)
      'serviceAccountRoleArn': serviceAccountRoleArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/clusters/${Uri.encodeComponent(clusterName)}/addons/${Uri.encodeComponent(addonName)}/update',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateAddonResponse.fromJson(response);
}