1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. alloydb
  5. Backup
Google Cloud Classic v6.58.0 published on Tuesday, Jun 6, 2023 by Pulumi

gcp.alloydb.Backup

Explore with Pulumi AI

gcp logo
Google Cloud Classic v6.58.0 published on Tuesday, Jun 6, 2023 by Pulumi

    An AlloyDB Backup.

    To get more information about Backup, see:

    Example Usage

    Alloydb Backup Basic

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultNetwork = Gcp.Compute.GetNetwork.Invoke(new()
        {
            Name = "alloydb-network",
        });
    
        var defaultCluster = new Gcp.Alloydb.Cluster("defaultCluster", new()
        {
            ClusterId = "alloydb-cluster",
            Location = "us-central1",
            Network = defaultNetwork.Apply(getNetworkResult => getNetworkResult.Id),
        });
    
        var privateIpAlloc = new Gcp.Compute.GlobalAddress("privateIpAlloc", new()
        {
            AddressType = "INTERNAL",
            Purpose = "VPC_PEERING",
            PrefixLength = 16,
            Network = defaultNetwork.Apply(getNetworkResult => getNetworkResult.Id),
        });
    
        var vpcConnection = new Gcp.ServiceNetworking.Connection("vpcConnection", new()
        {
            Network = defaultNetwork.Apply(getNetworkResult => getNetworkResult.Id),
            Service = "servicenetworking.googleapis.com",
            ReservedPeeringRanges = new[]
            {
                privateIpAlloc.Name,
            },
        });
    
        var defaultInstance = new Gcp.Alloydb.Instance("defaultInstance", new()
        {
            Cluster = defaultCluster.Name,
            InstanceId = "alloydb-instance",
            InstanceType = "PRIMARY",
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                vpcConnection,
            },
        });
    
        var defaultBackup = new Gcp.Alloydb.Backup("defaultBackup", new()
        {
            Location = "us-central1",
            BackupId = "alloydb-backup",
            ClusterName = defaultCluster.Name,
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                defaultInstance,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/alloydb"
    	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/servicenetworking"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultNetwork, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
    			Name: "alloydb-network",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultCluster, err := alloydb.NewCluster(ctx, "defaultCluster", &alloydb.ClusterArgs{
    			ClusterId: pulumi.String("alloydb-cluster"),
    			Location:  pulumi.String("us-central1"),
    			Network:   *pulumi.String(defaultNetwork.Id),
    		})
    		if err != nil {
    			return err
    		}
    		privateIpAlloc, err := compute.NewGlobalAddress(ctx, "privateIpAlloc", &compute.GlobalAddressArgs{
    			AddressType:  pulumi.String("INTERNAL"),
    			Purpose:      pulumi.String("VPC_PEERING"),
    			PrefixLength: pulumi.Int(16),
    			Network:      *pulumi.String(defaultNetwork.Id),
    		})
    		if err != nil {
    			return err
    		}
    		vpcConnection, err := servicenetworking.NewConnection(ctx, "vpcConnection", &servicenetworking.ConnectionArgs{
    			Network: *pulumi.String(defaultNetwork.Id),
    			Service: pulumi.String("servicenetworking.googleapis.com"),
    			ReservedPeeringRanges: pulumi.StringArray{
    				privateIpAlloc.Name,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultInstance, err := alloydb.NewInstance(ctx, "defaultInstance", &alloydb.InstanceArgs{
    			Cluster:      defaultCluster.Name,
    			InstanceId:   pulumi.String("alloydb-instance"),
    			InstanceType: pulumi.String("PRIMARY"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			vpcConnection,
    		}))
    		if err != nil {
    			return err
    		}
    		_, err = alloydb.NewBackup(ctx, "defaultBackup", &alloydb.BackupArgs{
    			Location:    pulumi.String("us-central1"),
    			BackupId:    pulumi.String("alloydb-backup"),
    			ClusterName: defaultCluster.Name,
    		}, pulumi.DependsOn([]pulumi.Resource{
    			defaultInstance,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
    import com.pulumi.gcp.alloydb.Cluster;
    import com.pulumi.gcp.alloydb.ClusterArgs;
    import com.pulumi.gcp.compute.GlobalAddress;
    import com.pulumi.gcp.compute.GlobalAddressArgs;
    import com.pulumi.gcp.servicenetworking.Connection;
    import com.pulumi.gcp.servicenetworking.ConnectionArgs;
    import com.pulumi.gcp.alloydb.Instance;
    import com.pulumi.gcp.alloydb.InstanceArgs;
    import com.pulumi.gcp.alloydb.Backup;
    import com.pulumi.gcp.alloydb.BackupArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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) {
            final var defaultNetwork = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
                .name("alloydb-network")
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()        
                .clusterId("alloydb-cluster")
                .location("us-central1")
                .network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
                .build());
    
            var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()        
                .addressType("INTERNAL")
                .purpose("VPC_PEERING")
                .prefixLength(16)
                .network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
                .build());
    
            var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()        
                .network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
                .service("servicenetworking.googleapis.com")
                .reservedPeeringRanges(privateIpAlloc.name())
                .build());
    
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
                .cluster(defaultCluster.name())
                .instanceId("alloydb-instance")
                .instanceType("PRIMARY")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(vpcConnection)
                    .build());
    
            var defaultBackup = new Backup("defaultBackup", BackupArgs.builder()        
                .location("us-central1")
                .backupId("alloydb-backup")
                .clusterName(defaultCluster.name())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(defaultInstance)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    default_network = gcp.compute.get_network(name="alloydb-network")
    default_cluster = gcp.alloydb.Cluster("defaultCluster",
        cluster_id="alloydb-cluster",
        location="us-central1",
        network=default_network.id)
    private_ip_alloc = gcp.compute.GlobalAddress("privateIpAlloc",
        address_type="INTERNAL",
        purpose="VPC_PEERING",
        prefix_length=16,
        network=default_network.id)
    vpc_connection = gcp.servicenetworking.Connection("vpcConnection",
        network=default_network.id,
        service="servicenetworking.googleapis.com",
        reserved_peering_ranges=[private_ip_alloc.name])
    default_instance = gcp.alloydb.Instance("defaultInstance",
        cluster=default_cluster.name,
        instance_id="alloydb-instance",
        instance_type="PRIMARY",
        opts=pulumi.ResourceOptions(depends_on=[vpc_connection]))
    default_backup = gcp.alloydb.Backup("defaultBackup",
        location="us-central1",
        backup_id="alloydb-backup",
        cluster_name=default_cluster.name,
        opts=pulumi.ResourceOptions(depends_on=[default_instance]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const defaultNetwork = gcp.compute.getNetwork({
        name: "alloydb-network",
    });
    const defaultCluster = new gcp.alloydb.Cluster("defaultCluster", {
        clusterId: "alloydb-cluster",
        location: "us-central1",
        network: defaultNetwork.then(defaultNetwork => defaultNetwork.id),
    });
    const privateIpAlloc = new gcp.compute.GlobalAddress("privateIpAlloc", {
        addressType: "INTERNAL",
        purpose: "VPC_PEERING",
        prefixLength: 16,
        network: defaultNetwork.then(defaultNetwork => defaultNetwork.id),
    });
    const vpcConnection = new gcp.servicenetworking.Connection("vpcConnection", {
        network: defaultNetwork.then(defaultNetwork => defaultNetwork.id),
        service: "servicenetworking.googleapis.com",
        reservedPeeringRanges: [privateIpAlloc.name],
    });
    const defaultInstance = new gcp.alloydb.Instance("defaultInstance", {
        cluster: defaultCluster.name,
        instanceId: "alloydb-instance",
        instanceType: "PRIMARY",
    }, {
        dependsOn: [vpcConnection],
    });
    const defaultBackup = new gcp.alloydb.Backup("defaultBackup", {
        location: "us-central1",
        backupId: "alloydb-backup",
        clusterName: defaultCluster.name,
    }, {
        dependsOn: [defaultInstance],
    });
    
    resources:
      defaultBackup:
        type: gcp:alloydb:Backup
        properties:
          location: us-central1
          backupId: alloydb-backup
          clusterName: ${defaultCluster.name}
        options:
          dependson:
            - ${defaultInstance}
      defaultCluster:
        type: gcp:alloydb:Cluster
        properties:
          clusterId: alloydb-cluster
          location: us-central1
          network: ${defaultNetwork.id}
      defaultInstance:
        type: gcp:alloydb:Instance
        properties:
          cluster: ${defaultCluster.name}
          instanceId: alloydb-instance
          instanceType: PRIMARY
        options:
          dependson:
            - ${vpcConnection}
      privateIpAlloc:
        type: gcp:compute:GlobalAddress
        properties:
          addressType: INTERNAL
          purpose: VPC_PEERING
          prefixLength: 16
          network: ${defaultNetwork.id}
      vpcConnection:
        type: gcp:servicenetworking:Connection
        properties:
          network: ${defaultNetwork.id}
          service: servicenetworking.googleapis.com
          reservedPeeringRanges:
            - ${privateIpAlloc.name}
    variables:
      defaultNetwork:
        fn::invoke:
          Function: gcp:compute:getNetwork
          Arguments:
            name: alloydb-network
    

    Alloydb Backup Full

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultNetwork = Gcp.Compute.GetNetwork.Invoke(new()
        {
            Name = "alloydb-network",
        });
    
        var defaultCluster = new Gcp.Alloydb.Cluster("defaultCluster", new()
        {
            ClusterId = "alloydb-cluster",
            Location = "us-central1",
            Network = defaultNetwork.Apply(getNetworkResult => getNetworkResult.Id),
        });
    
        var privateIpAlloc = new Gcp.Compute.GlobalAddress("privateIpAlloc", new()
        {
            AddressType = "INTERNAL",
            Purpose = "VPC_PEERING",
            PrefixLength = 16,
            Network = defaultNetwork.Apply(getNetworkResult => getNetworkResult.Id),
        });
    
        var vpcConnection = new Gcp.ServiceNetworking.Connection("vpcConnection", new()
        {
            Network = defaultNetwork.Apply(getNetworkResult => getNetworkResult.Id),
            Service = "servicenetworking.googleapis.com",
            ReservedPeeringRanges = new[]
            {
                privateIpAlloc.Name,
            },
        });
    
        var defaultInstance = new Gcp.Alloydb.Instance("defaultInstance", new()
        {
            Cluster = defaultCluster.Name,
            InstanceId = "alloydb-instance",
            InstanceType = "PRIMARY",
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                vpcConnection,
            },
        });
    
        var defaultBackup = new Gcp.Alloydb.Backup("defaultBackup", new()
        {
            Location = "us-central1",
            BackupId = "alloydb-backup",
            ClusterName = defaultCluster.Name,
            Description = "example description",
            Labels = 
            {
                { "label", "key" },
            },
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                defaultInstance,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/alloydb"
    	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/servicenetworking"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultNetwork, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
    			Name: "alloydb-network",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultCluster, err := alloydb.NewCluster(ctx, "defaultCluster", &alloydb.ClusterArgs{
    			ClusterId: pulumi.String("alloydb-cluster"),
    			Location:  pulumi.String("us-central1"),
    			Network:   *pulumi.String(defaultNetwork.Id),
    		})
    		if err != nil {
    			return err
    		}
    		privateIpAlloc, err := compute.NewGlobalAddress(ctx, "privateIpAlloc", &compute.GlobalAddressArgs{
    			AddressType:  pulumi.String("INTERNAL"),
    			Purpose:      pulumi.String("VPC_PEERING"),
    			PrefixLength: pulumi.Int(16),
    			Network:      *pulumi.String(defaultNetwork.Id),
    		})
    		if err != nil {
    			return err
    		}
    		vpcConnection, err := servicenetworking.NewConnection(ctx, "vpcConnection", &servicenetworking.ConnectionArgs{
    			Network: *pulumi.String(defaultNetwork.Id),
    			Service: pulumi.String("servicenetworking.googleapis.com"),
    			ReservedPeeringRanges: pulumi.StringArray{
    				privateIpAlloc.Name,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultInstance, err := alloydb.NewInstance(ctx, "defaultInstance", &alloydb.InstanceArgs{
    			Cluster:      defaultCluster.Name,
    			InstanceId:   pulumi.String("alloydb-instance"),
    			InstanceType: pulumi.String("PRIMARY"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			vpcConnection,
    		}))
    		if err != nil {
    			return err
    		}
    		_, err = alloydb.NewBackup(ctx, "defaultBackup", &alloydb.BackupArgs{
    			Location:    pulumi.String("us-central1"),
    			BackupId:    pulumi.String("alloydb-backup"),
    			ClusterName: defaultCluster.Name,
    			Description: pulumi.String("example description"),
    			Labels: pulumi.StringMap{
    				"label": pulumi.String("key"),
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			defaultInstance,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
    import com.pulumi.gcp.alloydb.Cluster;
    import com.pulumi.gcp.alloydb.ClusterArgs;
    import com.pulumi.gcp.compute.GlobalAddress;
    import com.pulumi.gcp.compute.GlobalAddressArgs;
    import com.pulumi.gcp.servicenetworking.Connection;
    import com.pulumi.gcp.servicenetworking.ConnectionArgs;
    import com.pulumi.gcp.alloydb.Instance;
    import com.pulumi.gcp.alloydb.InstanceArgs;
    import com.pulumi.gcp.alloydb.Backup;
    import com.pulumi.gcp.alloydb.BackupArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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) {
            final var defaultNetwork = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
                .name("alloydb-network")
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()        
                .clusterId("alloydb-cluster")
                .location("us-central1")
                .network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
                .build());
    
            var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()        
                .addressType("INTERNAL")
                .purpose("VPC_PEERING")
                .prefixLength(16)
                .network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
                .build());
    
            var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()        
                .network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
                .service("servicenetworking.googleapis.com")
                .reservedPeeringRanges(privateIpAlloc.name())
                .build());
    
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
                .cluster(defaultCluster.name())
                .instanceId("alloydb-instance")
                .instanceType("PRIMARY")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(vpcConnection)
                    .build());
    
            var defaultBackup = new Backup("defaultBackup", BackupArgs.builder()        
                .location("us-central1")
                .backupId("alloydb-backup")
                .clusterName(defaultCluster.name())
                .description("example description")
                .labels(Map.of("label", "key"))
                .build(), CustomResourceOptions.builder()
                    .dependsOn(defaultInstance)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    default_network = gcp.compute.get_network(name="alloydb-network")
    default_cluster = gcp.alloydb.Cluster("defaultCluster",
        cluster_id="alloydb-cluster",
        location="us-central1",
        network=default_network.id)
    private_ip_alloc = gcp.compute.GlobalAddress("privateIpAlloc",
        address_type="INTERNAL",
        purpose="VPC_PEERING",
        prefix_length=16,
        network=default_network.id)
    vpc_connection = gcp.servicenetworking.Connection("vpcConnection",
        network=default_network.id,
        service="servicenetworking.googleapis.com",
        reserved_peering_ranges=[private_ip_alloc.name])
    default_instance = gcp.alloydb.Instance("defaultInstance",
        cluster=default_cluster.name,
        instance_id="alloydb-instance",
        instance_type="PRIMARY",
        opts=pulumi.ResourceOptions(depends_on=[vpc_connection]))
    default_backup = gcp.alloydb.Backup("defaultBackup",
        location="us-central1",
        backup_id="alloydb-backup",
        cluster_name=default_cluster.name,
        description="example description",
        labels={
            "label": "key",
        },
        opts=pulumi.ResourceOptions(depends_on=[default_instance]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const defaultNetwork = gcp.compute.getNetwork({
        name: "alloydb-network",
    });
    const defaultCluster = new gcp.alloydb.Cluster("defaultCluster", {
        clusterId: "alloydb-cluster",
        location: "us-central1",
        network: defaultNetwork.then(defaultNetwork => defaultNetwork.id),
    });
    const privateIpAlloc = new gcp.compute.GlobalAddress("privateIpAlloc", {
        addressType: "INTERNAL",
        purpose: "VPC_PEERING",
        prefixLength: 16,
        network: defaultNetwork.then(defaultNetwork => defaultNetwork.id),
    });
    const vpcConnection = new gcp.servicenetworking.Connection("vpcConnection", {
        network: defaultNetwork.then(defaultNetwork => defaultNetwork.id),
        service: "servicenetworking.googleapis.com",
        reservedPeeringRanges: [privateIpAlloc.name],
    });
    const defaultInstance = new gcp.alloydb.Instance("defaultInstance", {
        cluster: defaultCluster.name,
        instanceId: "alloydb-instance",
        instanceType: "PRIMARY",
    }, {
        dependsOn: [vpcConnection],
    });
    const defaultBackup = new gcp.alloydb.Backup("defaultBackup", {
        location: "us-central1",
        backupId: "alloydb-backup",
        clusterName: defaultCluster.name,
        description: "example description",
        labels: {
            label: "key",
        },
    }, {
        dependsOn: [defaultInstance],
    });
    
    resources:
      defaultBackup:
        type: gcp:alloydb:Backup
        properties:
          location: us-central1
          backupId: alloydb-backup
          clusterName: ${defaultCluster.name}
          description: example description
          labels:
            label: key
        options:
          dependson:
            - ${defaultInstance}
      defaultCluster:
        type: gcp:alloydb:Cluster
        properties:
          clusterId: alloydb-cluster
          location: us-central1
          network: ${defaultNetwork.id}
      defaultInstance:
        type: gcp:alloydb:Instance
        properties:
          cluster: ${defaultCluster.name}
          instanceId: alloydb-instance
          instanceType: PRIMARY
        options:
          dependson:
            - ${vpcConnection}
      privateIpAlloc:
        type: gcp:compute:GlobalAddress
        properties:
          addressType: INTERNAL
          purpose: VPC_PEERING
          prefixLength: 16
          network: ${defaultNetwork.id}
      vpcConnection:
        type: gcp:servicenetworking:Connection
        properties:
          network: ${defaultNetwork.id}
          service: servicenetworking.googleapis.com
          reservedPeeringRanges:
            - ${privateIpAlloc.name}
    variables:
      defaultNetwork:
        fn::invoke:
          Function: gcp:compute:getNetwork
          Arguments:
            name: alloydb-network
    

    Create Backup Resource

    new Backup(name: string, args: BackupArgs, opts?: CustomResourceOptions);
    @overload
    def Backup(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               backup_id: Optional[str] = None,
               cluster_name: Optional[str] = None,
               description: Optional[str] = None,
               encryption_config: Optional[BackupEncryptionConfigArgs] = None,
               labels: Optional[Mapping[str, str]] = None,
               location: Optional[str] = None,
               project: Optional[str] = None)
    @overload
    def Backup(resource_name: str,
               args: BackupArgs,
               opts: Optional[ResourceOptions] = 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:alloydb:Backup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args BackupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args BackupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BackupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BackupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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

    The Backup resource accepts the following input properties:

    BackupId string

    The ID of the alloydb backup.

    ClusterName string

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    Location string

    The location where the alloydb backup should reside.


    Description string

    User-provided description of the backup.

    EncryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    Labels Dictionary<string, string>

    User-defined labels for the alloydb backup.

    Project string

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    BackupId string

    The ID of the alloydb backup.

    ClusterName string

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    Location string

    The location where the alloydb backup should reside.


    Description string

    User-provided description of the backup.

    EncryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    Labels map[string]string

    User-defined labels for the alloydb backup.

    Project string

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    backupId String

    The ID of the alloydb backup.

    clusterName String

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    location String

    The location where the alloydb backup should reside.


    description String

    User-provided description of the backup.

    encryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    labels Map<String,String>

    User-defined labels for the alloydb backup.

    project String

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    backupId string

    The ID of the alloydb backup.

    clusterName string

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    location string

    The location where the alloydb backup should reside.


    description string

    User-provided description of the backup.

    encryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    labels {[key: string]: string}

    User-defined labels for the alloydb backup.

    project string

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    backup_id str

    The ID of the alloydb backup.

    cluster_name str

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    location str

    The location where the alloydb backup should reside.


    description str

    User-provided description of the backup.

    encryption_config BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    labels Mapping[str, str]

    User-defined labels for the alloydb backup.

    project str

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    backupId String

    The ID of the alloydb backup.

    clusterName String

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    location String

    The location where the alloydb backup should reside.


    description String

    User-provided description of the backup.

    encryptionConfig Property Map

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    labels Map<String>

    User-defined labels for the alloydb backup.

    project String

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

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

    CreateTime string

    Time the Backup was created in UTC.

    EncryptionInfos List<BackupEncryptionInfo>

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    Etag string

    A hash of the resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    Name string

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    Reconciling bool

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    State string

    The current state of the backup.

    Uid string

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    UpdateTime string

    Time the Backup was updated in UTC.

    CreateTime string

    Time the Backup was created in UTC.

    EncryptionInfos []BackupEncryptionInfo

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    Etag string

    A hash of the resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    Name string

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    Reconciling bool

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    State string

    The current state of the backup.

    Uid string

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    UpdateTime string

    Time the Backup was updated in UTC.

    createTime String

    Time the Backup was created in UTC.

    encryptionInfos List<BackupEncryptionInfo>

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag String

    A hash of the resource.

    id String

    The provider-assigned unique ID for this managed resource.

    name String

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    reconciling Boolean

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state String

    The current state of the backup.

    uid String

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    updateTime String

    Time the Backup was updated in UTC.

    createTime string

    Time the Backup was created in UTC.

    encryptionInfos BackupEncryptionInfo[]

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag string

    A hash of the resource.

    id string

    The provider-assigned unique ID for this managed resource.

    name string

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    reconciling boolean

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state string

    The current state of the backup.

    uid string

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    updateTime string

    Time the Backup was updated in UTC.

    create_time str

    Time the Backup was created in UTC.

    encryption_infos Sequence[BackupEncryptionInfo]

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag str

    A hash of the resource.

    id str

    The provider-assigned unique ID for this managed resource.

    name str

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    reconciling bool

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state str

    The current state of the backup.

    uid str

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    update_time str

    Time the Backup was updated in UTC.

    createTime String

    Time the Backup was created in UTC.

    encryptionInfos List<Property Map>

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag String

    A hash of the resource.

    id String

    The provider-assigned unique ID for this managed resource.

    name String

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    reconciling Boolean

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state String

    The current state of the backup.

    uid String

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    updateTime String

    Time the Backup was updated in UTC.

    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,
            backup_id: Optional[str] = None,
            cluster_name: Optional[str] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            encryption_config: Optional[BackupEncryptionConfigArgs] = None,
            encryption_infos: Optional[Sequence[BackupEncryptionInfoArgs]] = None,
            etag: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            reconciling: Optional[bool] = None,
            state: Optional[str] = None,
            uid: Optional[str] = None,
            update_time: Optional[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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    BackupId string

    The ID of the alloydb backup.

    ClusterName string

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    CreateTime string

    Time the Backup was created in UTC.

    Description string

    User-provided description of the backup.

    EncryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    EncryptionInfos List<BackupEncryptionInfoArgs>

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    Etag string

    A hash of the resource.

    Labels Dictionary<string, string>

    User-defined labels for the alloydb backup.

    Location string

    The location where the alloydb backup should reside.


    Name string

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    Project string

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Reconciling bool

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    State string

    The current state of the backup.

    Uid string

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    UpdateTime string

    Time the Backup was updated in UTC.

    BackupId string

    The ID of the alloydb backup.

    ClusterName string

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    CreateTime string

    Time the Backup was created in UTC.

    Description string

    User-provided description of the backup.

    EncryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    EncryptionInfos []BackupEncryptionInfoArgs

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    Etag string

    A hash of the resource.

    Labels map[string]string

    User-defined labels for the alloydb backup.

    Location string

    The location where the alloydb backup should reside.


    Name string

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    Project string

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Reconciling bool

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    State string

    The current state of the backup.

    Uid string

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    UpdateTime string

    Time the Backup was updated in UTC.

    backupId String

    The ID of the alloydb backup.

    clusterName String

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    createTime String

    Time the Backup was created in UTC.

    description String

    User-provided description of the backup.

    encryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    encryptionInfos List<BackupEncryptionInfoArgs>

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag String

    A hash of the resource.

    labels Map<String,String>

    User-defined labels for the alloydb backup.

    location String

    The location where the alloydb backup should reside.


    name String

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    project String

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    reconciling Boolean

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state String

    The current state of the backup.

    uid String

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    updateTime String

    Time the Backup was updated in UTC.

    backupId string

    The ID of the alloydb backup.

    clusterName string

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    createTime string

    Time the Backup was created in UTC.

    description string

    User-provided description of the backup.

    encryptionConfig BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    encryptionInfos BackupEncryptionInfoArgs[]

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag string

    A hash of the resource.

    labels {[key: string]: string}

    User-defined labels for the alloydb backup.

    location string

    The location where the alloydb backup should reside.


    name string

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    project string

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    reconciling boolean

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state string

    The current state of the backup.

    uid string

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    updateTime string

    Time the Backup was updated in UTC.

    backup_id str

    The ID of the alloydb backup.

    cluster_name str

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    create_time str

    Time the Backup was created in UTC.

    description str

    User-provided description of the backup.

    encryption_config BackupEncryptionConfigArgs

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    encryption_infos Sequence[BackupEncryptionInfoArgs]

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag str

    A hash of the resource.

    labels Mapping[str, str]

    User-defined labels for the alloydb backup.

    location str

    The location where the alloydb backup should reside.


    name str

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    project str

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    reconciling bool

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state str

    The current state of the backup.

    uid str

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    update_time str

    Time the Backup was updated in UTC.

    backupId String

    The ID of the alloydb backup.

    clusterName String

    The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

    createTime String

    Time the Backup was created in UTC.

    description String

    User-provided description of the backup.

    encryptionConfig Property Map

    EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

    encryptionInfos List<Property Map>

    EncryptionInfo describes the encryption information of a cluster or a backup. Structure is documented below.

    etag String

    A hash of the resource.

    labels Map<String>

    User-defined labels for the alloydb backup.

    location String

    The location where the alloydb backup should reside.


    name String

    Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

    project String

    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    reconciling Boolean

    If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

    state String

    The current state of the backup.

    uid String

    Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

    updateTime String

    Time the Backup was updated in UTC.

    Supporting Types

    BackupEncryptionConfig

    KmsKeyName string

    The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].

    KmsKeyName string

    The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].

    kmsKeyName String

    The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].

    kmsKeyName string

    The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].

    kms_key_name str

    The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].

    kmsKeyName String

    The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].

    BackupEncryptionInfo

    EncryptionType string

    (Output) Output only. Type of encryption.

    KmsKeyVersions List<string>

    (Output) Output only. Cloud KMS key versions that are being used to protect the database or the backup.

    EncryptionType string

    (Output) Output only. Type of encryption.

    KmsKeyVersions []string

    (Output) Output only. Cloud KMS key versions that are being used to protect the database or the backup.

    encryptionType String

    (Output) Output only. Type of encryption.

    kmsKeyVersions List<String>

    (Output) Output only. Cloud KMS key versions that are being used to protect the database or the backup.

    encryptionType string

    (Output) Output only. Type of encryption.

    kmsKeyVersions string[]

    (Output) Output only. Cloud KMS key versions that are being used to protect the database or the backup.

    encryption_type str

    (Output) Output only. Type of encryption.

    kms_key_versions Sequence[str]

    (Output) Output only. Cloud KMS key versions that are being used to protect the database or the backup.

    encryptionType String

    (Output) Output only. Type of encryption.

    kmsKeyVersions List<String>

    (Output) Output only. Cloud KMS key versions that are being used to protect the database or the backup.

    Import

    Backup can be imported using any of these accepted formats

     $ pulumi import gcp:alloydb/backup:Backup default projects/{{project}}/locations/{{location}}/backups/{{backup_id}}
    
     $ pulumi import gcp:alloydb/backup:Backup default {{project}}/{{location}}/{{backup_id}}
    
     $ pulumi import gcp:alloydb/backup:Backup default {{location}}/{{backup_id}}
    

    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.

    gcp logo
    Google Cloud Classic v6.58.0 published on Tuesday, Jun 6, 2023 by Pulumi