Skip to content

register_cluster

register_cluster(
    name: ClusterName,
    connector_config: ConnectorConfigRequest,
    *,
    config_overrides: Optional[EKSClientConfig] = None,
    client_request_token: Optional[String] = None,
    tags: Optional[TagMap] = None,
) -> RegisterClusterResponse

Connects a Kubernetes cluster to the Amazon EKS control plane.

Any Kubernetes cluster can be connected to the Amazon EKS control plane to view current information about the cluster and its nodes.

Cluster connection requires two steps. First, send a RegisterClusterRequest to add it to the Amazon EKS control plane.

Second, a Manifest containing the activationID and activationCode must be applied to the Kubernetes cluster through it's native provider to provide visibility.

After the manifest is updated and applied, the connected cluster is visible to the Amazon EKS control plane. If the manifest isn't applied within three days, the connected cluster will no longer be visible and must be deregistered using DeregisterCluster.

Parameters:

  • name (ClusterName) –

    A unique name for this cluster in your Amazon Web Services Region.

  • connector_config (ConnectorConfigRequest) –

    The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.

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

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

  • tags (Optional[TagMap], default: None ) –

    Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.

Raises:

Source code in docs_src/capo_eks/_services/eks.py
def register_cluster(
    self,
    name: "capo_eks.types.cluster_name.ClusterName",
    connector_config: "capo_eks.types.connector_config_request.ConnectorConfigRequest",
    *,
    config_overrides: Optional[EKSClientConfig] = None,
    client_request_token: Optional["capo_eks.types.string.String"] = None,
    tags: Optional["capo_eks.types.tag_map.TagMap"] = None,
) -> "capo_eks.types.register_cluster_response.RegisterClusterResponse":
    """<p>Connects a Kubernetes cluster to the Amazon EKS control plane. </p> <p>Any Kubernetes cluster can be connected to the Amazon EKS control plane to view current information about the cluster and its nodes. </p> <p>Cluster connection requires two steps. First, send a <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_RegisterClusterRequest.html"> <code>RegisterClusterRequest</code> </a> to add it to the Amazon EKS control plane.</p> <p>Second, a <a href="https://amazon-eks.s3.us-west-2.amazonaws.com/eks-connector/manifests/eks-connector/latest/eks-connector.yaml">Manifest</a> containing the <code>activationID</code> and <code>activationCode</code> must be applied to the Kubernetes cluster through it's native provider to provide visibility.</p> <p>After the manifest is updated and applied, the connected cluster is visible to the Amazon EKS control plane. If the manifest isn't applied within three days, the connected cluster will no longer be visible and must be deregistered using <code>DeregisterCluster</code>.</p>

    Args:
        name: <p>A unique name for this cluster in your Amazon Web Services Region.</p>
        connector_config: <p>The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.</p>
        client_request_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        tags: <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>

    Raises:
        capo_eks.errors.access_denied_exception.AccessDeniedException: <p>You don't have permissions to perform the requested operation. The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html">IAM principal</a> making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html">Access management</a> in the <i>IAM User Guide</i>. </p>
        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.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_propagation_delay_exception.ResourcePropagationDelayException: <p>Required resources (such as service-linked roles) were created and are still propagating. Retry later.</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.
    """

    def _handler(
        req: "OperationRequest[capo_eks.types.register_cluster_request.RegisterClusterRequest]",
    ) -> OperationResponse[
        "capo_eks.types.register_cluster_response.RegisterClusterResponse"
    ]:
        import capo_eks._operations.aws_wesley_frontend.register_cluster

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RegisterCluster")
    )
    input_: capo_eks.types.register_cluster_request.RegisterClusterRequest = {
        "name": name,
        "connector_config": connector_config,
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if tags is not None:
        input_["tags"] = tags

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