modifyHsm method

Future<ModifyHsmResponse> modifyHsm({
  1. required String hsmArn,
  2. String? eniIp,
  3. String? externalId,
  4. String? iamRoleArn,
  5. String? subnetId,
  6. String? syslogIp,
})

This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.

For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.

Modifies an HSM.

May throw CloudHsmServiceException. May throw CloudHsmInternalException. May throw InvalidRequestException.

Parameter hsmArn : The ARN of the HSM to modify.

Parameter eniIp : The new IP address for the elastic network interface (ENI) attached to the HSM.

If the HSM is moved to a different subnet, and an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the new subnet.

Parameter externalId : The new external ID.

Parameter iamRoleArn : The new IAM role ARN.

Parameter subnetId : The new identifier of the subnet that the HSM is in. The new subnet must be in the same Availability Zone as the current subnet.

Parameter syslogIp : The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.

Implementation

Future<ModifyHsmResponse> modifyHsm({
  required String hsmArn,
  String? eniIp,
  String? externalId,
  String? iamRoleArn,
  String? subnetId,
  String? syslogIp,
}) async {
  ArgumentError.checkNotNull(hsmArn, 'hsmArn');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CloudHsmFrontendService.ModifyHsm'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HsmArn': hsmArn,
      if (eniIp != null) 'EniIp': eniIp,
      if (externalId != null) 'ExternalId': externalId,
      if (iamRoleArn != null) 'IamRoleArn': iamRoleArn,
      if (subnetId != null) 'SubnetId': subnetId,
      if (syslogIp != null) 'SyslogIp': syslogIp,
    },
  );

  return ModifyHsmResponse.fromJson(jsonResponse.body);
}