Skip to content

create_certificate_authority async

create_certificate_authority(
    cluster_name: String,
    *,
    config_overrides: Optional[AsyncEKSClientConfig] = None,
    client_request_token: Optional[String] = None,
) -> CreateCertificateAuthorityResponse

Appends a successor certificate authority (CA) to your cluster, beginning the CA rotation process.

A cluster certificate authority is the root of trust for your cluster's control plane. It signs the certificates that secure communication between the Kubernetes API server and its clients, and its public certificate is distributed to your cluster's trust bundle so that worker nodes and clients can verify the API server's identity. Each cluster can have at most two certificate authorities at a time: the outgoing CA that's currently signing (its signingStatus is IN_USE) and one successor CA (signingStatus of NOT_USED) that you can later activate to complete the rotation.

Appending a successor CA adds its public certificate to the cluster's trust bundle so that the cluster trusts both CAs simultaneously (the dual trust period), but it doesn't begin signing certificates. Amazon EKS then distributes the successor CA to the Amazon Web Services managed components in your cluster; you can track this through the CA's distributionStatus. The successor CA can't be activated until its distributionStatus is COMPLETE. To activate it as the cluster's signer, use ActivateCertificateAuthority . This is an asynchronous operation that returns an update object. If you don't append a successor CA yourself, Amazon EKS appends one automatically before the outgoing CA approaches expiration.

For more information, see Rotate the Amazon EKS cluster certificate authority in the Amazon EKS User Guide.

Parameters:

  • cluster_name (String) –

    The name of your cluster.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_eks/_services/async_eks.py
async def create_certificate_authority(
    self,
    cluster_name: "capo_eks.types.string.String",
    *,
    config_overrides: Optional[AsyncEKSClientConfig] = None,
    client_request_token: Optional["capo_eks.types.string.String"] = None,
) -> "capo_eks.types.create_certificate_authority_response.CreateCertificateAuthorityResponse":
    """<p>Appends a successor certificate authority (CA) to your cluster, beginning the CA rotation process.</p> <p>A cluster certificate authority is the root of trust for your cluster's control plane. It signs the certificates that secure communication between the Kubernetes API server and its clients, and its public certificate is distributed to your cluster's trust bundle so that worker nodes and clients can verify the API server's identity. Each cluster can have at most two certificate authorities at a time: the outgoing CA that's currently signing (its <code>signingStatus</code> is <code>IN_USE</code>) and one successor CA (<code>signingStatus</code> of <code>NOT_USED</code>) that you can later activate to complete the rotation.</p> <p>Appending a successor CA adds its public certificate to the cluster's trust bundle so that the cluster trusts both CAs simultaneously (the dual trust period), but it doesn't begin signing certificates. Amazon EKS then distributes the successor CA to the Amazon Web Services managed components in your cluster; you can track this through the CA's <code>distributionStatus</code>. The successor CA can't be activated until its <code>distributionStatus</code> is <code>COMPLETE</code>. To activate it as the cluster's signer, use <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_ActivateCertificateAuthority.html"> <code>ActivateCertificateAuthority</code> </a>. This is an asynchronous operation that returns an <code>update</code> object. If you don't append a successor CA yourself, Amazon EKS appends one automatically before the outgoing CA approaches expiration.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/certificate-authority-rotation.html">Rotate the Amazon EKS cluster certificate authority</a> in the <i>Amazon EKS User Guide</i>.</p>

    Args:
        cluster_name: <p>The name of your cluster.</p>
        client_request_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>

    Raises:
        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.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
        capo_eks.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>You have encountered a service limit on the specified resource.</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.service_unavailable_exception.ServiceUnavailableException: <p>The service is unavailable. Back off and retry the operation.</p>
        capo_eks.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_eks.types.create_certificate_authority_request.CreateCertificateAuthorityRequest]",
    ) -> AsyncOperationResponse[
        "capo_eks.types.create_certificate_authority_response.CreateCertificateAuthorityResponse"
    ]:
        import capo_eks._operations.aws_wesley_frontend.create_certificate_authority

        (
            output,
            http_response,
        ) = await capo_eks._operations.aws_wesley_frontend.create_certificate_authority.async_create_certificate_authority(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCertificateAuthority")
    )
    input_: capo_eks.types.create_certificate_authority_request.CreateCertificateAuthorityRequest = {
        "cluster_name": cluster_name
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output