Skip to content

update_eks_anywhere_subscription

update_eks_anywhere_subscription(
    id: String,
    auto_renew: Boolean,
    *,
    config_overrides: Optional[EKSClientConfig] = None,
    client_request_token: Optional[String] = None,
) -> UpdateEksAnywhereSubscriptionResponse

Update an EKS Anywhere Subscription. Only auto renewal and tags can be updated after subscription creation.

Parameters:

  • id (String) –

    The ID of the subscription.

  • auto_renew (Boolean) –

    A boolean indicating whether or not to automatically renew the subscription.

  • client_request_token (Optional[String], default: None ) –

    Unique, case-sensitive identifier to ensure the idempotency of the request.

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/eks.py
def update_eks_anywhere_subscription(
    self,
    id: "capo_eks.types.string.String",
    auto_renew: "capo_eks.types.boolean.Boolean",
    *,
    config_overrides: Optional[EKSClientConfig] = None,
    client_request_token: Optional["capo_eks.types.string.String"] = None,
) -> "capo_eks.types.update_eks_anywhere_subscription_response.UpdateEksAnywhereSubscriptionResponse":
    """<p>Update an EKS Anywhere Subscription. Only auto renewal and tags can be updated after subscription creation.</p>

    Args:
        id: <p>The ID of the subscription.</p>
        auto_renew: <p>A boolean indicating whether or not to automatically renew the subscription.</p>
        client_request_token: <p>Unique, case-sensitive identifier to ensure the idempotency of the request.</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.
    """

    def _handler(
        req: "OperationRequest[capo_eks.types.update_eks_anywhere_subscription_request.UpdateEksAnywhereSubscriptionRequest]",
    ) -> OperationResponse[
        "capo_eks.types.update_eks_anywhere_subscription_response.UpdateEksAnywhereSubscriptionResponse"
    ]:
        import capo_eks._operations.aws_wesley_frontend.update_eks_anywhere_subscription

        output, http_response = (
            capo_eks._operations.aws_wesley_frontend.update_eks_anywhere_subscription.update_eks_anywhere_subscription(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEksAnywhereSubscription")
    )
    input_: capo_eks.types.update_eks_anywhere_subscription_request.UpdateEksAnywhereSubscriptionRequest = {
        "id": id,
        "auto_renew": auto_renew,
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

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