Deletes an Amazon EKS add-on.
When you remove an add-on, it's deleted from the cluster. You can always manually start an add-on on the cluster using the Kubernetes API.
Parameters:
-
cluster_name
(ClusterName)
–
The name of your cluster.
-
addon_name
(String)
–
The name of the add-on. The name must match one of the names returned by ListAddons .
-
preserve
(Optional[Boolean], default:
None
)
–
Specifying this option preserves the add-on software on your cluster but Amazon EKS stops managing any settings for the add-on. If an IAM account is associated with the add-on, it isn't removed.
Raises:
-
ClientException
–
These errors are usually caused by a client action. Actions can include using an action or resource on behalf of an IAM principal that doesn't have permissions to use the action or resource or specifying an identifier that is not valid.
-
InvalidParameterException
–
The specified parameter is invalid. Review the available parameters for the API request.
-
InvalidRequestException
–
The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.
-
ResourceNotFoundException
–
The specified resource could not be found. You can view your available clusters with ListClusters. You can view your available managed node groups with ListNodegroups. Amazon EKS clusters and node groups are Amazon Web Services Region specific.
-
ServerException
–
These errors are usually caused by a server-side issue.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_eks/_services/async_eks.py
| async def delete_addon(
self,
cluster_name: "capo_eks.types.cluster_name.ClusterName",
addon_name: "capo_eks.types.string.String",
*,
config_overrides: Optional[AsyncEKSClientConfig] = None,
preserve: Optional["capo_eks.types.boolean.Boolean"] = None,
) -> "capo_eks.types.delete_addon_response.DeleteAddonResponse":
"""<p>Deletes an Amazon EKS add-on.</p> <p>When you remove an add-on, it's deleted from the cluster. You can always manually start an add-on on the cluster using the Kubernetes API.</p>
Args:
cluster_name: <p>The name of your cluster.</p>
addon_name: <p>The name of the add-on. The name must match one of the names returned by <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html"> <code>ListAddons</code> </a>.</p>
preserve: <p>Specifying this option preserves the add-on software on your cluster but Amazon EKS stops managing any settings for the add-on. If an IAM account is associated with the add-on, it isn't removed.</p>
Raises:
capo_eks.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. Actions can include using an action or resource on behalf of an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html">IAM principal</a> that doesn't have permissions to use the action or resource or specifying an identifier that is not valid.</p>
capo_eks.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
capo_eks.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.</p>
capo_eks.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found. You can view your available clusters with <code>ListClusters</code>. You can view your available managed node groups with <code>ListNodegroups</code>. Amazon EKS clusters and node groups are Amazon Web Services Region specific.</p>
capo_eks.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
capo_eks.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_eks.types.delete_addon_request.DeleteAddonRequest]",
) -> AsyncOperationResponse[
"capo_eks.types.delete_addon_response.DeleteAddonResponse"
]:
import capo_eks._operations.aws_wesley_frontend.delete_addon
(
output,
http_response,
) = await capo_eks._operations.aws_wesley_frontend.delete_addon.async_delete_addon(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteAddon")
)
input_: capo_eks.types.delete_addon_request.DeleteAddonRequest = {
"cluster_name": cluster_name,
"addon_name": addon_name,
}
if preserve is not None:
input_["preserve"] = preserve
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|