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

com.pulumi.gcp.bigtable.kotlin.GCPolicyArgs.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.bigtable.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.bigtable.GCPolicyArgs.builder
import com.pulumi.gcp.bigtable.kotlin.inputs.GCPolicyMaxAgeArgs
import com.pulumi.gcp.bigtable.kotlin.inputs.GCPolicyMaxAgeArgsBuilder
import com.pulumi.gcp.bigtable.kotlin.inputs.GCPolicyMaxVersionArgs
import com.pulumi.gcp.bigtable.kotlin.inputs.GCPolicyMaxVersionArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Creates a Google Cloud Bigtable GC Policy inside a family. For more information see
 * [the official documentation](https://cloud.google.com/bigtable/) and
 * [API](https://cloud.google.com/bigtable/docs/go/reference).
 * > **Warning**: We don't recommend having multiple GC policies for the same column
 * family as it may result in unexpected behavior.
 * > **Note**: GC policies associated with a replicated table cannot be destroyed directly.
 * Destroying a GC policy is translated into never perform garbage collection, this is
 * considered relaxing from pure age-based or version-based GC policy, hence not allowed.
 * The workaround is unreplicating the instance first by updating the instance to have one
 * cluster.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const instance = new gcp.bigtable.Instance("instance", {
 *     name: "tf-instance",
 *     clusters: [{
 *         clusterId: "tf-instance-cluster",
 *         numNodes: 3,
 *         storageType: "HDD",
 *     }],
 * });
 * const table = new gcp.bigtable.Table("table", {
 *     name: "tf-table",
 *     instanceName: instance.name,
 *     columnFamilies: [{
 *         family: "name",
 *     }],
 * });
 * const policy = new gcp.bigtable.GCPolicy("policy", {
 *     instanceName: instance.name,
 *     table: table.name,
 *     columnFamily: "name",
 *     deletionPolicy: "ABANDON",
 *     gcRules: `  {
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       }
 *     ]
 *   }
 * `,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * instance = gcp.bigtable.Instance("instance",
 *     name="tf-instance",
 *     clusters=[gcp.bigtable.InstanceClusterArgs(
 *         cluster_id="tf-instance-cluster",
 *         num_nodes=3,
 *         storage_type="HDD",
 *     )])
 * table = gcp.bigtable.Table("table",
 *     name="tf-table",
 *     instance_name=instance.name,
 *     column_families=[gcp.bigtable.TableColumnFamilyArgs(
 *         family="name",
 *     )])
 * policy = gcp.bigtable.GCPolicy("policy",
 *     instance_name=instance.name,
 *     table=table.name,
 *     column_family="name",
 *     deletion_policy="ABANDON",
 *     gc_rules="""  {
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       }
 *     ]
 *   }
 * """)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.BigTable.Instance("instance", new()
 *     {
 *         Name = "tf-instance",
 *         Clusters = new[]
 *         {
 *             new Gcp.BigTable.Inputs.InstanceClusterArgs
 *             {
 *                 ClusterId = "tf-instance-cluster",
 *                 NumNodes = 3,
 *                 StorageType = "HDD",
 *             },
 *         },
 *     });
 *     var table = new Gcp.BigTable.Table("table", new()
 *     {
 *         Name = "tf-table",
 *         InstanceName = instance.Name,
 *         ColumnFamilies = new[]
 *         {
 *             new Gcp.BigTable.Inputs.TableColumnFamilyArgs
 *             {
 *                 Family = "name",
 *             },
 *         },
 *     });
 *     var policy = new Gcp.BigTable.GCPolicy("policy", new()
 *     {
 *         InstanceName = instance.Name,
 *         Table = table.Name,
 *         ColumnFamily = "name",
 *         DeletionPolicy = "ABANDON",
 *         GcRules = @"  {
 *     ""rules"": [
 *       {
 *         ""max_age"": ""168h""
 *       }
 *     ]
 *   }
 * ",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigtable"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		instance, err := bigtable.NewInstance(ctx, "instance", &bigtable.InstanceArgs{
 * 			Name: pulumi.String("tf-instance"),
 * 			Clusters: bigtable.InstanceClusterArray{
 * 				&bigtable.InstanceClusterArgs{
 * 					ClusterId:   pulumi.String("tf-instance-cluster"),
 * 					NumNodes:    pulumi.Int(3),
 * 					StorageType: pulumi.String("HDD"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		table, err := bigtable.NewTable(ctx, "table", &bigtable.TableArgs{
 * 			Name:         pulumi.String("tf-table"),
 * 			InstanceName: instance.Name,
 * 			ColumnFamilies: bigtable.TableColumnFamilyArray{
 * 				&bigtable.TableColumnFamilyArgs{
 * 					Family: pulumi.String("name"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = bigtable.NewGCPolicy(ctx, "policy", &bigtable.GCPolicyArgs{
 * 			InstanceName:   instance.Name,
 * 			Table:          table.Name,
 * 			ColumnFamily:   pulumi.String("name"),
 * 			DeletionPolicy: pulumi.String("ABANDON"),
 * 			GcRules: pulumi.String(`  {
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       }
 *     ]
 *   }
 * `),
 * 		})
 * 		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.bigtable.Instance;
 * import com.pulumi.gcp.bigtable.InstanceArgs;
 * import com.pulumi.gcp.bigtable.inputs.InstanceClusterArgs;
 * import com.pulumi.gcp.bigtable.Table;
 * import com.pulumi.gcp.bigtable.TableArgs;
 * import com.pulumi.gcp.bigtable.inputs.TableColumnFamilyArgs;
 * import com.pulumi.gcp.bigtable.GCPolicy;
 * import com.pulumi.gcp.bigtable.GCPolicyArgs;
 * 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("tf-instance")
 *             .clusters(InstanceClusterArgs.builder()
 *                 .clusterId("tf-instance-cluster")
 *                 .numNodes(3)
 *                 .storageType("HDD")
 *                 .build())
 *             .build());
 *         var table = new Table("table", TableArgs.builder()
 *             .name("tf-table")
 *             .instanceName(instance.name())
 *             .columnFamilies(TableColumnFamilyArgs.builder()
 *                 .family("name")
 *                 .build())
 *             .build());
 *         var policy = new GCPolicy("policy", GCPolicyArgs.builder()
 *             .instanceName(instance.name())
 *             .table(table.name())
 *             .columnFamily("name")
 *             .deletionPolicy("ABANDON")
 *             .gcRules("""
 *   {
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       }
 *     ]
 *   }
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:bigtable:Instance
 *     properties:
 *       name: tf-instance
 *       clusters:
 *         - clusterId: tf-instance-cluster
 *           numNodes: 3
 *           storageType: HDD
 *   table:
 *     type: gcp:bigtable:Table
 *     properties:
 *       name: tf-table
 *       instanceName: ${instance.name}
 *       columnFamilies:
 *         - family: name
 *   policy:
 *     type: gcp:bigtable:GCPolicy
 *     properties:
 *       instanceName: ${instance.name}
 *       table: ${table.name}
 *       columnFamily: name
 *       deletionPolicy: ABANDON
 *       gcRules: |2
 *           {
 *             "rules": [
 *               {
 *                 "max_age": "168h"
 *               }
 *             ]
 *           }
 * ```
 * 
 * Multiple conditions is also supported. `UNION` when any of its sub-policies apply (OR). `INTERSECTION` when all its sub-policies apply (AND)
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const policy = new gcp.bigtable.GCPolicy("policy", {
 *     instanceName: instance.name,
 *     table: table.name,
 *     columnFamily: "name",
 *     deletionPolicy: "ABANDON",
 *     gcRules: `  {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       },
 *       {
 *         "max_version": 10
 *       }
 *     ]
 *   }
 * `,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * policy = gcp.bigtable.GCPolicy("policy",
 *     instance_name=instance["name"],
 *     table=table["name"],
 *     column_family="name",
 *     deletion_policy="ABANDON",
 *     gc_rules="""  {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       },
 *       {
 *         "max_version": 10
 *       }
 *     ]
 *   }
 * """)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var policy = new Gcp.BigTable.GCPolicy("policy", new()
 *     {
 *         InstanceName = instance.Name,
 *         Table = table.Name,
 *         ColumnFamily = "name",
 *         DeletionPolicy = "ABANDON",
 *         GcRules = @"  {
 *     ""mode"": ""union"",
 *     ""rules"": [
 *       {
 *         ""max_age"": ""168h""
 *       },
 *       {
 *         ""max_version"": 10
 *       }
 *     ]
 *   }
 * ",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigtable"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := bigtable.NewGCPolicy(ctx, "policy", &bigtable.GCPolicyArgs{
 * 			InstanceName:   pulumi.Any(instance.Name),
 * 			Table:          pulumi.Any(table.Name),
 * 			ColumnFamily:   pulumi.String("name"),
 * 			DeletionPolicy: pulumi.String("ABANDON"),
 * 			GcRules: pulumi.String(`  {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       },
 *       {
 *         "max_version": 10
 *       }
 *     ]
 *   }
 * `),
 * 		})
 * 		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.bigtable.GCPolicy;
 * import com.pulumi.gcp.bigtable.GCPolicyArgs;
 * 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 policy = new GCPolicy("policy", GCPolicyArgs.builder()
 *             .instanceName(instance.name())
 *             .table(table.name())
 *             .columnFamily("name")
 *             .deletionPolicy("ABANDON")
 *             .gcRules("""
 *   {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "168h"
 *       },
 *       {
 *         "max_version": 10
 *       }
 *     ]
 *   }
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   policy:
 *     type: gcp:bigtable:GCPolicy
 *     properties:
 *       instanceName: ${instance.name}
 *       table: ${table.name}
 *       columnFamily: name
 *       deletionPolicy: ABANDON
 *       gcRules: |2
 *           {
 *             "mode": "union",
 *             "rules": [
 *               {
 *                 "max_age": "168h"
 *               },
 *               {
 *                 "max_version": 10
 *               }
 *             ]
 *           }
 * ```
 * 
 * An example of more complex GC policy:
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const instance = new gcp.bigtable.Instance("instance", {
 *     name: "instance_name",
 *     clusters: [{
 *         clusterId: "cid",
 *         zone: "us-central1-b",
 *     }],
 *     instanceType: "DEVELOPMENT",
 *     deletionProtection: false,
 * });
 * const table = new gcp.bigtable.Table("table", {
 *     name: "your-table",
 *     instanceName: instance.id,
 *     columnFamilies: [{
 *         family: "cf1",
 *     }],
 * });
 * const policy = new gcp.bigtable.GCPolicy("policy", {
 *     instanceName: instance.id,
 *     table: table.name,
 *     columnFamily: "cf1",
 *     deletionPolicy: "ABANDON",
 *     gcRules: `  {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "10h"
 *       },
 *       {
 *         "mode": "intersection",
 *         "rules": [
 *           {
 *             "max_age": "2h"
 *           },
 *           {
 *             "max_version": 2
 *           }
 *         ]
 *       }
 *     ]
 *   }
 * `,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * instance = gcp.bigtable.Instance("instance",
 *     name="instance_name",
 *     clusters=[gcp.bigtable.InstanceClusterArgs(
 *         cluster_id="cid",
 *         zone="us-central1-b",
 *     )],
 *     instance_type="DEVELOPMENT",
 *     deletion_protection=False)
 * table = gcp.bigtable.Table("table",
 *     name="your-table",
 *     instance_name=instance.id,
 *     column_families=[gcp.bigtable.TableColumnFamilyArgs(
 *         family="cf1",
 *     )])
 * policy = gcp.bigtable.GCPolicy("policy",
 *     instance_name=instance.id,
 *     table=table.name,
 *     column_family="cf1",
 *     deletion_policy="ABANDON",
 *     gc_rules="""  {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "10h"
 *       },
 *       {
 *         "mode": "intersection",
 *         "rules": [
 *           {
 *             "max_age": "2h"
 *           },
 *           {
 *             "max_version": 2
 *           }
 *         ]
 *       }
 *     ]
 *   }
 * """)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.BigTable.Instance("instance", new()
 *     {
 *         Name = "instance_name",
 *         Clusters = new[]
 *         {
 *             new Gcp.BigTable.Inputs.InstanceClusterArgs
 *             {
 *                 ClusterId = "cid",
 *                 Zone = "us-central1-b",
 *             },
 *         },
 *         InstanceType = "DEVELOPMENT",
 *         DeletionProtection = false,
 *     });
 *     var table = new Gcp.BigTable.Table("table", new()
 *     {
 *         Name = "your-table",
 *         InstanceName = instance.Id,
 *         ColumnFamilies = new[]
 *         {
 *             new Gcp.BigTable.Inputs.TableColumnFamilyArgs
 *             {
 *                 Family = "cf1",
 *             },
 *         },
 *     });
 *     var policy = new Gcp.BigTable.GCPolicy("policy", new()
 *     {
 *         InstanceName = instance.Id,
 *         Table = table.Name,
 *         ColumnFamily = "cf1",
 *         DeletionPolicy = "ABANDON",
 *         GcRules = @"  {
 *     ""mode"": ""union"",
 *     ""rules"": [
 *       {
 *         ""max_age"": ""10h""
 *       },
 *       {
 *         ""mode"": ""intersection"",
 *         ""rules"": [
 *           {
 *             ""max_age"": ""2h""
 *           },
 *           {
 *             ""max_version"": 2
 *           }
 *         ]
 *       }
 *     ]
 *   }
 * ",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigtable"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		instance, err := bigtable.NewInstance(ctx, "instance", &bigtable.InstanceArgs{
 * 			Name: pulumi.String("instance_name"),
 * 			Clusters: bigtable.InstanceClusterArray{
 * 				&bigtable.InstanceClusterArgs{
 * 					ClusterId: pulumi.String("cid"),
 * 					Zone:      pulumi.String("us-central1-b"),
 * 				},
 * 			},
 * 			InstanceType:       pulumi.String("DEVELOPMENT"),
 * 			DeletionProtection: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		table, err := bigtable.NewTable(ctx, "table", &bigtable.TableArgs{
 * 			Name:         pulumi.String("your-table"),
 * 			InstanceName: instance.ID(),
 * 			ColumnFamilies: bigtable.TableColumnFamilyArray{
 * 				&bigtable.TableColumnFamilyArgs{
 * 					Family: pulumi.String("cf1"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = bigtable.NewGCPolicy(ctx, "policy", &bigtable.GCPolicyArgs{
 * 			InstanceName:   instance.ID(),
 * 			Table:          table.Name,
 * 			ColumnFamily:   pulumi.String("cf1"),
 * 			DeletionPolicy: pulumi.String("ABANDON"),
 * 			GcRules: pulumi.String(`  {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "10h"
 *       },
 *       {
 *         "mode": "intersection",
 *         "rules": [
 *           {
 *             "max_age": "2h"
 *           },
 *           {
 *             "max_version": 2
 *           }
 *         ]
 *       }
 *     ]
 *   }
 * `),
 * 		})
 * 		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.bigtable.Instance;
 * import com.pulumi.gcp.bigtable.InstanceArgs;
 * import com.pulumi.gcp.bigtable.inputs.InstanceClusterArgs;
 * import com.pulumi.gcp.bigtable.Table;
 * import com.pulumi.gcp.bigtable.TableArgs;
 * import com.pulumi.gcp.bigtable.inputs.TableColumnFamilyArgs;
 * import com.pulumi.gcp.bigtable.GCPolicy;
 * import com.pulumi.gcp.bigtable.GCPolicyArgs;
 * 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("instance_name")
 *             .clusters(InstanceClusterArgs.builder()
 *                 .clusterId("cid")
 *                 .zone("us-central1-b")
 *                 .build())
 *             .instanceType("DEVELOPMENT")
 *             .deletionProtection(false)
 *             .build());
 *         var table = new Table("table", TableArgs.builder()
 *             .name("your-table")
 *             .instanceName(instance.id())
 *             .columnFamilies(TableColumnFamilyArgs.builder()
 *                 .family("cf1")
 *                 .build())
 *             .build());
 *         var policy = new GCPolicy("policy", GCPolicyArgs.builder()
 *             .instanceName(instance.id())
 *             .table(table.name())
 *             .columnFamily("cf1")
 *             .deletionPolicy("ABANDON")
 *             .gcRules("""
 *   {
 *     "mode": "union",
 *     "rules": [
 *       {
 *         "max_age": "10h"
 *       },
 *       {
 *         "mode": "intersection",
 *         "rules": [
 *           {
 *             "max_age": "2h"
 *           },
 *           {
 *             "max_version": 2
 *           }
 *         ]
 *       }
 *     ]
 *   }
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:bigtable:Instance
 *     properties:
 *       name: instance_name
 *       clusters:
 *         - clusterId: cid
 *           zone: us-central1-b
 *       instanceType: DEVELOPMENT
 *       deletionProtection: false
 *   table:
 *     type: gcp:bigtable:Table
 *     properties:
 *       name: your-table
 *       instanceName: ${instance.id}
 *       columnFamilies:
 *         - family: cf1
 *   policy:
 *     type: gcp:bigtable:GCPolicy
 *     properties:
 *       instanceName: ${instance.id}
 *       table: ${table.name}
 *       columnFamily: cf1
 *       deletionPolicy: ABANDON
 *       gcRules: |2
 *           {
 *             "mode": "union",
 *             "rules": [
 *               {
 *                 "max_age": "10h"
 *               },
 *               {
 *                 "mode": "intersection",
 *                 "rules": [
 *                   {
 *                     "max_age": "2h"
 *                   },
 *                   {
 *                     "max_version": 2
 *                   }
 *                 ]
 *               }
 *             ]
 *           }
 * ```
 * 
 * This is equivalent to running the following `cbt` command:
 * ```
 * cbt setgcpolicy your-table cf1 "(maxage=2d and maxversions=2) or maxage=10h"
 * ```
 * ## Import
 * This resource does not support import.
 * @property columnFamily The name of the column family.
 * @property deletionPolicy The deletion policy for the GC policy.
 * Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for GC policy as it cannot be deleted in a replicated instance.
 * Possible values are: `ABANDON`.
 * -----
 * @property gcRules Serialized JSON object to represent a more complex GC policy. Conflicts with `mode`, `max_age` and `max_version`. Conflicts with `mode`, `max_age` and `max_version`.
 * @property instanceName The name of the Bigtable instance.
 * @property maxAge GC policy that applies to all cells older than the given age.
 * @property maxVersions GC policy that applies to all versions of a cell except for the most recent.
 * @property mode If multiple policies are set, you should choose between `UNION` OR `INTERSECTION`.
 * @property project The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 * @property table The name of the table.
 */
public data class GCPolicyArgs(
    public val columnFamily: Output? = null,
    public val deletionPolicy: Output? = null,
    public val gcRules: Output? = null,
    public val instanceName: Output? = null,
    public val maxAge: Output? = null,
    public val maxVersions: Output>? = null,
    public val mode: Output? = null,
    public val project: Output? = null,
    public val table: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.bigtable.GCPolicyArgs =
        com.pulumi.gcp.bigtable.GCPolicyArgs.builder()
            .columnFamily(columnFamily?.applyValue({ args0 -> args0 }))
            .deletionPolicy(deletionPolicy?.applyValue({ args0 -> args0 }))
            .gcRules(gcRules?.applyValue({ args0 -> args0 }))
            .instanceName(instanceName?.applyValue({ args0 -> args0 }))
            .maxAge(maxAge?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .maxVersions(
                maxVersions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .mode(mode?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .table(table?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [GCPolicyArgs].
 */
@PulumiTagMarker
public class GCPolicyArgsBuilder internal constructor() {
    private var columnFamily: Output? = null

    private var deletionPolicy: Output? = null

    private var gcRules: Output? = null

    private var instanceName: Output? = null

    private var maxAge: Output? = null

    private var maxVersions: Output>? = null

    private var mode: Output? = null

    private var project: Output? = null

    private var table: Output? = null

    /**
     * @param value The name of the column family.
     */
    @JvmName("mpchfdxakoatgskq")
    public suspend fun columnFamily(`value`: Output) {
        this.columnFamily = value
    }

    /**
     * @param value The deletion policy for the GC policy.
     * Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for GC policy as it cannot be deleted in a replicated instance.
     * Possible values are: `ABANDON`.
     * -----
     */
    @JvmName("alnqiiqxtkbmysts")
    public suspend fun deletionPolicy(`value`: Output) {
        this.deletionPolicy = value
    }

    /**
     * @param value Serialized JSON object to represent a more complex GC policy. Conflicts with `mode`, `max_age` and `max_version`. Conflicts with `mode`, `max_age` and `max_version`.
     */
    @JvmName("asuixingmnapigna")
    public suspend fun gcRules(`value`: Output) {
        this.gcRules = value
    }

    /**
     * @param value The name of the Bigtable instance.
     */
    @JvmName("vvkntjvnqsmjpryw")
    public suspend fun instanceName(`value`: Output) {
        this.instanceName = value
    }

    /**
     * @param value GC policy that applies to all cells older than the given age.
     */
    @JvmName("qdhpnrnqrkjqatdw")
    public suspend fun maxAge(`value`: Output) {
        this.maxAge = value
    }

    /**
     * @param value GC policy that applies to all versions of a cell except for the most recent.
     */
    @JvmName("ilhfjirafqrhcvou")
    public suspend fun maxVersions(`value`: Output>) {
        this.maxVersions = value
    }

    @JvmName("lxfcrasaptehliao")
    public suspend fun maxVersions(vararg values: Output) {
        this.maxVersions = Output.all(values.asList())
    }

    /**
     * @param values GC policy that applies to all versions of a cell except for the most recent.
     */
    @JvmName("mbgdandggvvwkbwo")
    public suspend fun maxVersions(values: List>) {
        this.maxVersions = Output.all(values)
    }

    /**
     * @param value If multiple policies are set, you should choose between `UNION` OR `INTERSECTION`.
     */
    @JvmName("rsatpoanshmbkebb")
    public suspend fun mode(`value`: Output) {
        this.mode = value
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
     */
    @JvmName("gavpbyylmtmuswxd")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The name of the table.
     */
    @JvmName("cygsqqcsxnepumgj")
    public suspend fun table(`value`: Output) {
        this.table = value
    }

    /**
     * @param value The name of the column family.
     */
    @JvmName("tjvvbxehdtlnsaha")
    public suspend fun columnFamily(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.columnFamily = mapped
    }

    /**
     * @param value The deletion policy for the GC policy.
     * Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for GC policy as it cannot be deleted in a replicated instance.
     * Possible values are: `ABANDON`.
     * -----
     */
    @JvmName("itkerqpsnfadprys")
    public suspend fun deletionPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deletionPolicy = mapped
    }

    /**
     * @param value Serialized JSON object to represent a more complex GC policy. Conflicts with `mode`, `max_age` and `max_version`. Conflicts with `mode`, `max_age` and `max_version`.
     */
    @JvmName("kigydowwbdjxnunv")
    public suspend fun gcRules(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gcRules = mapped
    }

    /**
     * @param value The name of the Bigtable instance.
     */
    @JvmName("codmnraickvmsvqq")
    public suspend fun instanceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceName = mapped
    }

    /**
     * @param value GC policy that applies to all cells older than the given age.
     */
    @JvmName("dfjlakdhvcwfswia")
    public suspend fun maxAge(`value`: GCPolicyMaxAgeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxAge = mapped
    }

    /**
     * @param argument GC policy that applies to all cells older than the given age.
     */
    @JvmName("usofdpahgehnbpvg")
    public suspend fun maxAge(argument: suspend GCPolicyMaxAgeArgsBuilder.() -> Unit) {
        val toBeMapped = GCPolicyMaxAgeArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.maxAge = mapped
    }

    /**
     * @param value GC policy that applies to all versions of a cell except for the most recent.
     */
    @JvmName("alpjpjgcauldybdq")
    public suspend fun maxVersions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxVersions = mapped
    }

    /**
     * @param argument GC policy that applies to all versions of a cell except for the most recent.
     */
    @JvmName("cyjaerkqmdqighxy")
    public suspend fun maxVersions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            GCPolicyMaxVersionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.maxVersions = mapped
    }

    /**
     * @param argument GC policy that applies to all versions of a cell except for the most recent.
     */
    @JvmName("wcuuokdrtfastbkq")
    public suspend fun maxVersions(vararg argument: suspend GCPolicyMaxVersionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            GCPolicyMaxVersionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.maxVersions = mapped
    }

    /**
     * @param argument GC policy that applies to all versions of a cell except for the most recent.
     */
    @JvmName("cwaeggblivstveyw")
    public suspend fun maxVersions(argument: suspend GCPolicyMaxVersionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(GCPolicyMaxVersionArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.maxVersions = mapped
    }

    /**
     * @param values GC policy that applies to all versions of a cell except for the most recent.
     */
    @JvmName("tflsgiwukdvjwkjy")
    public suspend fun maxVersions(vararg values: GCPolicyMaxVersionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxVersions = mapped
    }

    /**
     * @param value If multiple policies are set, you should choose between `UNION` OR `INTERSECTION`.
     */
    @JvmName("jgjoaspwupywmekv")
    public suspend fun mode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.mode = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
     */
    @JvmName("lpxmeelcphlauipc")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The name of the table.
     */
    @JvmName("nmyooerwlmjbfkmj")
    public suspend fun table(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.table = mapped
    }

    internal fun build(): GCPolicyArgs = GCPolicyArgs(
        columnFamily = columnFamily,
        deletionPolicy = deletionPolicy,
        gcRules = gcRules,
        instanceName = instanceName,
        maxAge = maxAge,
        maxVersions = maxVersions,
        mode = mode,
        project = project,
        table = table,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy