updateAddon method
Updates an Amazon EKS add-on.
May throw ClientException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
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 your cluster.
Parameter addonVersion :
The version of the add-on. The version must match one of the versions
returned by
DescribeAddonVersions .
Parameter clientRequestToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter configurationValues :
The set of configuration values for the add-on that's created. The values
that you provide are validated against the schema returned by
DescribeAddonConfiguration.
Parameter podIdentityAssociations :
An array of EKS Pod Identity associations to be updated. Each association
maps a Kubernetes service account to an IAM role. If this value is left
blank, no change. If an empty array is provided, existing associations
owned by the add-on are deleted.
For more information, see Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity in the Amazon EKS User Guide.
Parameter resolveConflicts :
How to resolve field value conflicts for an Amazon EKS add-on if you've
changed a value from the Amazon EKS default value. Conflicts are handled
based on the option you choose:
- None – Amazon EKS doesn't change the value. The update might fail.
- Overwrite – Amazon EKS overwrites the changed value back to the Amazon EKS default value.
- Preserve – Amazon EKS preserves the value. If you choose this option, we recommend that you test any field and value changes on a non-production cluster before updating the add-on on your production 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,
String? configurationValues,
List<AddonPodIdentityAssociations>? podIdentityAssociations,
ResolveConflicts? resolveConflicts,
String? serviceAccountRoleArn,
}) async {
final $payload = <String, dynamic>{
if (addonVersion != null) 'addonVersion': addonVersion,
'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (configurationValues != null)
'configurationValues': configurationValues,
if (podIdentityAssociations != null)
'podIdentityAssociations': podIdentityAssociations,
if (resolveConflicts != null) 'resolveConflicts': resolveConflicts.value,
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);
}