createHsmConfiguration method

Future<CreateHsmConfigurationResult> createHsmConfiguration({
  1. required String description,
  2. required String hsmConfigurationIdentifier,
  3. required String hsmIpAddress,
  4. required String hsmPartitionName,
  5. required String hsmPartitionPassword,
  6. required String hsmServerPublicCertificate,
  7. List<Tag>? tags,
})

Creates an HSM configuration that contains the information required by an Amazon Redshift cluster to store and use database encryption keys in a Hardware Security Module (HSM). After creating the HSM configuration, you can specify it as a parameter when creating a cluster. The cluster will then store its encryption keys in the HSM.

In addition to creating an HSM configuration, you must also create an HSM client certificate. For more information, go to Hardware Security Modules in the Amazon Redshift Cluster Management Guide.

May throw HsmConfigurationAlreadyExistsFault. May throw HsmConfigurationQuotaExceededFault. May throw TagLimitExceededFault. May throw InvalidTagFault.

Parameter description : A text description of the HSM configuration to be created.

Parameter hsmConfigurationIdentifier : The identifier to be assigned to the new Amazon Redshift HSM configuration.

Parameter hsmIpAddress : The IP address that the Amazon Redshift cluster must use to access the HSM.

Parameter hsmPartitionName : The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.

Parameter hsmPartitionPassword : The password required to access the HSM partition.

Parameter hsmServerPublicCertificate : The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.

Parameter tags : A list of tag instances.

Implementation

Future<CreateHsmConfigurationResult> createHsmConfiguration({
  required String description,
  required String hsmConfigurationIdentifier,
  required String hsmIpAddress,
  required String hsmPartitionName,
  required String hsmPartitionPassword,
  required String hsmServerPublicCertificate,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(description, 'description');
  _s.validateStringLength(
    'description',
    description,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      hsmConfigurationIdentifier, 'hsmConfigurationIdentifier');
  _s.validateStringLength(
    'hsmConfigurationIdentifier',
    hsmConfigurationIdentifier,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(hsmIpAddress, 'hsmIpAddress');
  _s.validateStringLength(
    'hsmIpAddress',
    hsmIpAddress,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(hsmPartitionName, 'hsmPartitionName');
  _s.validateStringLength(
    'hsmPartitionName',
    hsmPartitionName,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(hsmPartitionPassword, 'hsmPartitionPassword');
  _s.validateStringLength(
    'hsmPartitionPassword',
    hsmPartitionPassword,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      hsmServerPublicCertificate, 'hsmServerPublicCertificate');
  _s.validateStringLength(
    'hsmServerPublicCertificate',
    hsmServerPublicCertificate,
    0,
    2147483647,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['Description'] = description;
  $request['HsmConfigurationIdentifier'] = hsmConfigurationIdentifier;
  $request['HsmIpAddress'] = hsmIpAddress;
  $request['HsmPartitionName'] = hsmPartitionName;
  $request['HsmPartitionPassword'] = hsmPartitionPassword;
  $request['HsmServerPublicCertificate'] = hsmServerPublicCertificate;
  tags?.also((arg) => $request['Tags'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateHsmConfiguration',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateHsmConfigurationMessage'],
    shapes: shapes,
    resultWrapper: 'CreateHsmConfigurationResult',
  );
  return CreateHsmConfigurationResult.fromXml($result);
}