Skip to content

rotate_encryption_key

rotate_encryption_key(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional[String] = None,
) -> RotateEncryptionKeyResult

Rotates the encryption keys for a cluster.

Parameters:

  • cluster_identifier (Optional[String], default: None ) –

    The unique identifier of the cluster that you want to rotate the encryption keys for.

    Constraints: Must be the name of valid cluster that has encryption enabled.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def rotate_encryption_key(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional["capo_redshift.types.string.String"] = None,
) -> "capo_redshift.types.rotate_encryption_key_result.RotateEncryptionKeyResult":
    """<p>Rotates the encryption keys for a cluster.</p>

    Args:
        cluster_identifier: <p>The unique identifier of the cluster that you want to rotate the encryption keys for.</p> <p>Constraints: Must be the name of valid cluster that has encryption enabled.</p>

    Raises:
        capo_redshift.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster. </p>
        capo_redshift.errors.dependent_service_request_throttling_fault.DependentServiceRequestThrottlingFault: <p>The request cannot be completed because a dependent service is throttling requests made by Amazon Redshift on your behalf. Wait and retry the request.</p>
        capo_redshift.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The specified cluster is not in the <code>available</code> state. </p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.rotate_encryption_key_message.RotateEncryptionKeyMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.rotate_encryption_key_result.RotateEncryptionKeyResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.rotate_encryption_key

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.rotate_encryption_key.rotate_encryption_key(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_redshift.types.rotate_encryption_key_result.RotateEncryptionKeyResult",
    ) -> dict[str, Any]:
        import capo_redshift.types.rotate_encryption_key_result

        return capo_redshift.types.rotate_encryption_key_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("RotateEncryptionKey", redact_output=_redact_output),
    )
    input_: capo_redshift.types.rotate_encryption_key_message.RotateEncryptionKeyMessage = {}
    if cluster_identifier is not None:
        input_["cluster_identifier"] = cluster_identifier

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