@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
485 lines • 20 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* An imperative resource that triggers a GCBDR restoration event.
* Creating this resource will initiate a restore operation from a specified backup.
* The resource represents the restore operation and its result.
*
* ## Example Usage
*
* ### Backup Dr Restore Workload Compute Instance Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const restoreComputeBasic = new gcp.backupdisasterrecovery.RestoreWorkload("restore_compute_basic", {
* location: "us-central1",
* backupVaultId: "backup-vault",
* dataSourceId: "data-source",
* backupId: "backup",
* computeInstanceTargetEnvironment: {
* project: "my-project-name",
* zone: "us-central1-a",
* },
* computeInstanceRestoreProperties: {
* name: "restored-instance",
* machineType: "zones/us-central1-a/machineTypes/e2-medium",
* },
* });
* ```
* ### Backup Dr Restore Workload Compute Instance Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const restoreComputeFull = new gcp.backupdisasterrecovery.RestoreWorkload("restore_compute_full", {
* location: "us-central1",
* backupVaultId: "backup-vault",
* dataSourceId: "data-source",
* backupId: "backup",
* computeInstanceTargetEnvironment: {
* project: "my-project-name",
* zone: "us-central1-a",
* },
* computeInstanceRestoreProperties: {
* name: "restored-instance-full",
* machineType: "zones/us-central1-a/machineTypes/e2-medium",
* description: "Restored compute instance with advanced configuration",
* canIpForward: true,
* deletionProtection: false,
* labels: [
* {
* key: "environment",
* value: "production",
* },
* {
* key: "restored",
* value: "true",
* },
* {
* key: "team",
* value: "infrastructure",
* },
* ],
* tags: {
* items: [
* "web",
* "https-server",
* "restored",
* ],
* },
* networkInterfaces: [{
* network: "projects/my-project-name/global/networks/default",
* subnetwork: "projects/my-project-name/regions/us-central1/subnetworks/default",
* accessConfigs: [{
* name: "ONE_TO_ONE_NAT",
* networkTier: "PREMIUM",
* }],
* }],
* scheduling: {
* automaticRestart: true,
* onHostMaintenance: "MIGRATE",
* preemptible: false,
* provisioningModel: "STANDARD",
* },
* serviceAccounts: [{
* email: "default",
* scopes: [
* "https://www.googleapis.com/auth/cloud-platform",
* "https://www.googleapis.com/auth/compute",
* ],
* }],
* shieldedInstanceConfig: {
* enableSecureBoot: true,
* enableVtpm: true,
* enableIntegrityMonitoring: true,
* },
* advancedMachineFeatures: {
* enableNestedVirtualization: false,
* threadsPerCore: 1,
* },
* metadata: {
* items: [
* {
* key: "startup-script",
* value: `#!/bin/bash
* echo 'Instance restored' > /tmp/restored.txt`,
* },
* {
* key: "enable-oslogin",
* value: "TRUE",
* },
* ],
* },
* },
* });
* ```
* ### Backup Dr Restore Workload Disk Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const restoreDiskBasic = new gcp.backupdisasterrecovery.RestoreWorkload("restore_disk_basic", {
* location: "us-central1",
* backupVaultId: "backup-vault",
* dataSourceId: "data-source",
* backupId: "backup",
* diskTargetEnvironment: {
* project: "my-project-name",
* zone: "us-central1-a",
* },
* diskRestoreProperties: {
* name: "restored-disk",
* sizeGb: 100,
* type: "projects/my-project-name/zones/us-central1-a/diskTypes/pd-standard",
* description: "Restored persistent disk from backup",
* labels: {
* environment: "production",
* restored: "true",
* },
* },
* });
* ```
* ### Backup Dr Restore Workload Regional Disk
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const restoreRegionalDisk = new gcp.backupdisasterrecovery.RestoreWorkload("restore_regional_disk", {
* location: "us-central1",
* backupVaultId: "backup-vault",
* dataSourceId: "data-source",
* backupId: "backup",
* regionDiskTargetEnvironment: {
* project: "my-project-name",
* region: "us-central1",
* replicaZones: [
* "projects/my-project-name/zones/us-central1-a",
* "projects/my-project-name/zones/us-central1-b",
* ],
* },
* diskRestoreProperties: {
* name: "restored-regional-disk",
* sizeGb: 200,
* type: "pd-balanced",
* description: "Restored regional persistent disk",
* labels: {
* type: "regional",
* environment: "production",
* },
* provisionedIops: 3000,
* provisionedThroughput: 140,
* },
* });
* ```
* ### Backup Dr Restore Workload Without Delete
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const restoreWithoutDelete = new gcp.backupdisasterrecovery.RestoreWorkload("restore_without_delete", {
* location: "us-central1",
* backupVaultId: "backup-vault",
* dataSourceId: "data-source",
* backupId: "backup",
* deleteRestoredInstance: false,
* diskTargetEnvironment: {
* project: "my-project-name",
* zone: "us-central1-a",
* },
* diskRestoreProperties: {
* name: "persistent-disk",
* sizeGb: 100,
* type: "projects/my-project-name/zones/us-central1-a/diskTypes/pd-standard",
* },
* });
* ```
*
* ## Import
*
* RestoreWorkload can be imported using any of these accepted formats:
*
* * `/{{name}}`
* * `{{name}}`
*
* When using the `pulumi import` command, RestoreWorkload can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:backupdisasterrecovery/restoreWorkload:RestoreWorkload default /{{name}}
* $ pulumi import gcp:backupdisasterrecovery/restoreWorkload:RestoreWorkload default {{name}}
* ```
*/
export declare class RestoreWorkload extends pulumi.CustomResource {
/**
* Get an existing RestoreWorkload resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RestoreWorkloadState, opts?: pulumi.CustomResourceOptions): RestoreWorkload;
/**
* Returns true if the given object is an instance of RestoreWorkload. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is RestoreWorkload;
/**
* Required. The ID of the backup to restore from.
*/
readonly backupId: pulumi.Output<string>;
/**
* Required. The ID of the backup vault.
*/
readonly backupVaultId: pulumi.Output<string>;
/**
* Optional. A field mask used to clear server-side default values during restore.
*/
readonly clearOverridesFieldMask: pulumi.Output<string | undefined>;
/**
* Optional. Compute Engine instance properties to be overridden during restore.
* Structure is documented below.
*/
readonly computeInstanceRestoreProperties: pulumi.Output<outputs.backupdisasterrecovery.RestoreWorkloadComputeInstanceRestoreProperties | undefined>;
/**
* Optional. The destination environment for GCE VM restoration.
* Structure is documented below.
*/
readonly computeInstanceTargetEnvironment: pulumi.Output<outputs.backupdisasterrecovery.RestoreWorkloadComputeInstanceTargetEnvironment | undefined>;
/**
* Required. The ID of the data source.
*/
readonly dataSourceId: pulumi.Output<string>;
/**
* Optional. If true (default), running terraform destroy will delete the live resource in GCP.
* If false, only the restore record is removed from the state, leaving the resource active.
*/
readonly deleteRestoredInstance: pulumi.Output<boolean | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* Optional. Disk properties to be overridden during restore.
* Structure is documented below.
*/
readonly diskRestoreProperties: pulumi.Output<outputs.backupdisasterrecovery.RestoreWorkloadDiskRestoreProperties | undefined>;
/**
* Optional. The destination environment for zonal disk restoration.
* Structure is documented below.
*/
readonly diskTargetEnvironment: pulumi.Output<outputs.backupdisasterrecovery.RestoreWorkloadDiskTargetEnvironment | undefined>;
/**
* Required. The location for the backup vault.
*/
readonly location: pulumi.Output<string>;
/**
* (Optional, Deprecated)
* The resource name of the backup instance.
*
* > **Warning:** `name` is deprecated and will be removed in a future major release. The backup is identified by the parameters (location, backup_vault_id, data_source_id, backup_id).
*
* @deprecated `name` is deprecated and will be removed in a future major release. The backup is identified by the parameters (location, backup_vault_id, data_source_id, backup_id).
*/
readonly name: pulumi.Output<string>;
/**
* Optional. The destination environment for regional disk restoration.
* Structure is documented below.
*/
readonly regionDiskTargetEnvironment: pulumi.Output<outputs.backupdisasterrecovery.RestoreWorkloadRegionDiskTargetEnvironment | undefined>;
/**
* Optional. An optional request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server will know to ignore
* the request if it has already been completed.
*/
readonly requestId: pulumi.Output<string | undefined>;
/**
* Output only. Details of the target resource created/modified as part of restore.
* Structure is documented below.
*/
readonly targetResources: pulumi.Output<outputs.backupdisasterrecovery.RestoreWorkloadTargetResource[]>;
/**
* Create a RestoreWorkload resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: RestoreWorkloadArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering RestoreWorkload resources.
*/
export interface RestoreWorkloadState {
/**
* Required. The ID of the backup to restore from.
*/
backupId?: pulumi.Input<string | undefined>;
/**
* Required. The ID of the backup vault.
*/
backupVaultId?: pulumi.Input<string | undefined>;
/**
* Optional. A field mask used to clear server-side default values during restore.
*/
clearOverridesFieldMask?: pulumi.Input<string | undefined>;
/**
* Optional. Compute Engine instance properties to be overridden during restore.
* Structure is documented below.
*/
computeInstanceRestoreProperties?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadComputeInstanceRestoreProperties | undefined>;
/**
* Optional. The destination environment for GCE VM restoration.
* Structure is documented below.
*/
computeInstanceTargetEnvironment?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadComputeInstanceTargetEnvironment | undefined>;
/**
* Required. The ID of the data source.
*/
dataSourceId?: pulumi.Input<string | undefined>;
/**
* Optional. If true (default), running terraform destroy will delete the live resource in GCP.
* If false, only the restore record is removed from the state, leaving the resource active.
*/
deleteRestoredInstance?: pulumi.Input<boolean | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* Optional. Disk properties to be overridden during restore.
* Structure is documented below.
*/
diskRestoreProperties?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadDiskRestoreProperties | undefined>;
/**
* Optional. The destination environment for zonal disk restoration.
* Structure is documented below.
*/
diskTargetEnvironment?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadDiskTargetEnvironment | undefined>;
/**
* Required. The location for the backup vault.
*/
location?: pulumi.Input<string | undefined>;
/**
* (Optional, Deprecated)
* The resource name of the backup instance.
*
* > **Warning:** `name` is deprecated and will be removed in a future major release. The backup is identified by the parameters (location, backup_vault_id, data_source_id, backup_id).
*
* @deprecated `name` is deprecated and will be removed in a future major release. The backup is identified by the parameters (location, backup_vault_id, data_source_id, backup_id).
*/
name?: pulumi.Input<string | undefined>;
/**
* Optional. The destination environment for regional disk restoration.
* Structure is documented below.
*/
regionDiskTargetEnvironment?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadRegionDiskTargetEnvironment | undefined>;
/**
* Optional. An optional request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server will know to ignore
* the request if it has already been completed.
*/
requestId?: pulumi.Input<string | undefined>;
/**
* Output only. Details of the target resource created/modified as part of restore.
* Structure is documented below.
*/
targetResources?: pulumi.Input<pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadTargetResource>[] | undefined>;
}
/**
* The set of arguments for constructing a RestoreWorkload resource.
*/
export interface RestoreWorkloadArgs {
/**
* Required. The ID of the backup to restore from.
*/
backupId: pulumi.Input<string>;
/**
* Required. The ID of the backup vault.
*/
backupVaultId: pulumi.Input<string>;
/**
* Optional. A field mask used to clear server-side default values during restore.
*/
clearOverridesFieldMask?: pulumi.Input<string | undefined>;
/**
* Optional. Compute Engine instance properties to be overridden during restore.
* Structure is documented below.
*/
computeInstanceRestoreProperties?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadComputeInstanceRestoreProperties | undefined>;
/**
* Optional. The destination environment for GCE VM restoration.
* Structure is documented below.
*/
computeInstanceTargetEnvironment?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadComputeInstanceTargetEnvironment | undefined>;
/**
* Required. The ID of the data source.
*/
dataSourceId: pulumi.Input<string>;
/**
* Optional. If true (default), running terraform destroy will delete the live resource in GCP.
* If false, only the restore record is removed from the state, leaving the resource active.
*/
deleteRestoredInstance?: pulumi.Input<boolean | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* Optional. Disk properties to be overridden during restore.
* Structure is documented below.
*/
diskRestoreProperties?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadDiskRestoreProperties | undefined>;
/**
* Optional. The destination environment for zonal disk restoration.
* Structure is documented below.
*/
diskTargetEnvironment?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadDiskTargetEnvironment | undefined>;
/**
* Required. The location for the backup vault.
*/
location: pulumi.Input<string>;
/**
* (Optional, Deprecated)
* The resource name of the backup instance.
*
* > **Warning:** `name` is deprecated and will be removed in a future major release. The backup is identified by the parameters (location, backup_vault_id, data_source_id, backup_id).
*
* @deprecated `name` is deprecated and will be removed in a future major release. The backup is identified by the parameters (location, backup_vault_id, data_source_id, backup_id).
*/
name?: pulumi.Input<string | undefined>;
/**
* Optional. The destination environment for regional disk restoration.
* Structure is documented below.
*/
regionDiskTargetEnvironment?: pulumi.Input<inputs.backupdisasterrecovery.RestoreWorkloadRegionDiskTargetEnvironment | undefined>;
/**
* Optional. An optional request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server will know to ignore
* the request if it has already been completed.
*/
requestId?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=restoreWorkload.d.ts.map