1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. filestore
  5. Backup
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.filestore.Backup

Explore with Pulumi AI

A Google Cloud Filestore backup.

To get more information about Backup, see:

Example Usage

Filestore Backup Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const instance = new gcp.filestore.Instance("instance", {
    name: "fs-inst",
    location: "us-central1-b",
    tier: "BASIC_HDD",
    fileShares: {
        capacityGb: 1024,
        name: "share1",
    },
    networks: [{
        network: "default",
        modes: ["MODE_IPV4"],
        connectMode: "DIRECT_PEERING",
    }],
});
const backup = new gcp.filestore.Backup("backup", {
    name: "fs-bkup",
    location: "us-central1",
    description: "This is a filestore backup for the test instance",
    sourceInstance: instance.id,
    sourceFileShare: "share1",
    labels: {
        files: "label1",
        "other-label": "label2",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

instance = gcp.filestore.Instance("instance",
    name="fs-inst",
    location="us-central1-b",
    tier="BASIC_HDD",
    file_shares={
        "capacity_gb": 1024,
        "name": "share1",
    },
    networks=[{
        "network": "default",
        "modes": ["MODE_IPV4"],
        "connect_mode": "DIRECT_PEERING",
    }])
backup = gcp.filestore.Backup("backup",
    name="fs-bkup",
    location="us-central1",
    description="This is a filestore backup for the test instance",
    source_instance=instance.id,
    source_file_share="share1",
    labels={
        "files": "label1",
        "other-label": "label2",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/filestore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		instance, err := filestore.NewInstance(ctx, "instance", &filestore.InstanceArgs{
			Name:     pulumi.String("fs-inst"),
			Location: pulumi.String("us-central1-b"),
			Tier:     pulumi.String("BASIC_HDD"),
			FileShares: &filestore.InstanceFileSharesArgs{
				CapacityGb: pulumi.Int(1024),
				Name:       pulumi.String("share1"),
			},
			Networks: filestore.InstanceNetworkArray{
				&filestore.InstanceNetworkArgs{
					Network: pulumi.String("default"),
					Modes: pulumi.StringArray{
						pulumi.String("MODE_IPV4"),
					},
					ConnectMode: pulumi.String("DIRECT_PEERING"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = filestore.NewBackup(ctx, "backup", &filestore.BackupArgs{
			Name:            pulumi.String("fs-bkup"),
			Location:        pulumi.String("us-central1"),
			Description:     pulumi.String("This is a filestore backup for the test instance"),
			SourceInstance:  instance.ID(),
			SourceFileShare: pulumi.String("share1"),
			Labels: pulumi.StringMap{
				"files":       pulumi.String("label1"),
				"other-label": pulumi.String("label2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var instance = new Gcp.Filestore.Instance("instance", new()
    {
        Name = "fs-inst",
        Location = "us-central1-b",
        Tier = "BASIC_HDD",
        FileShares = new Gcp.Filestore.Inputs.InstanceFileSharesArgs
        {
            CapacityGb = 1024,
            Name = "share1",
        },
        Networks = new[]
        {
            new Gcp.Filestore.Inputs.InstanceNetworkArgs
            {
                Network = "default",
                Modes = new[]
                {
                    "MODE_IPV4",
                },
                ConnectMode = "DIRECT_PEERING",
            },
        },
    });

    var backup = new Gcp.Filestore.Backup("backup", new()
    {
        Name = "fs-bkup",
        Location = "us-central1",
        Description = "This is a filestore backup for the test instance",
        SourceInstance = instance.Id,
        SourceFileShare = "share1",
        Labels = 
        {
            { "files", "label1" },
            { "other-label", "label2" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.filestore.Instance;
import com.pulumi.gcp.filestore.InstanceArgs;
import com.pulumi.gcp.filestore.inputs.InstanceFileSharesArgs;
import com.pulumi.gcp.filestore.inputs.InstanceNetworkArgs;
import com.pulumi.gcp.filestore.Backup;
import com.pulumi.gcp.filestore.BackupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var instance = new Instance("instance", InstanceArgs.builder()
            .name("fs-inst")
            .location("us-central1-b")
            .tier("BASIC_HDD")
            .fileShares(InstanceFileSharesArgs.builder()
                .capacityGb(1024)
                .name("share1")
                .build())
            .networks(InstanceNetworkArgs.builder()
                .network("default")
                .modes("MODE_IPV4")
                .connectMode("DIRECT_PEERING")
                .build())
            .build());

        var backup = new Backup("backup", BackupArgs.builder()
            .name("fs-bkup")
            .location("us-central1")
            .description("This is a filestore backup for the test instance")
            .sourceInstance(instance.id())
            .sourceFileShare("share1")
            .labels(Map.ofEntries(
                Map.entry("files", "label1"),
                Map.entry("other-label", "label2")
            ))
            .build());

    }
}
Copy
resources:
  instance:
    type: gcp:filestore:Instance
    properties:
      name: fs-inst
      location: us-central1-b
      tier: BASIC_HDD
      fileShares:
        capacityGb: 1024
        name: share1
      networks:
        - network: default
          modes:
            - MODE_IPV4
          connectMode: DIRECT_PEERING
  backup:
    type: gcp:filestore:Backup
    properties:
      name: fs-bkup
      location: us-central1
      description: This is a filestore backup for the test instance
      sourceInstance: ${instance.id}
      sourceFileShare: share1
      labels:
        files: label1
        other-label: label2
Copy

Create Backup Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Backup(name: string, args: BackupArgs, opts?: CustomResourceOptions);
@overload
def Backup(resource_name: str,
           args: BackupArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def Backup(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           location: Optional[str] = None,
           source_file_share: Optional[str] = None,
           source_instance: Optional[str] = None,
           description: Optional[str] = None,
           labels: Optional[Mapping[str, str]] = None,
           name: Optional[str] = None,
           project: Optional[str] = None,
           tags: Optional[Mapping[str, str]] = None)
func NewBackup(ctx *Context, name string, args BackupArgs, opts ...ResourceOption) (*Backup, error)
public Backup(string name, BackupArgs args, CustomResourceOptions? opts = null)
public Backup(String name, BackupArgs args)
public Backup(String name, BackupArgs args, CustomResourceOptions options)
type: gcp:filestore:Backup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BackupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. BackupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. BackupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BackupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. BackupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var gcpBackupResource = new Gcp.Filestore.Backup("gcpBackupResource", new()
{
    Location = "string",
    SourceFileShare = "string",
    SourceInstance = "string",
    Description = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    Project = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := filestore.NewBackup(ctx, "gcpBackupResource", &filestore.BackupArgs{
	Location:        pulumi.String("string"),
	SourceFileShare: pulumi.String("string"),
	SourceInstance:  pulumi.String("string"),
	Description:     pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var gcpBackupResource = new Backup("gcpBackupResource", BackupArgs.builder()
    .location("string")
    .sourceFileShare("string")
    .sourceInstance("string")
    .description("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .project("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
gcp_backup_resource = gcp.filestore.Backup("gcpBackupResource",
    location="string",
    source_file_share="string",
    source_instance="string",
    description="string",
    labels={
        "string": "string",
    },
    name="string",
    project="string",
    tags={
        "string": "string",
    })
Copy
const gcpBackupResource = new gcp.filestore.Backup("gcpBackupResource", {
    location: "string",
    sourceFileShare: "string",
    sourceInstance: "string",
    description: "string",
    labels: {
        string: "string",
    },
    name: "string",
    project: "string",
    tags: {
        string: "string",
    },
});
Copy
type: gcp:filestore:Backup
properties:
    description: string
    labels:
        string: string
    location: string
    name: string
    project: string
    sourceFileShare: string
    sourceInstance: string
    tags:
        string: string
Copy

Backup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Backup resource accepts the following input properties:

Location
This property is required.
Changes to this property will trigger replacement.
string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


SourceFileShare
This property is required.
Changes to this property will trigger replacement.
string
Name of the file share in the source Cloud Filestore instance that the backup is created from.
SourceInstance This property is required. string
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
Description string
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
Labels Dictionary<string, string>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Name Changes to this property will trigger replacement. string
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Tags Changes to this property will trigger replacement. Dictionary<string, string>
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
Location
This property is required.
Changes to this property will trigger replacement.
string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


SourceFileShare
This property is required.
Changes to this property will trigger replacement.
string
Name of the file share in the source Cloud Filestore instance that the backup is created from.
SourceInstance This property is required. string
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
Description string
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
Labels map[string]string

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Name Changes to this property will trigger replacement. string
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Tags Changes to this property will trigger replacement. map[string]string
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
location
This property is required.
Changes to this property will trigger replacement.
String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


sourceFileShare
This property is required.
Changes to this property will trigger replacement.
String
Name of the file share in the source Cloud Filestore instance that the backup is created from.
sourceInstance This property is required. String
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
description String
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
labels Map<String,String>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. String
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
tags Changes to this property will trigger replacement. Map<String,String>
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
location
This property is required.
Changes to this property will trigger replacement.
string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


sourceFileShare
This property is required.
Changes to this property will trigger replacement.
string
Name of the file share in the source Cloud Filestore instance that the backup is created from.
sourceInstance This property is required. string
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
description string
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
labels {[key: string]: string}

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. string
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
tags Changes to this property will trigger replacement. {[key: string]: string}
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
location
This property is required.
Changes to this property will trigger replacement.
str
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


source_file_share
This property is required.
Changes to this property will trigger replacement.
str
Name of the file share in the source Cloud Filestore instance that the backup is created from.
source_instance This property is required. str
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
description str
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
labels Mapping[str, str]

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. str
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
tags Changes to this property will trigger replacement. Mapping[str, str]
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
location
This property is required.
Changes to this property will trigger replacement.
String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


sourceFileShare
This property is required.
Changes to this property will trigger replacement.
String
Name of the file share in the source Cloud Filestore instance that the backup is created from.
sourceInstance This property is required. String
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
description String
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
labels Map<String>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. String
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
tags Changes to this property will trigger replacement. Map<String>
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.

Outputs

All input properties are implicitly available as output properties. Additionally, the Backup resource produces the following output properties:

CapacityGb string
The amount of bytes needed to allocate a full copy of the snapshot content.
CreateTime string
The time when the snapshot was created in RFC3339 text format.
DownloadBytes string
Amount of bytes that will be downloaded if the backup is restored.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Id string
The provider-assigned unique ID for this managed resource.
KmsKeyName string
KMS key name used for data encryption.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
SourceInstanceTier string
The service tier of the source Cloud Filestore instance that this backup is created from.
State string
The backup state.
StorageBytes string
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
CapacityGb string
The amount of bytes needed to allocate a full copy of the snapshot content.
CreateTime string
The time when the snapshot was created in RFC3339 text format.
DownloadBytes string
Amount of bytes that will be downloaded if the backup is restored.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Id string
The provider-assigned unique ID for this managed resource.
KmsKeyName string
KMS key name used for data encryption.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
SourceInstanceTier string
The service tier of the source Cloud Filestore instance that this backup is created from.
State string
The backup state.
StorageBytes string
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
capacityGb String
The amount of bytes needed to allocate a full copy of the snapshot content.
createTime String
The time when the snapshot was created in RFC3339 text format.
downloadBytes String
Amount of bytes that will be downloaded if the backup is restored.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id String
The provider-assigned unique ID for this managed resource.
kmsKeyName String
KMS key name used for data encryption.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
sourceInstanceTier String
The service tier of the source Cloud Filestore instance that this backup is created from.
state String
The backup state.
storageBytes String
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
capacityGb string
The amount of bytes needed to allocate a full copy of the snapshot content.
createTime string
The time when the snapshot was created in RFC3339 text format.
downloadBytes string
Amount of bytes that will be downloaded if the backup is restored.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id string
The provider-assigned unique ID for this managed resource.
kmsKeyName string
KMS key name used for data encryption.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
sourceInstanceTier string
The service tier of the source Cloud Filestore instance that this backup is created from.
state string
The backup state.
storageBytes string
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
capacity_gb str
The amount of bytes needed to allocate a full copy of the snapshot content.
create_time str
The time when the snapshot was created in RFC3339 text format.
download_bytes str
Amount of bytes that will be downloaded if the backup is restored.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id str
The provider-assigned unique ID for this managed resource.
kms_key_name str
KMS key name used for data encryption.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
source_instance_tier str
The service tier of the source Cloud Filestore instance that this backup is created from.
state str
The backup state.
storage_bytes str
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
capacityGb String
The amount of bytes needed to allocate a full copy of the snapshot content.
createTime String
The time when the snapshot was created in RFC3339 text format.
downloadBytes String
Amount of bytes that will be downloaded if the backup is restored.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id String
The provider-assigned unique ID for this managed resource.
kmsKeyName String
KMS key name used for data encryption.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
sourceInstanceTier String
The service tier of the source Cloud Filestore instance that this backup is created from.
state String
The backup state.
storageBytes String
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.

Look up Existing Backup Resource

Get an existing Backup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BackupState, opts?: CustomResourceOptions): Backup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        capacity_gb: Optional[str] = None,
        create_time: Optional[str] = None,
        description: Optional[str] = None,
        download_bytes: Optional[str] = None,
        effective_labels: Optional[Mapping[str, str]] = None,
        kms_key_name: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        pulumi_labels: Optional[Mapping[str, str]] = None,
        source_file_share: Optional[str] = None,
        source_instance: Optional[str] = None,
        source_instance_tier: Optional[str] = None,
        state: Optional[str] = None,
        storage_bytes: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None) -> Backup
func GetBackup(ctx *Context, name string, id IDInput, state *BackupState, opts ...ResourceOption) (*Backup, error)
public static Backup Get(string name, Input<string> id, BackupState? state, CustomResourceOptions? opts = null)
public static Backup get(String name, Output<String> id, BackupState state, CustomResourceOptions options)
resources:  _:    type: gcp:filestore:Backup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CapacityGb string
The amount of bytes needed to allocate a full copy of the snapshot content.
CreateTime string
The time when the snapshot was created in RFC3339 text format.
Description string
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
DownloadBytes string
Amount of bytes that will be downloaded if the backup is restored.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
KmsKeyName string
KMS key name used for data encryption.
Labels Dictionary<string, string>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Location Changes to this property will trigger replacement. string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


Name Changes to this property will trigger replacement. string
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
SourceFileShare Changes to this property will trigger replacement. string
Name of the file share in the source Cloud Filestore instance that the backup is created from.
SourceInstance string
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
SourceInstanceTier string
The service tier of the source Cloud Filestore instance that this backup is created from.
State string
The backup state.
StorageBytes string
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
Tags Changes to this property will trigger replacement. Dictionary<string, string>
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
CapacityGb string
The amount of bytes needed to allocate a full copy of the snapshot content.
CreateTime string
The time when the snapshot was created in RFC3339 text format.
Description string
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
DownloadBytes string
Amount of bytes that will be downloaded if the backup is restored.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
KmsKeyName string
KMS key name used for data encryption.
Labels map[string]string

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Location Changes to this property will trigger replacement. string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


Name Changes to this property will trigger replacement. string
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
SourceFileShare Changes to this property will trigger replacement. string
Name of the file share in the source Cloud Filestore instance that the backup is created from.
SourceInstance string
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
SourceInstanceTier string
The service tier of the source Cloud Filestore instance that this backup is created from.
State string
The backup state.
StorageBytes string
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
Tags Changes to this property will trigger replacement. map[string]string
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
capacityGb String
The amount of bytes needed to allocate a full copy of the snapshot content.
createTime String
The time when the snapshot was created in RFC3339 text format.
description String
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
downloadBytes String
Amount of bytes that will be downloaded if the backup is restored.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
kmsKeyName String
KMS key name used for data encryption.
labels Map<String,String>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


name Changes to this property will trigger replacement. String
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
sourceFileShare Changes to this property will trigger replacement. String
Name of the file share in the source Cloud Filestore instance that the backup is created from.
sourceInstance String
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
sourceInstanceTier String
The service tier of the source Cloud Filestore instance that this backup is created from.
state String
The backup state.
storageBytes String
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
tags Changes to this property will trigger replacement. Map<String,String>
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
capacityGb string
The amount of bytes needed to allocate a full copy of the snapshot content.
createTime string
The time when the snapshot was created in RFC3339 text format.
description string
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
downloadBytes string
Amount of bytes that will be downloaded if the backup is restored.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
kmsKeyName string
KMS key name used for data encryption.
labels {[key: string]: string}

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


name Changes to this property will trigger replacement. string
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
sourceFileShare Changes to this property will trigger replacement. string
Name of the file share in the source Cloud Filestore instance that the backup is created from.
sourceInstance string
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
sourceInstanceTier string
The service tier of the source Cloud Filestore instance that this backup is created from.
state string
The backup state.
storageBytes string
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
tags Changes to this property will trigger replacement. {[key: string]: string}
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
capacity_gb str
The amount of bytes needed to allocate a full copy of the snapshot content.
create_time str
The time when the snapshot was created in RFC3339 text format.
description str
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
download_bytes str
Amount of bytes that will be downloaded if the backup is restored.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
kms_key_name str
KMS key name used for data encryption.
labels Mapping[str, str]

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. str
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


name Changes to this property will trigger replacement. str
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
source_file_share Changes to this property will trigger replacement. str
Name of the file share in the source Cloud Filestore instance that the backup is created from.
source_instance str
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
source_instance_tier str
The service tier of the source Cloud Filestore instance that this backup is created from.
state str
The backup state.
storage_bytes str
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
tags Changes to this property will trigger replacement. Mapping[str, str]
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.
capacityGb String
The amount of bytes needed to allocate a full copy of the snapshot content.
createTime String
The time when the snapshot was created in RFC3339 text format.
description String
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
downloadBytes String
Amount of bytes that will be downloaded if the backup is restored.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
kmsKeyName String
KMS key name used for data encryption.
labels Map<String>

Resource labels to represent user-provided metadata.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.


name Changes to this property will trigger replacement. String
The resource name of the backup. The name must be unique within the specified instance. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
sourceFileShare Changes to this property will trigger replacement. String
Name of the file share in the source Cloud Filestore instance that the backup is created from.
sourceInstance String
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
sourceInstanceTier String
The service tier of the source Cloud Filestore instance that this backup is created from.
state String
The backup state.
storageBytes String
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
tags Changes to this property will trigger replacement. Map<String>
A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}. The field is ignored (both PUT & PATCH) when empty.

Import

Backup can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/backups/{{name}}

  • {{project}}/{{location}}/{{name}}

  • {{location}}/{{name}}

When using the pulumi import command, Backup can be imported using one of the formats above. For example:

$ pulumi import gcp:filestore/backup:Backup default projects/{{project}}/locations/{{location}}/backups/{{name}}
Copy
$ pulumi import gcp:filestore/backup:Backup default {{project}}/{{location}}/{{name}}
Copy
$ pulumi import gcp:filestore/backup:Backup default {{location}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.