- NAME
-
- gcloud alpha backup-dr restore-templates create - create a Restore Template
- SYNOPSIS
-
-
gcloud alpha backup-dr restore-templates create(RESTORE_TEMPLATE:--location=LOCATION)--data-source=DATA_SOURCE--resource-type=RESOURCE_TYPE--restore-properties=RESTORE_PROPERTIES[--async] [--description=DESCRIPTION] [--labels=[KEY=VALUE,…]] [--post-restore-cloud-run-job=POST_RESTORE_CLOUD_RUN_JOB--post-restore-timeout=POST_RESTORE_TIMEOUT] [--pre-restore-cloud-run-job=PRE_RESTORE_CLOUD_RUN_JOB--pre-restore-timeout=PRE_RESTORE_TIMEOUT] [--verification-cloud-run-job=VERIFICATION_CLOUD_RUN_JOB--verification-timeout=VERIFICATION_TIMEOUT] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(ALPHA)Create a Restore Template. - EXAMPLES
-
To create a restore template
my-templatein locationus-central1for a Compute Engine instance, run:gcloud alpha backup-dr restore-templates create my-template --location=us-central1 --resource-type="compute.googleapis.com/Instance" --data-source="projects/my-project/locations/us-central1/backupVaults/my-vault/dataSources/my-ds" --restore-properties='{"project": "my-project", "zone":"us-central1-a", "resource": {"name": "test-vm-{EXECUTION_ID}"}}'To create a restore template
my-templatefrom a restore properties file, run:gcloud alpha backup-dr restore-templates create my-template --location=us-central1 --resource-type="compute.googleapis.com/Instance" --data-source="projects/my-project/locations/us-central1/backupVaults/my-vault/dataSources/my-ds" --restore-properties=path/to/restore_properties.json - POSITIONAL ARGUMENTS
-
-
Restore Template resource - to create The arguments in this group can be used to
specify the attributes of this resource. (NOTE) Some attributes are not given
arguments in this group but can be set in other ways.
To set the
projectattribute:-
provide the argument
restore_templateon the command line with a fully specified name; -
provide the argument
--projecton the command line; -
set the property
core/project.
This must be specified.
RESTORE_TEMPLATE-
ID of the Restore Template or fully qualified identifier for the Restore
Template.
To set the
nameattribute:-
provide the argument
restore_templateon the command line.
This positional argument must be specified if any of the other arguments in this group are specified.
-
provide the argument
--location=LOCATION-
The location of the Restore Template.
To set the
locationattribute:-
provide the argument
restore_templateon the command line with a fully specified name; -
provide the argument
--locationon the command line.
-
provide the argument
-
provide the argument
-
Restore Template resource - to create The arguments in this group can be used to
specify the attributes of this resource. (NOTE) Some attributes are not given
arguments in this group but can be set in other ways.
- REQUIRED FLAGS
-
--data-source=DATA_SOURCE- The full resource name of the DataSource from which backups will be selected. Format: projects/{project}/locations/{location}/backupVaults/{vault}/dataSources/{dataSource}
--resource-type=RESOURCE_TYPE- The type of the Google Cloud resource (e.g., compute.googleapis.com/Instance).
--restore-properties=RESTORE_PROPERTIES- Defines the target environment and configuration for restoring the resource. Accepts either an inline JSON or YAML string or a path to a JSON or YAML file containing the properties.
- OPTIONAL FLAGS
-
--async-
Return immediately, without waiting for the operation in progress to complete.
The default is
True. Enabled by default, use--no-asyncto disable. --description=DESCRIPTION- Description of the restore template.
--labels=[KEY=VALUE,…]- Optional resource labels to represent metadata provided by the user.
- Post-restore hook configuration.
--post-restore-cloud-run-job=POST_RESTORE_CLOUD_RUN_JOB- The Cloud Run job to execute after the restore operation. Format: projects/{project}/locations/{location}/jobs/{job}
--post-restore-timeout=POST_RESTORE_TIMEOUT- Timeout for the post-restore hook (e.g., 600s). Must be specified with --post-restore-cloud-run-job.
- Pre-restore hook configuration.
--pre-restore-cloud-run-job=PRE_RESTORE_CLOUD_RUN_JOB- The Cloud Run job to execute before the restore operation. Format: projects/{project}/locations/{location}/jobs/{job}
--pre-restore-timeout=PRE_RESTORE_TIMEOUT- Timeout for the pre-restore hook (e.g., 300s). Must be specified with --pre-restore-cloud-run-job.
- Verification hook configuration.
--verification-cloud-run-job=VERIFICATION_CLOUD_RUN_JOB- The Cloud Run job to execute to verify the restored workload. Format: projects/{project}/locations/{location}/jobs/{job}
--verification-timeout=VERIFICATION_TIMEOUT- Timeout for the verification hook (e.g., 300s). Must be specified with --verification-cloud-run-job.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - BRIEF
- Create a restore template.
- NOTES
-
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation-only early access
allowlist. These variants are also available:
gcloud backup-dr restore-templates creategcloud beta backup-dr restore-templates create
gcloud alpha backup-dr restore-templates create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-10 UTC.