Copy an CloudHSM cluster backup to a different region.
Cross-account use: No. You cannot perform this operation on an CloudHSM backup in a different Amazon Web Services account.
Parameters:
-
destination_region
(Region)
–
The AWS region that will contain your copied CloudHSM cluster backup.
-
backup_id
(BackupId)
–
The ID of the backup that will be copied to the destination region.
-
tag_list
(Optional[TagList], default:
None
)
–
Tags to apply to the destination backup during creation. If you specify tags, only these tags will be applied to the destination backup. If you do not specify tags, the service copies tags from the source backup to the destination backup.
Raises:
Source code in docs_src/capo_cloudhsm_v2/_services/cloud_hsmv2.py
| def copy_backup_to_region(
self,
destination_region: "capo_cloudhsm_v2.types.region.Region",
backup_id: "capo_cloudhsm_v2.types.backup_id.BackupId",
*,
config_overrides: Optional[CloudHSMV2ClientConfig] = None,
tag_list: Optional["capo_cloudhsm_v2.types.tag_list.TagList"] = None,
) -> "capo_cloudhsm_v2.types.copy_backup_to_region_response.CopyBackupToRegionResponse":
"""<p>Copy an CloudHSM cluster backup to a different region.</p> <p> <b>Cross-account use:</b> No. You cannot perform this operation on an CloudHSM backup in a different Amazon Web Services account.</p>
Args:
destination_region: <p>The AWS region that will contain your copied CloudHSM cluster backup.</p>
backup_id: <p>The ID of the backup that will be copied to the destination region. </p>
tag_list: <p>Tags to apply to the destination backup during creation. If you specify tags, only these tags will be applied to the destination backup. If you do not specify tags, the service copies tags from the source backup to the destination backup.</p>
Raises:
capo_cloudhsm_v2.errors.cloud_hsm_access_denied_exception.CloudHsmAccessDeniedException: <p>The request was rejected because the requester does not have permission to perform the requested operation.</p>
capo_cloudhsm_v2.errors.cloud_hsm_internal_failure_exception.CloudHsmInternalFailureException: <p>The request was rejected because of an CloudHSM internal failure. The request can be retried.</p>
capo_cloudhsm_v2.errors.cloud_hsm_invalid_request_exception.CloudHsmInvalidRequestException: <p>The request was rejected because it is not a valid request.</p>
capo_cloudhsm_v2.errors.cloud_hsm_resource_not_found_exception.CloudHsmResourceNotFoundException: <p>The request was rejected because it refers to a resource that cannot be found.</p>
capo_cloudhsm_v2.errors.cloud_hsm_service_exception.CloudHsmServiceException: <p>The request was rejected because an error occurred.</p>
capo_cloudhsm_v2.errors.cloud_hsm_tag_exception.CloudHsmTagException: <p>The request was rejected because of a tagging failure. Verify the tag conditions in all applicable policies, and then retry the request.</p>
capo_cloudhsm_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudhsm_v2.types.copy_backup_to_region_request.CopyBackupToRegionRequest]",
) -> OperationResponse[
"capo_cloudhsm_v2.types.copy_backup_to_region_response.CopyBackupToRegionResponse"
]:
import capo_cloudhsm_v2._operations.baldr_api_service.copy_backup_to_region
output, http_response = (
capo_cloudhsm_v2._operations.baldr_api_service.copy_backup_to_region.copy_backup_to_region(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CopyBackupToRegion")
)
input_: capo_cloudhsm_v2.types.copy_backup_to_region_request.CopyBackupToRegionRequest = {
"destination_region": destination_region,
"backup_id": backup_id,
}
if tag_list is not None:
input_["tag_list"] = tag_list
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|