GCPolicyArgs

data class GCPolicyArgs(val columnFamily: Output<String>? = null, val deletionPolicy: Output<String>? = null, val gcRules: Output<String>? = null, val instanceName: Output<String>? = null, val maxAge: Output<GCPolicyMaxAgeArgs>? = null, val maxVersions: Output<List<GCPolicyMaxVersionArgs>>? = null, val mode: Output<String>? = null, val project: Output<String>? = null, val table: Output<String>? = null) : ConvertibleToJava<GCPolicyArgs>

Creates a Google Cloud Bigtable GC Policy inside a family. For more information see the official documentation and API.

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

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()
.clusters(InstanceClusterArgs.builder()
.clusterId("tf-instance-cluster")
.numNodes(3)
.storageType("HDD")
.build())
.build());
var table = new Table("table", TableArgs.builder()
.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());
}
}

Import

This resource does not support import.

Constructors

Link copied to clipboard
constructor(columnFamily: Output<String>? = null, deletionPolicy: Output<String>? = null, gcRules: Output<String>? = null, instanceName: Output<String>? = null, maxAge: Output<GCPolicyMaxAgeArgs>? = null, maxVersions: Output<List<GCPolicyMaxVersionArgs>>? = null, mode: Output<String>? = null, project: Output<String>? = null, table: Output<String>? = null)

Properties

Link copied to clipboard
val columnFamily: Output<String>? = null

The name of the column family.

Link copied to clipboard
val deletionPolicy: Output<String>? = null

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.

Link copied to clipboard
val gcRules: Output<String>? = null

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.

Link copied to clipboard
val instanceName: Output<String>? = null

The name of the Bigtable instance.

Link copied to clipboard
val maxAge: Output<GCPolicyMaxAgeArgs>? = null

GC policy that applies to all cells older than the given age.

Link copied to clipboard

GC policy that applies to all versions of a cell except for the most recent.

Link copied to clipboard
val mode: Output<String>? = null

If multiple policies are set, you should choose between UNION OR INTERSECTION.

Link copied to clipboard
val project: Output<String>? = null

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

Link copied to clipboard
val table: Output<String>? = null

The name of the table.

Functions

Link copied to clipboard
open override fun toJava(): GCPolicyArgs