Google Cloud (GCP) Classic
GCPolicy
Creates a Google Cloud Bigtable GC Policy inside a family. For more information see the official documentation and API.
Example Usage
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var instance = new Gcp.BigTable.Instance("instance", new Gcp.BigTable.InstanceArgs
{
Clusters =
{
new Gcp.BigTable.Inputs.InstanceClusterArgs
{
ClusterId = "tf-instance-cluster",
NumNodes = 3,
StorageType = "HDD",
},
},
});
var table = new Gcp.BigTable.Table("table", new Gcp.BigTable.TableArgs
{
InstanceName = instance.Name,
ColumnFamilies =
{
new Gcp.BigTable.Inputs.TableColumnFamilyArgs
{
Family = "name",
},
},
});
var policy = new Gcp.BigTable.GCPolicy("policy", new Gcp.BigTable.GCPolicyArgs
{
InstanceName = instance.Name,
Table = table.Name,
ColumnFamily = "name",
MaxAge = new Gcp.BigTable.Inputs.GCPolicyMaxAgeArgs
{
Duration = "168h",
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/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{
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{
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"),
MaxAge: &bigtable.GCPolicyMaxAgeArgs{
Duration: pulumi.String("168h"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
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(InstanceCluster.builder()
.clusterId("tf-instance-cluster")
.numNodes(3)
.storageType("HDD")
.build())
.build());
var table = new Table("table", TableArgs.builder()
.instanceName(instance.getName())
.columnFamilies(TableColumnFamily.builder()
.family("name")
.build())
.build());
var policy = new GCPolicy("policy", GCPolicyArgs.builder()
.instanceName(instance.getName())
.table(table.getName())
.columnFamily("name")
.maxAge(GCPolicyMaxAge.builder()
.duration("168h")
.build())
.build());
}
}
import pulumi
import pulumi_gcp as gcp
instance = gcp.bigtable.Instance("instance", clusters=[gcp.bigtable.InstanceClusterArgs(
cluster_id="tf-instance-cluster",
num_nodes=3,
storage_type="HDD",
)])
table = gcp.bigtable.Table("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",
max_age=gcp.bigtable.GCPolicyMaxAgeArgs(
duration="168h",
))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const instance = new gcp.bigtable.Instance("instance", {clusters: [{
clusterId: "tf-instance-cluster",
numNodes: 3,
storageType: "HDD",
}]});
const table = new gcp.bigtable.Table("table", {
instanceName: instance.name,
columnFamilies: [{
family: "name",
}],
});
const policy = new gcp.bigtable.GCPolicy("policy", {
instanceName: instance.name,
table: table.name,
columnFamily: "name",
maxAge: {
duration: "168h",
},
});
resources:
instance:
type: gcp:bigtable:Instance
properties:
clusters:
- clusterId: tf-instance-cluster
numNodes: 3
storageType: HDD
table:
type: gcp:bigtable:Table
properties:
instanceName: ${instance.name}
columnFamilies:
- family: name
policy:
type: gcp:bigtable:GCPolicy
properties:
instanceName: ${instance.name}
table: ${table.name}
columnFamily: name
maxAge:
duration: 168h
Create a GCPolicy Resource
new GCPolicy(name: string, args: GCPolicyArgs, opts?: CustomResourceOptions);
@overload
def GCPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
column_family: Optional[str] = None,
gc_rules: Optional[str] = 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)
@overload
def GCPolicy(resource_name: str,
args: GCPolicyArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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.
- 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
.- Max
Age GCPolicyMax Age Args GC policy that applies to all cells older than the given age.
- Max
Versions List<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.
- 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
.- 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.
- 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
.- max
Age GCPolicyMax Age Args GC policy that applies to all cells older than the given age.
- max
Versions ListMax 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.
- 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
.- 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 str The name of the column family.
- instance_
name str The name of the Bigtable instance.
- table str
The name of the table.
- 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
.- 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.
- 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
.- max
Age Property Map GC policy that applies to all cells older than the given age.
- max
Versions List 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 an 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,
gc_rules: Optional[str] = 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.
- 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
.- 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 List<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.
- 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
.- 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.
- 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
.- 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 ListMax 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.
- 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
.- 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 str The name of the column family.
- 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
.- 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.
- 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
.- 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 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
GCPolicyMaxVersion
- Number int
Number of version before applying the GC policy.
- Number int
Number of version before applying the GC policy.
- number Integer
Number of version before applying the GC policy.
- number number
Number of version before applying the GC policy.
- number int
Number of version before applying the GC policy.
- number Number
Number of version before applying the GC policy.
Import
This resource does not support import.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.