Skip to content

modify_hsm

modify_hsm(
    hsm_arn: HsmArn,
    *,
    config_overrides: Optional[CloudHSMClientConfig] = None,
    subnet_id: Optional[SubnetId] = None,
    eni_ip: Optional[IpAddress] = None,
    iam_role_arn: Optional[IamRoleArn] = None,
    external_id: Optional[ExternalId] = None,
    syslog_ip: Optional[IpAddress] = None,
) -> ModifyHsmResponse

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.

This operation can result in the HSM being offline for up to 15 minutes while the AWS CloudHSM service is reconfigured. If you are modifying a production HSM, you should ensure that your AWS CloudHSM service is configured for high availability, and consider executing this operation during a maintenance window.

Parameters:

  • hsm_arn (HsmArn) –

    The ARN of the HSM to modify.

  • subnet_id (Optional[SubnetId], default: None ) –

    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.

  • eni_ip (Optional[IpAddress], default: None ) –

    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.

  • iam_role_arn (Optional[IamRoleArn], default: None ) –

    The new IAM role ARN.

  • external_id (Optional[ExternalId], default: None ) –

    The new external ID.

  • syslog_ip (Optional[IpAddress], default: None ) –

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

Raises:

Source code in docs_src/capo_cloudhsm/_services/cloud_hsm.py
def modify_hsm(
    self,
    hsm_arn: "capo_cloudhsm.types.hsm_arn.HsmArn",
    *,
    config_overrides: Optional[CloudHSMClientConfig] = None,
    subnet_id: Optional["capo_cloudhsm.types.subnet_id.SubnetId"] = None,
    eni_ip: Optional["capo_cloudhsm.types.ip_address.IpAddress"] = None,
    iam_role_arn: Optional["capo_cloudhsm.types.iam_role_arn.IamRoleArn"] = None,
    external_id: Optional["capo_cloudhsm.types.external_id.ExternalId"] = None,
    syslog_ip: Optional["capo_cloudhsm.types.ip_address.IpAddress"] = None,
) -> "capo_cloudhsm.types.modify_hsm_response.ModifyHsmResponse":
    """<p>This is documentation for <b>AWS CloudHSM Classic</b>. For more information, see <a href="http://aws.amazon.com/cloudhsm/faqs-classic/">AWS CloudHSM Classic FAQs</a>, the <a href="https://docs.aws.amazon.com/cloudhsm/classic/userguide/">AWS CloudHSM Classic User Guide</a>, and the <a href="https://docs.aws.amazon.com/cloudhsm/classic/APIReference/">AWS CloudHSM Classic API Reference</a>.</p> <p> <b>For information about the current version of AWS CloudHSM</b>, see <a href="http://aws.amazon.com/cloudhsm/">AWS CloudHSM</a>, the <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/">AWS CloudHSM User Guide</a>, and the <a href="https://docs.aws.amazon.com/cloudhsm/latest/APIReference/">AWS CloudHSM API Reference</a>.</p> <p>Modifies an HSM.</p> <important> <p>This operation can result in the HSM being offline for up to 15 minutes while the AWS CloudHSM service is reconfigured. If you are modifying a production HSM, you should ensure that your AWS CloudHSM service is configured for high availability, and consider executing this operation during a maintenance window.</p> </important>

    Args:
        hsm_arn: <p>The ARN of the HSM to modify.</p>
        subnet_id: <p>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.</p>
        eni_ip: <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p> <p>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.</p>
        iam_role_arn: <p>The new IAM role ARN.</p>
        external_id: <p>The new external ID.</p>
        syslog_ip: <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>

    Raises:
        capo_cloudhsm.errors.cloud_hsm_internal_exception.CloudHsmInternalException: <p>Indicates that an internal error occurred.</p>
        capo_cloudhsm.errors.cloud_hsm_service_exception.CloudHsmServiceException: <p>Indicates that an exception occurred in the AWS CloudHSM service.</p>
        capo_cloudhsm.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that one or more of the request parameters are not valid.</p>
        capo_cloudhsm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudhsm.types.modify_hsm_request.ModifyHsmRequest]",
    ) -> OperationResponse[
        "capo_cloudhsm.types.modify_hsm_response.ModifyHsmResponse"
    ]:
        import capo_cloudhsm._operations.cloud_hsm_frontend_service.modify_hsm

        output, http_response = (
            capo_cloudhsm._operations.cloud_hsm_frontend_service.modify_hsm.modify_hsm(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyHsm")
    )
    input_: capo_cloudhsm.types.modify_hsm_request.ModifyHsmRequest = {
        "hsm_arn": hsm_arn
    }
    if subnet_id is not None:
        input_["subnet_id"] = subnet_id
    if eni_ip is not None:
        input_["eni_ip"] = eni_ip
    if iam_role_arn is not None:
        input_["iam_role_arn"] = iam_role_arn
    if external_id is not None:
        input_["external_id"] = external_id
    if syslog_ip is not None:
        input_["syslog_ip"] = syslog_ip

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