associateEncryptionConfig method

Future<AssociateEncryptionConfigResponse> associateEncryptionConfig({
  1. required String clusterName,
  2. required List<EncryptionConfig> encryptionConfig,
  3. String? clientRequestToken,
})

Associates an encryption configuration to an existing cluster.

Use this API to enable encryption on existing clusters that don't already have encryption enabled. This allows you to implement a defense-in-depth security strategy without migrating applications to new Amazon EKS clusters.

May throw ClientException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ServerException. May throw ThrottlingException.

Parameter clusterName : The name of your cluster.

Parameter encryptionConfig : The configuration you are using for encryption.

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

Implementation

Future<AssociateEncryptionConfigResponse> associateEncryptionConfig({
  required String clusterName,
  required List<EncryptionConfig> encryptionConfig,
  String? clientRequestToken,
}) async {
  final $payload = <String, dynamic>{
    'encryptionConfig': encryptionConfig,
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/clusters/${Uri.encodeComponent(clusterName)}/encryption-config/associate',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateEncryptionConfigResponse.fromJson(response);
}