Skip to content

create_snapshot_copy_configuration

create_snapshot_copy_configuration(
    namespace_name: NamespaceName,
    destination_region: str,
    *,
    config_overrides: Optional[RedshiftServerlessClientConfig] = None,
    snapshot_retention_period: Optional[int] = None,
    destination_kms_key_id: Optional[KmsKeyId] = None,
) -> CreateSnapshotCopyConfigurationResponse

Creates a snapshot copy configuration that lets you copy snapshots to another Amazon Web Services Region.

Parameters:

  • namespace_name (NamespaceName) –

    The name of the namespace to copy snapshots from.

  • destination_region (str) –

    The destination Amazon Web Services Region that you want to copy snapshots to.

  • snapshot_retention_period (Optional[int], default: None ) –

    The retention period of the snapshots that you copy to the destination Amazon Web Services Region.

  • destination_kms_key_id (Optional[KmsKeyId], default: None ) –

    The KMS key to use to encrypt your snapshots in the destination Amazon Web Services Region.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/redshift_serverless.py
def create_snapshot_copy_configuration(
    self,
    namespace_name: "capo_redshift_serverless.types.namespace_name.NamespaceName",
    destination_region: str,
    *,
    config_overrides: Optional[RedshiftServerlessClientConfig] = None,
    snapshot_retention_period: Optional[int] = None,
    destination_kms_key_id: Optional[
        "capo_redshift_serverless.types.kms_key_id.KmsKeyId"
    ] = None,
) -> "capo_redshift_serverless.types.create_snapshot_copy_configuration_response.CreateSnapshotCopyConfigurationResponse":
    """<p>Creates a snapshot copy configuration that lets you copy snapshots to another Amazon Web Services Region.</p>

    Args:
        namespace_name: <p>The name of the namespace to copy snapshots from.</p>
        destination_region: <p>The destination Amazon Web Services Region that you want to copy snapshots to.</p>
        snapshot_retention_period: <p>The retention period of the snapshots that you copy to the destination Amazon Web Services Region.</p>
        destination_kms_key_id: <p>The KMS key to use to encrypt your snapshots in the destination Amazon Web Services Region.</p>

    Raises:
        capo_redshift_serverless.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_redshift_serverless.errors.conflict_exception.ConflictException: <p>The submitted action has conflicts.</p>
        capo_redshift_serverless.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_redshift_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_redshift_serverless.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service limit was exceeded.</p>
        capo_redshift_serverless.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_redshift_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift_serverless.types.create_snapshot_copy_configuration_request.CreateSnapshotCopyConfigurationRequest]",
    ) -> OperationResponse[
        "capo_redshift_serverless.types.create_snapshot_copy_configuration_response.CreateSnapshotCopyConfigurationResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.create_snapshot_copy_configuration

        output, http_response = (
            capo_redshift_serverless._operations.redshift_serverless.create_snapshot_copy_configuration.create_snapshot_copy_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSnapshotCopyConfiguration")
    )
    input_: capo_redshift_serverless.types.create_snapshot_copy_configuration_request.CreateSnapshotCopyConfigurationRequest = {
        "namespace_name": namespace_name,
        "destination_region": destination_region,
    }
    if snapshot_retention_period is not None:
        input_["snapshot_retention_period"] = snapshot_retention_period
    if destination_kms_key_id is not None:
        input_["destination_kms_key_id"] = destination_kms_key_id

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