registerCluster method

Future<RegisterClusterResponse> registerCluster({
  1. required ConnectorConfigRequest connectorConfig,
  2. required String name,
  3. String? clientRequestToken,
  4. Map<String, String>? tags,
})

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.

May throw AccessDeniedException. May throw ClientException. May throw InvalidParameterException. May throw ResourceInUseException. May throw ResourceLimitExceededException. May throw ResourcePropagationDelayException. May throw ServerException. May throw ServiceUnavailableException.

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

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

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

Parameter tags : 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.

Implementation

Future<RegisterClusterResponse> registerCluster({
  required ConnectorConfigRequest connectorConfig,
  required String name,
  String? clientRequestToken,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'connectorConfig': connectorConfig,
    'name': name,
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/cluster-registrations',
    exceptionFnMap: _exceptionFns,
  );
  return RegisterClusterResponse.fromJson(response);
}