GCPolicy

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.

Properties

Link copied to clipboard
val columnFamily: Output<String>

The name of the column family.

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

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.

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

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 id: Output<String>
Link copied to clipboard
val instanceName: Output<String>

The name of the Bigtable instance.

Link copied to clipboard
val maxAge: Output<GCPolicyMaxAge>?

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>?

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

Link copied to clipboard
val project: Output<String>

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val table: Output<String>

The name of the table.

Link copied to clipboard
val urn: Output<String>