gcp.bigtable.GCPolicy
Explore with Pulumi AI
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
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"
}
]
}
`,
});
import pulumi
import pulumi_gcp as gcp
instance = gcp.bigtable.Instance("instance",
name="tf-instance",
clusters=[{
"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=[{
"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"
}
]
}
""")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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""
}
]
}
",
});
});
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());
}
}
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)
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
}
]
}
`,
});
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
}
]
}
""")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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
}
]
}
",
});
});
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());
}
}
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:
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
}
]
}
]
}
`,
});
import pulumi
import pulumi_gcp as gcp
instance = gcp.bigtable.Instance("instance",
name="instance_name",
clusters=[{
"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=[{
"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
}
]
}
]
}
""")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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
}
]
}
]
}
",
});
});
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());
}
}
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"
Create GCPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GCPolicy(name: string, args: GCPolicyArgs, opts?: CustomResourceOptions);
@overload
def GCPolicy(resource_name: str,
args: GCPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GCPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
column_family: Optional[str] = None,
instance_name: Optional[str] = None,
table: Optional[str] = None,
deletion_policy: Optional[str] = None,
gc_rules: Optional[str] = None,
ignore_warnings: Optional[bool] = None,
max_age: Optional[GCPolicyMaxAgeArgs] = None,
max_versions: Optional[Sequence[GCPolicyMaxVersionArgs]] = None,
mode: Optional[str] = None,
project: Optional[str] = None)
func NewGCPolicy(ctx *Context, name string, args GCPolicyArgs, opts ...ResourceOption) (*GCPolicy, error)
public GCPolicy(string name, GCPolicyArgs args, CustomResourceOptions? opts = null)
public GCPolicy(String name, GCPolicyArgs args)
public GCPolicy(String name, GCPolicyArgs args, CustomResourceOptions options)
type: gcp:bigtable:GCPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args GCPolicyArgs
- 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 GCPolicyArgs
- 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 GCPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GCPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GCPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var gcpolicyResource = new Gcp.BigTable.GCPolicy("gcpolicyResource", new()
{
ColumnFamily = "string",
InstanceName = "string",
Table = "string",
DeletionPolicy = "string",
GcRules = "string",
IgnoreWarnings = false,
MaxAge = new Gcp.BigTable.Inputs.GCPolicyMaxAgeArgs
{
Duration = "string",
},
MaxVersions = new[]
{
new Gcp.BigTable.Inputs.GCPolicyMaxVersionArgs
{
Number = 0,
},
},
Mode = "string",
Project = "string",
});
example, err := bigtable.NewGCPolicy(ctx, "gcpolicyResource", &bigtable.GCPolicyArgs{
ColumnFamily: pulumi.String("string"),
InstanceName: pulumi.String("string"),
Table: pulumi.String("string"),
DeletionPolicy: pulumi.String("string"),
GcRules: pulumi.String("string"),
IgnoreWarnings: pulumi.Bool(false),
MaxAge: &bigtable.GCPolicyMaxAgeArgs{
Duration: pulumi.String("string"),
},
MaxVersions: bigtable.GCPolicyMaxVersionArray{
&bigtable.GCPolicyMaxVersionArgs{
Number: pulumi.Int(0),
},
},
Mode: pulumi.String("string"),
Project: pulumi.String("string"),
})
var gcpolicyResource = new GCPolicy("gcpolicyResource", GCPolicyArgs.builder()
.columnFamily("string")
.instanceName("string")
.table("string")
.deletionPolicy("string")
.gcRules("string")
.ignoreWarnings(false)
.maxAge(GCPolicyMaxAgeArgs.builder()
.duration("string")
.build())
.maxVersions(GCPolicyMaxVersionArgs.builder()
.number(0)
.build())
.mode("string")
.project("string")
.build());
gcpolicy_resource = gcp.bigtable.GCPolicy("gcpolicyResource",
column_family="string",
instance_name="string",
table="string",
deletion_policy="string",
gc_rules="string",
ignore_warnings=False,
max_age={
"duration": "string",
},
max_versions=[{
"number": 0,
}],
mode="string",
project="string")
const gcpolicyResource = new gcp.bigtable.GCPolicy("gcpolicyResource", {
columnFamily: "string",
instanceName: "string",
table: "string",
deletionPolicy: "string",
gcRules: "string",
ignoreWarnings: false,
maxAge: {
duration: "string",
},
maxVersions: [{
number: 0,
}],
mode: "string",
project: "string",
});
type: gcp:bigtable:GCPolicy
properties:
columnFamily: string
deletionPolicy: string
gcRules: string
ignoreWarnings: false
instanceName: string
maxAge:
duration: string
maxVersions:
- number: 0
mode: string
project: string
table: string
GCPolicy 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 GCPolicy resource accepts the following input properties:
- Column
Family string - The name of the column family.
- Instance
Name string - The name of the Bigtable instance.
- Table string
- The name of the table.
- Deletion
Policy 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.
Possible values are:
ABANDON
.- Gc
Rules string - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - Ignore
Warnings bool Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- Max
Age GCPolicyMax Age - GC policy that applies to all cells older than the given age.
- Max
Versions List<GCPolicyMax Version> - GC policy that applies to all versions of a cell except for the most recent.
- Mode string
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Column
Family string - The name of the column family.
- Instance
Name string - The name of the Bigtable instance.
- Table string
- The name of the table.
- Deletion
Policy 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.
Possible values are:
ABANDON
.- Gc
Rules string - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - Ignore
Warnings bool Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- Max
Age GCPolicyMax Age Args - GC policy that applies to all cells older than the given age.
- Max
Versions []GCPolicyMax Version Args - GC policy that applies to all versions of a cell except for the most recent.
- Mode string
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- column
Family String - The name of the column family.
- instance
Name String - The name of the Bigtable instance.
- table String
- The name of the table.
- deletion
Policy 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.
Possible values are:
ABANDON
.- gc
Rules String - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore
Warnings Boolean Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- max
Age GCPolicyMax Age - GC policy that applies to all cells older than the given age.
- max
Versions List<GCPolicyMax Version> - GC policy that applies to all versions of a cell except for the most recent.
- mode String
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- column
Family string - The name of the column family.
- instance
Name string - The name of the Bigtable instance.
- table string
- The name of the table.
- deletion
Policy 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.
Possible values are:
ABANDON
.- gc
Rules string - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore
Warnings boolean Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- max
Age GCPolicyMax Age - GC policy that applies to all cells older than the given age.
- max
Versions GCPolicyMax Version[] - GC policy that applies to all versions of a cell except for the most recent.
- mode string
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- column_
family str - The name of the column family.
- instance_
name str - The name of the Bigtable instance.
- table str
- The name of the table.
- deletion_
policy str 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
.- gc_
rules str - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore_
warnings bool Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- max_
age GCPolicyMax Age Args - GC policy that applies to all cells older than the given age.
- max_
versions Sequence[GCPolicyMax Version Args] - GC policy that applies to all versions of a cell except for the most recent.
- mode str
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- column
Family String - The name of the column family.
- instance
Name String - The name of the Bigtable instance.
- table String
- The name of the table.
- deletion
Policy 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.
Possible values are:
ABANDON
.- gc
Rules String - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore
Warnings Boolean Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- max
Age Property Map - GC policy that applies to all cells older than the given age.
- max
Versions List<Property Map> - GC policy that applies to all versions of a cell except for the most recent.
- mode String
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - 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 GCPolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing GCPolicy Resource
Get an existing GCPolicy 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?: GCPolicyState, opts?: CustomResourceOptions): GCPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
column_family: Optional[str] = None,
deletion_policy: Optional[str] = None,
gc_rules: Optional[str] = None,
ignore_warnings: Optional[bool] = None,
instance_name: Optional[str] = None,
max_age: Optional[GCPolicyMaxAgeArgs] = None,
max_versions: Optional[Sequence[GCPolicyMaxVersionArgs]] = None,
mode: Optional[str] = None,
project: Optional[str] = None,
table: Optional[str] = None) -> GCPolicy
func GetGCPolicy(ctx *Context, name string, id IDInput, state *GCPolicyState, opts ...ResourceOption) (*GCPolicy, error)
public static GCPolicy Get(string name, Input<string> id, GCPolicyState? state, CustomResourceOptions? opts = null)
public static GCPolicy get(String name, Output<String> id, GCPolicyState 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.
- Column
Family string - The name of the column family.
- Deletion
Policy 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.
Possible values are:
ABANDON
.- Gc
Rules string - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - Ignore
Warnings bool Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- Instance
Name string - The name of the Bigtable instance.
- Max
Age GCPolicyMax Age - GC policy that applies to all cells older than the given age.
- Max
Versions List<GCPolicyMax Version> - GC policy that applies to all versions of a cell except for the most recent.
- Mode string
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Table string
- The name of the table.
- Column
Family string - The name of the column family.
- Deletion
Policy 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.
Possible values are:
ABANDON
.- Gc
Rules string - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - Ignore
Warnings bool Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- Instance
Name string - The name of the Bigtable instance.
- Max
Age GCPolicyMax Age Args - GC policy that applies to all cells older than the given age.
- Max
Versions []GCPolicyMax Version Args - GC policy that applies to all versions of a cell except for the most recent.
- Mode string
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Table string
- The name of the table.
- column
Family String - The name of the column family.
- deletion
Policy 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.
Possible values are:
ABANDON
.- gc
Rules String - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore
Warnings Boolean Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- instance
Name String - The name of the Bigtable instance.
- max
Age GCPolicyMax Age - GC policy that applies to all cells older than the given age.
- max
Versions List<GCPolicyMax Version> - GC policy that applies to all versions of a cell except for the most recent.
- mode String
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- table String
- The name of the table.
- column
Family string - The name of the column family.
- deletion
Policy 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.
Possible values are:
ABANDON
.- gc
Rules string - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore
Warnings boolean Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- instance
Name string - The name of the Bigtable instance.
- max
Age GCPolicyMax Age - GC policy that applies to all cells older than the given age.
- max
Versions GCPolicyMax Version[] - GC policy that applies to all versions of a cell except for the most recent.
- mode string
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- table string
- The name of the table.
- column_
family str - The name of the column family.
- deletion_
policy str 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
.- gc_
rules str - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore_
warnings bool Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- instance_
name str - The name of the Bigtable instance.
- max_
age GCPolicyMax Age Args - GC policy that applies to all cells older than the given age.
- max_
versions Sequence[GCPolicyMax Version Args] - GC policy that applies to all versions of a cell except for the most recent.
- mode str
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- table str
- The name of the table.
- column
Family String - The name of the column family.
- deletion
Policy 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.
Possible values are:
ABANDON
.- gc
Rules String - Serialized JSON object to represent a more complex GC policy. Conflicts with
mode
,max_age
andmax_version
. Conflicts withmode
,max_age
andmax_version
. - ignore
Warnings Boolean Boolean for whether to allow ignoring warnings when updating the gc policy. Setting this to
true
allows relaxing the gc policy for replicated clusters by up to 90 days, but keep in mind this may increase how long clusters are inconsistent. Make sure you understand the risks listed at https://cloud.google.com/bigtable/docs/garbage-collection#increasing before setting this option.- instance
Name String - The name of the Bigtable instance.
- max
Age Property Map - GC policy that applies to all cells older than the given age.
- max
Versions List<Property Map> - GC policy that applies to all versions of a cell except for the most recent.
- mode String
- If multiple policies are set, you should choose between
UNION
ORINTERSECTION
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- table String
- The name of the table.
Supporting Types
GCPolicyMaxAge, GCPolicyMaxAgeArgs
GCPolicyMaxVersion, GCPolicyMaxVersionArgs
- Number int
Number of version before applying the GC policy.
gc_rules
include 2 fields:
- Number int
Number of version before applying the GC policy.
gc_rules
include 2 fields:
- number Integer
Number of version before applying the GC policy.
gc_rules
include 2 fields:
- number number
Number of version before applying the GC policy.
gc_rules
include 2 fields:
- number int
Number of version before applying the GC policy.
gc_rules
include 2 fields:
- number Number
Number of version before applying the GC policy.
gc_rules
include 2 fields:
Import
This resource does not support import.
To learn more about importing existing cloud resources, see Importing resources.
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.