All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.alloydb.kotlin.Backup.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.alloydb.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.alloydb.kotlin.outputs.BackupEncryptionConfig
import com.pulumi.gcp.alloydb.kotlin.outputs.BackupEncryptionInfo
import com.pulumi.gcp.alloydb.kotlin.outputs.BackupExpiryQuantity
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.alloydb.kotlin.outputs.BackupEncryptionConfig.Companion.toKotlin as backupEncryptionConfigToKotlin
import com.pulumi.gcp.alloydb.kotlin.outputs.BackupEncryptionInfo.Companion.toKotlin as backupEncryptionInfoToKotlin
import com.pulumi.gcp.alloydb.kotlin.outputs.BackupExpiryQuantity.Companion.toKotlin as backupExpiryQuantityToKotlin

/**
 * Builder for [Backup].
 */
@PulumiTagMarker
public class BackupResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: BackupArgs = BackupArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend BackupArgsBuilder.() -> Unit) {
        val builder = BackupArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Backup {
        val builtJavaResource = com.pulumi.gcp.alloydb.Backup(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Backup(builtJavaResource)
    }
}

/**
 * An AlloyDB Backup.
 * To get more information about Backup, see:
 * * [API documentation](https://cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.backups/create)
 * * How-to Guides
 *     * [AlloyDB](https://cloud.google.com/alloydb/docs/)
 * ## Example Usage
 * ### Alloydb Backup Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultNetwork = new gcp.compute.Network("default", {name: "alloydb-network"});
 * const defaultCluster = new gcp.alloydb.Cluster("default", {
 *     clusterId: "alloydb-cluster",
 *     location: "us-central1",
 *     network: defaultNetwork.id,
 * });
 * const _default = new gcp.alloydb.Backup("default", {
 *     location: "us-central1",
 *     backupId: "alloydb-backup",
 *     clusterName: defaultCluster.name,
 * });
 * const defaultInstance = new gcp.alloydb.Instance("default", {
 *     cluster: defaultCluster.name,
 *     instanceId: "alloydb-instance",
 *     instanceType: "PRIMARY",
 * });
 * const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", {
 *     name: "alloydb-cluster",
 *     addressType: "INTERNAL",
 *     purpose: "VPC_PEERING",
 *     prefixLength: 16,
 *     network: defaultNetwork.id,
 * });
 * const vpcConnection = new gcp.servicenetworking.Connection("vpc_connection", {
 *     network: defaultNetwork.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [privateIpAlloc.name],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_network = gcp.compute.Network("default", name="alloydb-network")
 * default_cluster = gcp.alloydb.Cluster("default",
 *     cluster_id="alloydb-cluster",
 *     location="us-central1",
 *     network=default_network.id)
 * default = gcp.alloydb.Backup("default",
 *     location="us-central1",
 *     backup_id="alloydb-backup",
 *     cluster_name=default_cluster.name)
 * default_instance = gcp.alloydb.Instance("default",
 *     cluster=default_cluster.name,
 *     instance_id="alloydb-instance",
 *     instance_type="PRIMARY")
 * private_ip_alloc = gcp.compute.GlobalAddress("private_ip_alloc",
 *     name="alloydb-cluster",
 *     address_type="INTERNAL",
 *     purpose="VPC_PEERING",
 *     prefix_length=16,
 *     network=default_network.id)
 * vpc_connection = gcp.servicenetworking.Connection("vpc_connection",
 *     network=default_network.id,
 *     service="servicenetworking.googleapis.com",
 *     reserved_peering_ranges=[private_ip_alloc.name])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultNetwork = new Gcp.Compute.Network("default", new()
 *     {
 *         Name = "alloydb-network",
 *     });
 *     var defaultCluster = new Gcp.Alloydb.Cluster("default", new()
 *     {
 *         ClusterId = "alloydb-cluster",
 *         Location = "us-central1",
 *         Network = defaultNetwork.Id,
 *     });
 *     var @default = new Gcp.Alloydb.Backup("default", new()
 *     {
 *         Location = "us-central1",
 *         BackupId = "alloydb-backup",
 *         ClusterName = defaultCluster.Name,
 *     });
 *     var defaultInstance = new Gcp.Alloydb.Instance("default", new()
 *     {
 *         Cluster = defaultCluster.Name,
 *         InstanceId = "alloydb-instance",
 *         InstanceType = "PRIMARY",
 *     });
 *     var privateIpAlloc = new Gcp.Compute.GlobalAddress("private_ip_alloc", new()
 *     {
 *         Name = "alloydb-cluster",
 *         AddressType = "INTERNAL",
 *         Purpose = "VPC_PEERING",
 *         PrefixLength = 16,
 *         Network = defaultNetwork.Id,
 *     });
 *     var vpcConnection = new Gcp.ServiceNetworking.Connection("vpc_connection", new()
 *     {
 *         Network = defaultNetwork.Id,
 *         Service = "servicenetworking.googleapis.com",
 *         ReservedPeeringRanges = new[]
 *         {
 *             privateIpAlloc.Name,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/alloydb"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
 * 			Name: pulumi.String("alloydb-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultCluster, err := alloydb.NewCluster(ctx, "default", &alloydb.ClusterArgs{
 * 			ClusterId: pulumi.String("alloydb-cluster"),
 * 			Location:  pulumi.String("us-central1"),
 * 			Network:   defaultNetwork.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = alloydb.NewBackup(ctx, "default", &alloydb.BackupArgs{
 * 			Location:    pulumi.String("us-central1"),
 * 			BackupId:    pulumi.String("alloydb-backup"),
 * 			ClusterName: defaultCluster.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = alloydb.NewInstance(ctx, "default", &alloydb.InstanceArgs{
 * 			Cluster:      defaultCluster.Name,
 * 			InstanceId:   pulumi.String("alloydb-instance"),
 * 			InstanceType: pulumi.String("PRIMARY"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		privateIpAlloc, err := compute.NewGlobalAddress(ctx, "private_ip_alloc", &compute.GlobalAddressArgs{
 * 			Name:         pulumi.String("alloydb-cluster"),
 * 			AddressType:  pulumi.String("INTERNAL"),
 * 			Purpose:      pulumi.String("VPC_PEERING"),
 * 			PrefixLength: pulumi.Int(16),
 * 			Network:      defaultNetwork.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = servicenetworking.NewConnection(ctx, "vpc_connection", &servicenetworking.ConnectionArgs{
 * 			Network: defaultNetwork.ID(),
 * 			Service: pulumi.String("servicenetworking.googleapis.com"),
 * 			ReservedPeeringRanges: pulumi.StringArray{
 * 				privateIpAlloc.Name,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.alloydb.Cluster;
 * import com.pulumi.gcp.alloydb.ClusterArgs;
 * import com.pulumi.gcp.alloydb.Backup;
 * import com.pulumi.gcp.alloydb.BackupArgs;
 * import com.pulumi.gcp.alloydb.Instance;
 * import com.pulumi.gcp.alloydb.InstanceArgs;
 * 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 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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
 *             .name("alloydb-network")
 *             .build());
 *         var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
 *             .clusterId("alloydb-cluster")
 *             .location("us-central1")
 *             .network(defaultNetwork.id())
 *             .build());
 *         var default_ = new Backup("default", BackupArgs.builder()
 *             .location("us-central1")
 *             .backupId("alloydb-backup")
 *             .clusterName(defaultCluster.name())
 *             .build());
 *         var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
 *             .cluster(defaultCluster.name())
 *             .instanceId("alloydb-instance")
 *             .instanceType("PRIMARY")
 *             .build());
 *         var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
 *             .name("alloydb-cluster")
 *             .addressType("INTERNAL")
 *             .purpose("VPC_PEERING")
 *             .prefixLength(16)
 *             .network(defaultNetwork.id())
 *             .build());
 *         var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()
 *             .network(defaultNetwork.id())
 *             .service("servicenetworking.googleapis.com")
 *             .reservedPeeringRanges(privateIpAlloc.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:alloydb:Backup
 *     properties:
 *       location: us-central1
 *       backupId: alloydb-backup
 *       clusterName: ${defaultCluster.name}
 *   defaultCluster:
 *     type: gcp:alloydb:Cluster
 *     name: default
 *     properties:
 *       clusterId: alloydb-cluster
 *       location: us-central1
 *       network: ${defaultNetwork.id}
 *   defaultInstance:
 *     type: gcp:alloydb:Instance
 *     name: default
 *     properties:
 *       cluster: ${defaultCluster.name}
 *       instanceId: alloydb-instance
 *       instanceType: PRIMARY
 *   privateIpAlloc:
 *     type: gcp:compute:GlobalAddress
 *     name: private_ip_alloc
 *     properties:
 *       name: alloydb-cluster
 *       addressType: INTERNAL
 *       purpose: VPC_PEERING
 *       prefixLength: 16
 *       network: ${defaultNetwork.id}
 *   vpcConnection:
 *     type: gcp:servicenetworking:Connection
 *     name: vpc_connection
 *     properties:
 *       network: ${defaultNetwork.id}
 *       service: servicenetworking.googleapis.com
 *       reservedPeeringRanges:
 *         - ${privateIpAlloc.name}
 *   defaultNetwork:
 *     type: gcp:compute:Network
 *     name: default
 *     properties:
 *       name: alloydb-network
 * ```
 * 
 * ### Alloydb Backup Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultNetwork = new gcp.compute.Network("default", {name: "alloydb-network"});
 * const defaultCluster = new gcp.alloydb.Cluster("default", {
 *     clusterId: "alloydb-cluster",
 *     location: "us-central1",
 *     network: defaultNetwork.id,
 * });
 * const _default = new gcp.alloydb.Backup("default", {
 *     location: "us-central1",
 *     backupId: "alloydb-backup",
 *     clusterName: defaultCluster.name,
 *     description: "example description",
 *     type: "ON_DEMAND",
 *     labels: {
 *         label: "key",
 *     },
 * });
 * const defaultInstance = new gcp.alloydb.Instance("default", {
 *     cluster: defaultCluster.name,
 *     instanceId: "alloydb-instance",
 *     instanceType: "PRIMARY",
 * });
 * const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", {
 *     name: "alloydb-cluster",
 *     addressType: "INTERNAL",
 *     purpose: "VPC_PEERING",
 *     prefixLength: 16,
 *     network: defaultNetwork.id,
 * });
 * const vpcConnection = new gcp.servicenetworking.Connection("vpc_connection", {
 *     network: defaultNetwork.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [privateIpAlloc.name],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_network = gcp.compute.Network("default", name="alloydb-network")
 * default_cluster = gcp.alloydb.Cluster("default",
 *     cluster_id="alloydb-cluster",
 *     location="us-central1",
 *     network=default_network.id)
 * default = gcp.alloydb.Backup("default",
 *     location="us-central1",
 *     backup_id="alloydb-backup",
 *     cluster_name=default_cluster.name,
 *     description="example description",
 *     type="ON_DEMAND",
 *     labels={
 *         "label": "key",
 *     })
 * default_instance = gcp.alloydb.Instance("default",
 *     cluster=default_cluster.name,
 *     instance_id="alloydb-instance",
 *     instance_type="PRIMARY")
 * private_ip_alloc = gcp.compute.GlobalAddress("private_ip_alloc",
 *     name="alloydb-cluster",
 *     address_type="INTERNAL",
 *     purpose="VPC_PEERING",
 *     prefix_length=16,
 *     network=default_network.id)
 * vpc_connection = gcp.servicenetworking.Connection("vpc_connection",
 *     network=default_network.id,
 *     service="servicenetworking.googleapis.com",
 *     reserved_peering_ranges=[private_ip_alloc.name])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultNetwork = new Gcp.Compute.Network("default", new()
 *     {
 *         Name = "alloydb-network",
 *     });
 *     var defaultCluster = new Gcp.Alloydb.Cluster("default", new()
 *     {
 *         ClusterId = "alloydb-cluster",
 *         Location = "us-central1",
 *         Network = defaultNetwork.Id,
 *     });
 *     var @default = new Gcp.Alloydb.Backup("default", new()
 *     {
 *         Location = "us-central1",
 *         BackupId = "alloydb-backup",
 *         ClusterName = defaultCluster.Name,
 *         Description = "example description",
 *         Type = "ON_DEMAND",
 *         Labels =
 *         {
 *             { "label", "key" },
 *         },
 *     });
 *     var defaultInstance = new Gcp.Alloydb.Instance("default", new()
 *     {
 *         Cluster = defaultCluster.Name,
 *         InstanceId = "alloydb-instance",
 *         InstanceType = "PRIMARY",
 *     });
 *     var privateIpAlloc = new Gcp.Compute.GlobalAddress("private_ip_alloc", new()
 *     {
 *         Name = "alloydb-cluster",
 *         AddressType = "INTERNAL",
 *         Purpose = "VPC_PEERING",
 *         PrefixLength = 16,
 *         Network = defaultNetwork.Id,
 *     });
 *     var vpcConnection = new Gcp.ServiceNetworking.Connection("vpc_connection", new()
 *     {
 *         Network = defaultNetwork.Id,
 *         Service = "servicenetworking.googleapis.com",
 *         ReservedPeeringRanges = new[]
 *         {
 *             privateIpAlloc.Name,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/alloydb"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
 * 			Name: pulumi.String("alloydb-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultCluster, err := alloydb.NewCluster(ctx, "default", &alloydb.ClusterArgs{
 * 			ClusterId: pulumi.String("alloydb-cluster"),
 * 			Location:  pulumi.String("us-central1"),
 * 			Network:   defaultNetwork.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = alloydb.NewBackup(ctx, "default", &alloydb.BackupArgs{
 * 			Location:    pulumi.String("us-central1"),
 * 			BackupId:    pulumi.String("alloydb-backup"),
 * 			ClusterName: defaultCluster.Name,
 * 			Description: pulumi.String("example description"),
 * 			Type:        pulumi.String("ON_DEMAND"),
 * 			Labels: pulumi.StringMap{
 * 				"label": pulumi.String("key"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = alloydb.NewInstance(ctx, "default", &alloydb.InstanceArgs{
 * 			Cluster:      defaultCluster.Name,
 * 			InstanceId:   pulumi.String("alloydb-instance"),
 * 			InstanceType: pulumi.String("PRIMARY"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		privateIpAlloc, err := compute.NewGlobalAddress(ctx, "private_ip_alloc", &compute.GlobalAddressArgs{
 * 			Name:         pulumi.String("alloydb-cluster"),
 * 			AddressType:  pulumi.String("INTERNAL"),
 * 			Purpose:      pulumi.String("VPC_PEERING"),
 * 			PrefixLength: pulumi.Int(16),
 * 			Network:      defaultNetwork.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = servicenetworking.NewConnection(ctx, "vpc_connection", &servicenetworking.ConnectionArgs{
 * 			Network: defaultNetwork.ID(),
 * 			Service: pulumi.String("servicenetworking.googleapis.com"),
 * 			ReservedPeeringRanges: pulumi.StringArray{
 * 				privateIpAlloc.Name,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.alloydb.Cluster;
 * import com.pulumi.gcp.alloydb.ClusterArgs;
 * import com.pulumi.gcp.alloydb.Backup;
 * import com.pulumi.gcp.alloydb.BackupArgs;
 * import com.pulumi.gcp.alloydb.Instance;
 * import com.pulumi.gcp.alloydb.InstanceArgs;
 * 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 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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
 *             .name("alloydb-network")
 *             .build());
 *         var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
 *             .clusterId("alloydb-cluster")
 *             .location("us-central1")
 *             .network(defaultNetwork.id())
 *             .build());
 *         var default_ = new Backup("default", BackupArgs.builder()
 *             .location("us-central1")
 *             .backupId("alloydb-backup")
 *             .clusterName(defaultCluster.name())
 *             .description("example description")
 *             .type("ON_DEMAND")
 *             .labels(Map.of("label", "key"))
 *             .build());
 *         var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
 *             .cluster(defaultCluster.name())
 *             .instanceId("alloydb-instance")
 *             .instanceType("PRIMARY")
 *             .build());
 *         var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
 *             .name("alloydb-cluster")
 *             .addressType("INTERNAL")
 *             .purpose("VPC_PEERING")
 *             .prefixLength(16)
 *             .network(defaultNetwork.id())
 *             .build());
 *         var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()
 *             .network(defaultNetwork.id())
 *             .service("servicenetworking.googleapis.com")
 *             .reservedPeeringRanges(privateIpAlloc.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:alloydb:Backup
 *     properties:
 *       location: us-central1
 *       backupId: alloydb-backup
 *       clusterName: ${defaultCluster.name}
 *       description: example description
 *       type: ON_DEMAND
 *       labels:
 *         label: key
 *   defaultCluster:
 *     type: gcp:alloydb:Cluster
 *     name: default
 *     properties:
 *       clusterId: alloydb-cluster
 *       location: us-central1
 *       network: ${defaultNetwork.id}
 *   defaultInstance:
 *     type: gcp:alloydb:Instance
 *     name: default
 *     properties:
 *       cluster: ${defaultCluster.name}
 *       instanceId: alloydb-instance
 *       instanceType: PRIMARY
 *   privateIpAlloc:
 *     type: gcp:compute:GlobalAddress
 *     name: private_ip_alloc
 *     properties:
 *       name: alloydb-cluster
 *       addressType: INTERNAL
 *       purpose: VPC_PEERING
 *       prefixLength: 16
 *       network: ${defaultNetwork.id}
 *   vpcConnection:
 *     type: gcp:servicenetworking:Connection
 *     name: vpc_connection
 *     properties:
 *       network: ${defaultNetwork.id}
 *       service: servicenetworking.googleapis.com
 *       reservedPeeringRanges:
 *         - ${privateIpAlloc.name}
 *   defaultNetwork:
 *     type: gcp:compute:Network
 *     name: default
 *     properties:
 *       name: alloydb-network
 * ```
 * 
 * ## Import
 * Backup can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/backups/{{backup_id}}`
 * * `{{project}}/{{location}}/{{backup_id}}`
 * * `{{location}}/{{backup_id}}`
 * When using the `pulumi import` command, Backup can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:alloydb/backup:Backup default projects/{{project}}/locations/{{location}}/backups/{{backup_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:alloydb/backup:Backup default {{project}}/{{location}}/{{backup_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:alloydb/backup:Backup default {{location}}/{{backup_id}}
 * ```
 */
public class Backup internal constructor(
    override val javaResource: com.pulumi.gcp.alloydb.Backup,
) : KotlinCustomResource(javaResource, BackupMapper) {
    /**
     * Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128
     * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
     * Please refer to the field `effective_annotations` for all of the annotations present on the resource.
     */
    public val annotations: Output>?
        get() = javaResource.annotations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The ID of the alloydb backup.
     */
    public val backupId: Output
        get() = javaResource.backupId().applyValue({ args0 -> args0 })

    /**
     * The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).
     */
    public val clusterName: Output
        get() = javaResource.clusterName().applyValue({ args0 -> args0 })

    /**
     * Output only. The system-generated UID of the cluster which was used to create this resource.
     */
    public val clusterUid: Output
        get() = javaResource.clusterUid().applyValue({ args0 -> args0 })

    /**
     * Output only. Create time stamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
     * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Output only. Delete time stamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
     * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val deleteTime: Output
        get() = javaResource.deleteTime().applyValue({ args0 -> args0 })

    /**
     * User-provided description of the backup.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * User-settable and human-readable display name for the Backup.
     */
    public val displayName: Output?
        get() = javaResource.displayName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val effectiveAnnotations: Output>
        get() = javaResource.effectiveAnnotations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * 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.
     */
    public val encryptionConfig: Output?
        get() = javaResource.encryptionConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> backupEncryptionConfigToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * EncryptionInfo describes the encryption information of a cluster or a backup.
     * Structure is documented below.
     */
    public val encryptionInfos: Output>
        get() = javaResource.encryptionInfos().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> backupEncryptionInfoToKotlin(args0) })
            })
        })

    /**
     * For Resource freshness validation (https://google.aip.dev/154)
     */
    public val etag: Output
        get() = javaResource.etag().applyValue({ args0 -> args0 })

    /**
     * Output only. The QuantityBasedExpiry of the backup, specified by the backup's retention policy.
     * Once the expiry quantity is over retention, the backup is eligible to be garbage collected.
     * Structure is documented below.
     */
    public val expiryQuantities: Output>
        get() = javaResource.expiryQuantities().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> backupExpiryQuantityToKotlin(args0) })
            })
        })

    /**
     * Output only. The time at which after the backup is eligible to be garbage collected.
     * It is the duration specified by the backup's retention policy, added to the backup's createTime.
     */
    public val expiryTime: Output
        get() = javaResource.expiryTime().applyValue({ args0 -> args0 })

    /**
     * User-defined labels for the alloydb backup. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **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.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The location where the alloydb backup should reside.
     * - - -
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), 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.
     */
    public val reconciling: Output
        get() = javaResource.reconciling().applyValue({ args0 -> args0 })

    /**
     * Output only. The size of the backup in bytes.
     */
    public val sizeBytes: Output
        get() = javaResource.sizeBytes().applyValue({ args0 -> args0 })

    /**
     * Output only. The current state of the backup.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * The backup type, which suggests the trigger for the backup.
     * Possible values are: `TYPE_UNSPECIFIED`, `ON_DEMAND`, `AUTOMATED`, `CONTINUOUS`.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })

    /**
     * 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.
     */
    public val uid: Output
        get() = javaResource.uid().applyValue({ args0 -> args0 })

    /**
     * Output only. Update time stamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
     * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object BackupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.alloydb.Backup::class == javaResource::class

    override fun map(javaResource: Resource): Backup = Backup(
        javaResource as
            com.pulumi.gcp.alloydb.Backup,
    )
}

/**
 * @see [Backup].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Backup].
 */
public suspend fun backup(name: String, block: suspend BackupResourceBuilder.() -> Unit): Backup {
    val builder = BackupResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Backup].
 * @param name The _unique_ name of the resulting resource.
 */
public fun backup(name: String): Backup {
    val builder = BackupResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy