gcp.bigquerydatapolicy.DataPolicy
Explore with Pulumi AI
A BigQuery Data Policy
To get more information about DataPolicy, see:
- API documentation
- How-to Guides
Example Usage
Bigquery Datapolicy Data Policy Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var taxonomy = new Gcp.DataCatalog.Taxonomy("taxonomy", new()
{
Region = "us-central1",
DisplayName = "taxonomy",
Description = "A collection of policy tags",
ActivatedPolicyTypes = new[]
{
"FINE_GRAINED_ACCESS_CONTROL",
},
});
var policyTag = new Gcp.DataCatalog.PolicyTag("policyTag", new()
{
Taxonomy = taxonomy.Id,
DisplayName = "Low security",
Description = "A policy tag normally associated with low security items",
});
var dataPolicy = new Gcp.BigQueryDataPolicy.DataPolicy("dataPolicy", new()
{
Location = "us-central1",
DataPolicyId = "data_policy",
PolicyTag = policyTag.Name,
DataPolicyType = "COLUMN_LEVEL_SECURITY_POLICY",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigquerydatapolicy"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datacatalog"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
taxonomy, err := datacatalog.NewTaxonomy(ctx, "taxonomy", &datacatalog.TaxonomyArgs{
Region: pulumi.String("us-central1"),
DisplayName: pulumi.String("taxonomy"),
Description: pulumi.String("A collection of policy tags"),
ActivatedPolicyTypes: pulumi.StringArray{
pulumi.String("FINE_GRAINED_ACCESS_CONTROL"),
},
})
if err != nil {
return err
}
policyTag, err := datacatalog.NewPolicyTag(ctx, "policyTag", &datacatalog.PolicyTagArgs{
Taxonomy: taxonomy.ID(),
DisplayName: pulumi.String("Low security"),
Description: pulumi.String("A policy tag normally associated with low security items"),
})
if err != nil {
return err
}
_, err = bigquerydatapolicy.NewDataPolicy(ctx, "dataPolicy", &bigquerydatapolicy.DataPolicyArgs{
Location: pulumi.String("us-central1"),
DataPolicyId: pulumi.String("data_policy"),
PolicyTag: policyTag.Name,
DataPolicyType: pulumi.String("COLUMN_LEVEL_SECURITY_POLICY"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.datacatalog.Taxonomy;
import com.pulumi.gcp.datacatalog.TaxonomyArgs;
import com.pulumi.gcp.datacatalog.PolicyTag;
import com.pulumi.gcp.datacatalog.PolicyTagArgs;
import com.pulumi.gcp.bigquerydatapolicy.DataPolicy;
import com.pulumi.gcp.bigquerydatapolicy.DataPolicyArgs;
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 taxonomy = new Taxonomy("taxonomy", TaxonomyArgs.builder()
.region("us-central1")
.displayName("taxonomy")
.description("A collection of policy tags")
.activatedPolicyTypes("FINE_GRAINED_ACCESS_CONTROL")
.build());
var policyTag = new PolicyTag("policyTag", PolicyTagArgs.builder()
.taxonomy(taxonomy.id())
.displayName("Low security")
.description("A policy tag normally associated with low security items")
.build());
var dataPolicy = new DataPolicy("dataPolicy", DataPolicyArgs.builder()
.location("us-central1")
.dataPolicyId("data_policy")
.policyTag(policyTag.name())
.dataPolicyType("COLUMN_LEVEL_SECURITY_POLICY")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
taxonomy = gcp.datacatalog.Taxonomy("taxonomy",
region="us-central1",
display_name="taxonomy",
description="A collection of policy tags",
activated_policy_types=["FINE_GRAINED_ACCESS_CONTROL"])
policy_tag = gcp.datacatalog.PolicyTag("policyTag",
taxonomy=taxonomy.id,
display_name="Low security",
description="A policy tag normally associated with low security items")
data_policy = gcp.bigquerydatapolicy.DataPolicy("dataPolicy",
location="us-central1",
data_policy_id="data_policy",
policy_tag=policy_tag.name,
data_policy_type="COLUMN_LEVEL_SECURITY_POLICY")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const taxonomy = new gcp.datacatalog.Taxonomy("taxonomy", {
region: "us-central1",
displayName: "taxonomy",
description: "A collection of policy tags",
activatedPolicyTypes: ["FINE_GRAINED_ACCESS_CONTROL"],
});
const policyTag = new gcp.datacatalog.PolicyTag("policyTag", {
taxonomy: taxonomy.id,
displayName: "Low security",
description: "A policy tag normally associated with low security items",
});
const dataPolicy = new gcp.bigquerydatapolicy.DataPolicy("dataPolicy", {
location: "us-central1",
dataPolicyId: "data_policy",
policyTag: policyTag.name,
dataPolicyType: "COLUMN_LEVEL_SECURITY_POLICY",
});
resources:
dataPolicy:
type: gcp:bigquerydatapolicy:DataPolicy
properties:
location: us-central1
dataPolicyId: data_policy
policyTag: ${policyTag.name}
dataPolicyType: COLUMN_LEVEL_SECURITY_POLICY
policyTag:
type: gcp:datacatalog:PolicyTag
properties:
taxonomy: ${taxonomy.id}
displayName: Low security
description: A policy tag normally associated with low security items
taxonomy:
type: gcp:datacatalog:Taxonomy
properties:
region: us-central1
displayName: taxonomy
description: A collection of policy tags
activatedPolicyTypes:
- FINE_GRAINED_ACCESS_CONTROL
Create DataPolicy Resource
new DataPolicy(name: string, args: DataPolicyArgs, opts?: CustomResourceOptions);
@overload
def DataPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
data_masking_policy: Optional[DataPolicyDataMaskingPolicyArgs] = None,
data_policy_id: Optional[str] = None,
data_policy_type: Optional[str] = None,
location: Optional[str] = None,
policy_tag: Optional[str] = None,
project: Optional[str] = None)
@overload
def DataPolicy(resource_name: str,
args: DataPolicyArgs,
opts: Optional[ResourceOptions] = None)
func NewDataPolicy(ctx *Context, name string, args DataPolicyArgs, opts ...ResourceOption) (*DataPolicy, error)
public DataPolicy(string name, DataPolicyArgs args, CustomResourceOptions? opts = null)
public DataPolicy(String name, DataPolicyArgs args)
public DataPolicy(String name, DataPolicyArgs args, CustomResourceOptions options)
type: gcp:bigquerydatapolicy:DataPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DataPolicyArgs
- 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 DataPolicyArgs
- 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 DataPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DataPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DataPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DataPolicy 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 DataPolicy resource accepts the following input properties:
- Data
Policy stringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- Data
Policy stringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- Location string
The name of the location of the data policy.
- Policy
Tag string Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- Data
Masking DataPolicy Policy Data Masking Policy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Data
Policy stringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- Data
Policy stringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- Location string
The name of the location of the data policy.
- Policy
Tag string Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- Data
Masking DataPolicy Policy Data Masking Policy Args The data masking policy that specifies the data masking rule to use. Structure is documented below.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data
Policy StringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data
Policy StringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location String
The name of the location of the data policy.
- policy
Tag String Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- data
Masking DataPolicy Policy Data Masking Policy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data
Policy stringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data
Policy stringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location string
The name of the location of the data policy.
- policy
Tag string Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- data
Masking DataPolicy Policy Data Masking Policy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data_
policy_ strid User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data_
policy_ strtype The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location str
The name of the location of the data policy.
- policy_
tag str Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- data_
masking_ Datapolicy Policy Data Masking Policy Args The data masking policy that specifies the data masking rule to use. Structure is documented below.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data
Policy StringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data
Policy StringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location String
The name of the location of the data policy.
- policy
Tag String Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- data
Masking Property MapPolicy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- 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 DataPolicy resource produces the following output properties:
Look up Existing DataPolicy Resource
Get an existing DataPolicy 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?: DataPolicyState, opts?: CustomResourceOptions): DataPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
data_masking_policy: Optional[DataPolicyDataMaskingPolicyArgs] = None,
data_policy_id: Optional[str] = None,
data_policy_type: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
policy_tag: Optional[str] = None,
project: Optional[str] = None) -> DataPolicy
func GetDataPolicy(ctx *Context, name string, id IDInput, state *DataPolicyState, opts ...ResourceOption) (*DataPolicy, error)
public static DataPolicy Get(string name, Input<string> id, DataPolicyState? state, CustomResourceOptions? opts = null)
public static DataPolicy get(String name, Output<String> id, DataPolicyState 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.
- Data
Masking DataPolicy Policy Data Masking Policy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- Data
Policy stringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- Data
Policy stringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- Location string
The name of the location of the data policy.
- Name string
Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.
- Policy
Tag string Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Data
Masking DataPolicy Policy Data Masking Policy Args The data masking policy that specifies the data masking rule to use. Structure is documented below.
- Data
Policy stringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- Data
Policy stringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- Location string
The name of the location of the data policy.
- Name string
Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.
- Policy
Tag string Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data
Masking DataPolicy Policy Data Masking Policy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- data
Policy StringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data
Policy StringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location String
The name of the location of the data policy.
- name String
Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.
- policy
Tag String Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data
Masking DataPolicy Policy Data Masking Policy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- data
Policy stringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data
Policy stringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location string
The name of the location of the data policy.
- name string
Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.
- policy
Tag string Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data_
masking_ Datapolicy Policy Data Masking Policy Args The data masking policy that specifies the data masking rule to use. Structure is documented below.
- data_
policy_ strid User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data_
policy_ strtype The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location str
The name of the location of the data policy.
- name str
Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.
- policy_
tag str Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- data
Masking Property MapPolicy The data masking policy that specifies the data masking rule to use. Structure is documented below.
- data
Policy StringId User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {dataPolicyId} in part of the resource name.
- data
Policy StringType The enrollment level of the service. Possible values are:
COLUMN_LEVEL_SECURITY_POLICY
,DATA_MASKING_POLICY
.- location String
The name of the location of the data policy.
- name String
Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.
- policy
Tag String Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Supporting Types
DataPolicyDataMaskingPolicy, DataPolicyDataMaskingPolicyArgs
- Predefined
Expression string The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options. Possible values are:
SHA256
,ALWAYS_NULL
,DEFAULT_MASKING_VALUE
,LAST_FOUR_CHARACTERS
,FIRST_FOUR_CHARACTERS
,EMAIL_MASK
,DATE_YEAR_MASK
.
- Predefined
Expression string The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options. Possible values are:
SHA256
,ALWAYS_NULL
,DEFAULT_MASKING_VALUE
,LAST_FOUR_CHARACTERS
,FIRST_FOUR_CHARACTERS
,EMAIL_MASK
,DATE_YEAR_MASK
.
- predefined
Expression String The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options. Possible values are:
SHA256
,ALWAYS_NULL
,DEFAULT_MASKING_VALUE
,LAST_FOUR_CHARACTERS
,FIRST_FOUR_CHARACTERS
,EMAIL_MASK
,DATE_YEAR_MASK
.
- predefined
Expression string The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options. Possible values are:
SHA256
,ALWAYS_NULL
,DEFAULT_MASKING_VALUE
,LAST_FOUR_CHARACTERS
,FIRST_FOUR_CHARACTERS
,EMAIL_MASK
,DATE_YEAR_MASK
.
- predefined_
expression str The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options. Possible values are:
SHA256
,ALWAYS_NULL
,DEFAULT_MASKING_VALUE
,LAST_FOUR_CHARACTERS
,FIRST_FOUR_CHARACTERS
,EMAIL_MASK
,DATE_YEAR_MASK
.
- predefined
Expression String The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options. Possible values are:
SHA256
,ALWAYS_NULL
,DEFAULT_MASKING_VALUE
,LAST_FOUR_CHARACTERS
,FIRST_FOUR_CHARACTERS
,EMAIL_MASK
,DATE_YEAR_MASK
.
Import
DataPolicy can be imported using any of these accepted formats* projects/{{project}}/locations/{{location}}/dataPolicies/{{data_policy_id}}
* {{project}}/{{location}}/{{data_policy_id}}
* {{location}}/{{data_policy_id}}
In Terraform v1.5.0 and later, use an import
block to import DataPolicy using one of the formats above. For exampletf import {
id = “projects/{{project}}/locations/{{location}}/dataPolicies/{{data_policy_id}}”
to = google_bigquery_datapolicy_data_policy.default }
$ pulumi import gcp:bigquerydatapolicy/dataPolicy:DataPolicy When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), DataPolicy can be imported using one of the formats above. For example
$ pulumi import gcp:bigquerydatapolicy/dataPolicy:DataPolicy default projects/{{project}}/locations/{{location}}/dataPolicies/{{data_policy_id}}
$ pulumi import gcp:bigquerydatapolicy/dataPolicy:DataPolicy default {{project}}/{{location}}/{{data_policy_id}}
$ pulumi import gcp:bigquerydatapolicy/dataPolicy:DataPolicy default {{location}}/{{data_policy_id}}
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.