gcp.bigquerydatapolicy.DataPolicy

Import

DataPolicy can be imported using any of these accepted formats

 $ 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}}

Example Usage

Bigquery Datapolicy Data Policy Basic

using System.Collections.Generic;
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",
        },
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

    var policyTag = new Gcp.DataCatalog.PolicyTag("policyTag", new()
    {
        Taxonomy = taxonomy.Id,
        DisplayName = "Low security",
        Description = "A policy tag normally associated with low security items",
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

    var dataPolicy = new Gcp.BigQueryDataPolicy.DataPolicy("dataPolicy", new()
    {
        Location = "us-central1",
        DataPolicyId = "data_policy",
        PolicyTag = policyTag.Name,
        DataPolicyType = "COLUMN_LEVEL_SECURITY_POLICY",
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/bigquerydatapolicy"
	"github.com/pulumi/pulumi-gcp/sdk/v6/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"),
			},
		}, pulumi.Provider(google_beta))
		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"),
		}, pulumi.Provider(google_beta))
		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"),
		}, pulumi.Provider(google_beta))
		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 com.pulumi.resources.CustomResourceOptions;
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(), CustomResourceOptions.builder()
                .provider(google_beta)
                .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(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

        var dataPolicy = new DataPolicy("dataPolicy", DataPolicyArgs.builder()        
            .location("us-central1")
            .dataPolicyId("data_policy")
            .policyTag(policyTag.name())
            .dataPolicyType("COLUMN_LEVEL_SECURITY_POLICY")
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .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"],
    opts=pulumi.ResourceOptions(provider=google_beta))
policy_tag = gcp.datacatalog.PolicyTag("policyTag",
    taxonomy=taxonomy.id,
    display_name="Low security",
    description="A policy tag normally associated with low security items",
    opts=pulumi.ResourceOptions(provider=google_beta))
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",
    opts=pulumi.ResourceOptions(provider=google_beta))
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"],
}, {
    provider: google_beta,
});
const policyTag = new gcp.datacatalog.PolicyTag("policyTag", {
    taxonomy: taxonomy.id,
    displayName: "Low security",
    description: "A policy tag normally associated with low security items",
}, {
    provider: google_beta,
});
const dataPolicy = new gcp.bigquerydatapolicy.DataPolicy("dataPolicy", {
    location: "us-central1",
    dataPolicyId: "data_policy",
    policyTag: policyTag.name,
    dataPolicyType: "COLUMN_LEVEL_SECURITY_POLICY",
}, {
    provider: google_beta,
});
resources:
  dataPolicy:
    type: gcp:bigquerydatapolicy:DataPolicy
    properties:
      location: us-central1
      dataPolicyId: data_policy
      policyTag: ${policyTag.name}
      dataPolicyType: COLUMN_LEVEL_SECURITY_POLICY
    options:
      provider: ${["google-beta"]}
  policyTag:
    type: gcp:datacatalog:PolicyTag
    properties:
      taxonomy: ${taxonomy.id}
      displayName: Low security
      description: A policy tag normally associated with low security items
    options:
      provider: ${["google-beta"]}
  taxonomy:
    type: gcp:datacatalog:Taxonomy
    properties:
      region: us-central1
      displayName: taxonomy
      description: A collection of policy tags
      activatedPolicyTypes:
        - FINE_GRAINED_ACCESS_CONTROL
    options:
      provider: ${["google-beta"]}

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:

DataPolicyId string

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.

DataPolicyType string

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and DATA_MASKING_POLICY.

Location string

The name of the location of the data policy.

PolicyTag string

Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.

DataMaskingPolicy DataPolicyDataMaskingPolicyArgs

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.

DataPolicyId string

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.

DataPolicyType string

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and DATA_MASKING_POLICY.

Location string

The name of the location of the data policy.

PolicyTag string

Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.

DataMaskingPolicy DataPolicyDataMaskingPolicyArgs

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.

dataPolicyId String

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.

dataPolicyType String

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and DATA_MASKING_POLICY.

location String

The name of the location of the data policy.

policyTag String

Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.

dataMaskingPolicy DataPolicyDataMaskingPolicyArgs

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.

dataPolicyId string

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.

dataPolicyType string

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and DATA_MASKING_POLICY.

location string

The name of the location of the data policy.

policyTag string

Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.

dataMaskingPolicy DataPolicyDataMaskingPolicyArgs

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_id str

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_type str

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and 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_policy DataPolicyDataMaskingPolicyArgs

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.

dataPolicyId String

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.

dataPolicyType String

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and DATA_MASKING_POLICY.

location String

The name of the location of the data policy.

policyTag String

Policy tag resource name, in the format of projects/{project_number}/locations/{locationId}/taxonomies/{taxonomyId}/policyTags/{policyTag_id}.

dataMaskingPolicy Property Map

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:

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.

id string

The provider-assigned unique ID for this managed resource.

name string

Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.

id str

The provider-assigned unique ID for this managed resource.

name str

Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name of this data policy, in the format of projects/{project_number}/locations/{locationId}/dataPolicies/{dataPolicyId}.

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.
The following state arguments are supported:
DataMaskingPolicy DataPolicyDataMaskingPolicyArgs

The data masking policy that specifies the data masking rule to use. Structure is documented below.

DataPolicyId string

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.

DataPolicyType string

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and 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}.

PolicyTag 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.

DataMaskingPolicy DataPolicyDataMaskingPolicyArgs

The data masking policy that specifies the data masking rule to use. Structure is documented below.

DataPolicyId string

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.

DataPolicyType string

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and 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}.

PolicyTag 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.

dataMaskingPolicy DataPolicyDataMaskingPolicyArgs

The data masking policy that specifies the data masking rule to use. Structure is documented below.

dataPolicyId String

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.

dataPolicyType String

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and 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}.

policyTag 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.

dataMaskingPolicy DataPolicyDataMaskingPolicyArgs

The data masking policy that specifies the data masking rule to use. Structure is documented below.

dataPolicyId string

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.

dataPolicyType string

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and 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}.

policyTag 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_policy DataPolicyDataMaskingPolicyArgs

The data masking policy that specifies the data masking rule to use. Structure is documented below.

data_policy_id str

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_type str

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and 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.

dataMaskingPolicy Property Map

The data masking policy that specifies the data masking rule to use. Structure is documented below.

dataPolicyId String

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.

dataPolicyType String

The enrollment level of the service. Possible values are COLUMN_LEVEL_SECURITY_POLICY and 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}.

policyTag 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

PredefinedExpression 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, and DEFAULT_MASKING_VALUE.

PredefinedExpression 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, and DEFAULT_MASKING_VALUE.

predefinedExpression 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, and DEFAULT_MASKING_VALUE.

predefinedExpression 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, and DEFAULT_MASKING_VALUE.

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, and DEFAULT_MASKING_VALUE.

predefinedExpression 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, and DEFAULT_MASKING_VALUE.

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.