1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. bigquery
  5. Datapolicyv2DataPolicy
Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi

gcp.bigquery.Datapolicyv2DataPolicy

Deploy with Pulumi
gcp logo
Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi

    BigQuery Data Policy

    To get more information about DataPolicy, see:

    Example Usage

    Bigquery Datapolicyv2 Datapolicy Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const basicDataPolicy = new gcp.bigquery.Datapolicyv2DataPolicy("basic_data_policy", {
        location: "us-central1",
        dataPolicyType: "RAW_DATA_ACCESS_POLICY",
        dataPolicyId: "basic_data_policy",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    basic_data_policy = gcp.bigquery.Datapolicyv2DataPolicy("basic_data_policy",
        location="us-central1",
        data_policy_type="RAW_DATA_ACCESS_POLICY",
        data_policy_id="basic_data_policy")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/bigquery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := bigquery.NewDatapolicyv2DataPolicy(ctx, "basic_data_policy", &bigquery.Datapolicyv2DataPolicyArgs{
    			Location:       pulumi.String("us-central1"),
    			DataPolicyType: pulumi.String("RAW_DATA_ACCESS_POLICY"),
    			DataPolicyId:   pulumi.String("basic_data_policy"),
    		})
    		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 basicDataPolicy = new Gcp.BigQuery.Datapolicyv2DataPolicy("basic_data_policy", new()
        {
            Location = "us-central1",
            DataPolicyType = "RAW_DATA_ACCESS_POLICY",
            DataPolicyId = "basic_data_policy",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicy;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicyArgs;
    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 basicDataPolicy = new Datapolicyv2DataPolicy("basicDataPolicy", Datapolicyv2DataPolicyArgs.builder()
                .location("us-central1")
                .dataPolicyType("RAW_DATA_ACCESS_POLICY")
                .dataPolicyId("basic_data_policy")
                .build());
    
        }
    }
    
    resources:
      basicDataPolicy:
        type: gcp:bigquery:Datapolicyv2DataPolicy
        name: basic_data_policy
        properties:
          location: us-central1
          dataPolicyType: RAW_DATA_ACCESS_POLICY
          dataPolicyId: basic_data_policy
    

    Bigquery Datapolicyv2 Datapolicy Predefined Masking

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const predefinedMaskingDataPolicy = new gcp.bigquery.Datapolicyv2DataPolicy("predefined_masking_data_policy", {
        location: "us-central1",
        dataPolicyType: "DATA_MASKING_POLICY",
        dataMaskingPolicy: {
            predefinedExpression: "SHA256",
        },
        dataPolicyId: "predefined_masking_data_policy",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    predefined_masking_data_policy = gcp.bigquery.Datapolicyv2DataPolicy("predefined_masking_data_policy",
        location="us-central1",
        data_policy_type="DATA_MASKING_POLICY",
        data_masking_policy={
            "predefined_expression": "SHA256",
        },
        data_policy_id="predefined_masking_data_policy")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/bigquery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := bigquery.NewDatapolicyv2DataPolicy(ctx, "predefined_masking_data_policy", &bigquery.Datapolicyv2DataPolicyArgs{
    			Location:       pulumi.String("us-central1"),
    			DataPolicyType: pulumi.String("DATA_MASKING_POLICY"),
    			DataMaskingPolicy: &bigquery.Datapolicyv2DataPolicyDataMaskingPolicyArgs{
    				PredefinedExpression: pulumi.String("SHA256"),
    			},
    			DataPolicyId: pulumi.String("predefined_masking_data_policy"),
    		})
    		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 predefinedMaskingDataPolicy = new Gcp.BigQuery.Datapolicyv2DataPolicy("predefined_masking_data_policy", new()
        {
            Location = "us-central1",
            DataPolicyType = "DATA_MASKING_POLICY",
            DataMaskingPolicy = new Gcp.BigQuery.Inputs.Datapolicyv2DataPolicyDataMaskingPolicyArgs
            {
                PredefinedExpression = "SHA256",
            },
            DataPolicyId = "predefined_masking_data_policy",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicy;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicyArgs;
    import com.pulumi.gcp.bigquery.inputs.Datapolicyv2DataPolicyDataMaskingPolicyArgs;
    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 predefinedMaskingDataPolicy = new Datapolicyv2DataPolicy("predefinedMaskingDataPolicy", Datapolicyv2DataPolicyArgs.builder()
                .location("us-central1")
                .dataPolicyType("DATA_MASKING_POLICY")
                .dataMaskingPolicy(Datapolicyv2DataPolicyDataMaskingPolicyArgs.builder()
                    .predefinedExpression("SHA256")
                    .build())
                .dataPolicyId("predefined_masking_data_policy")
                .build());
    
        }
    }
    
    resources:
      predefinedMaskingDataPolicy:
        type: gcp:bigquery:Datapolicyv2DataPolicy
        name: predefined_masking_data_policy
        properties:
          location: us-central1
          dataPolicyType: DATA_MASKING_POLICY
          dataMaskingPolicy:
            predefinedExpression: SHA256
          dataPolicyId: predefined_masking_data_policy
    

    Bigquery Datapolicyv2 Datapolicy Routine

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const test = new gcp.bigquery.Dataset("test", {
        datasetId: "dataset_id",
        location: "us-central1",
    });
    const customMaskingRoutine = new gcp.bigquery.Routine("custom_masking_routine", {
        datasetId: test.datasetId,
        routineId: "custom_masking_routine",
        routineType: "SCALAR_FUNCTION",
        language: "SQL",
        dataGovernanceType: "DATA_MASKING",
        definitionBody: "SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')",
        returnType: "{\"typeKind\" :  \"STRING\"}",
        arguments: [{
            name: "ssn",
            dataType: "{\"typeKind\" :  \"STRING\"}",
        }],
    });
    const routineDataPolicy = new gcp.bigquery.Datapolicyv2DataPolicy("routine_data_policy", {
        location: "us-central1",
        dataPolicyId: "routine_data_policy",
        dataPolicyType: "DATA_MASKING_POLICY",
        dataMaskingPolicy: {
            routine: customMaskingRoutine.id,
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    test = gcp.bigquery.Dataset("test",
        dataset_id="dataset_id",
        location="us-central1")
    custom_masking_routine = gcp.bigquery.Routine("custom_masking_routine",
        dataset_id=test.dataset_id,
        routine_id="custom_masking_routine",
        routine_type="SCALAR_FUNCTION",
        language="SQL",
        data_governance_type="DATA_MASKING",
        definition_body="SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')",
        return_type="{\"typeKind\" :  \"STRING\"}",
        arguments=[{
            "name": "ssn",
            "data_type": "{\"typeKind\" :  \"STRING\"}",
        }])
    routine_data_policy = gcp.bigquery.Datapolicyv2DataPolicy("routine_data_policy",
        location="us-central1",
        data_policy_id="routine_data_policy",
        data_policy_type="DATA_MASKING_POLICY",
        data_masking_policy={
            "routine": custom_masking_routine.id,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/bigquery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		test, err := bigquery.NewDataset(ctx, "test", &bigquery.DatasetArgs{
    			DatasetId: pulumi.String("dataset_id"),
    			Location:  pulumi.String("us-central1"),
    		})
    		if err != nil {
    			return err
    		}
    		customMaskingRoutine, err := bigquery.NewRoutine(ctx, "custom_masking_routine", &bigquery.RoutineArgs{
    			DatasetId:          test.DatasetId,
    			RoutineId:          pulumi.String("custom_masking_routine"),
    			RoutineType:        pulumi.String("SCALAR_FUNCTION"),
    			Language:           pulumi.String("SQL"),
    			DataGovernanceType: pulumi.String("DATA_MASKING"),
    			DefinitionBody:     pulumi.String("SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')"),
    			ReturnType:         pulumi.String("{\"typeKind\" :  \"STRING\"}"),
    			Arguments: bigquery.RoutineArgumentArray{
    				&bigquery.RoutineArgumentArgs{
    					Name:     pulumi.String("ssn"),
    					DataType: pulumi.String("{\"typeKind\" :  \"STRING\"}"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = bigquery.NewDatapolicyv2DataPolicy(ctx, "routine_data_policy", &bigquery.Datapolicyv2DataPolicyArgs{
    			Location:       pulumi.String("us-central1"),
    			DataPolicyId:   pulumi.String("routine_data_policy"),
    			DataPolicyType: pulumi.String("DATA_MASKING_POLICY"),
    			DataMaskingPolicy: &bigquery.Datapolicyv2DataPolicyDataMaskingPolicyArgs{
    				Routine: customMaskingRoutine.ID(),
    			},
    		})
    		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 test = new Gcp.BigQuery.Dataset("test", new()
        {
            DatasetId = "dataset_id",
            Location = "us-central1",
        });
    
        var customMaskingRoutine = new Gcp.BigQuery.Routine("custom_masking_routine", new()
        {
            DatasetId = test.DatasetId,
            RoutineId = "custom_masking_routine",
            RoutineType = "SCALAR_FUNCTION",
            Language = "SQL",
            DataGovernanceType = "DATA_MASKING",
            DefinitionBody = "SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')",
            ReturnType = "{\"typeKind\" :  \"STRING\"}",
            Arguments = new[]
            {
                new Gcp.BigQuery.Inputs.RoutineArgumentArgs
                {
                    Name = "ssn",
                    DataType = "{\"typeKind\" :  \"STRING\"}",
                },
            },
        });
    
        var routineDataPolicy = new Gcp.BigQuery.Datapolicyv2DataPolicy("routine_data_policy", new()
        {
            Location = "us-central1",
            DataPolicyId = "routine_data_policy",
            DataPolicyType = "DATA_MASKING_POLICY",
            DataMaskingPolicy = new Gcp.BigQuery.Inputs.Datapolicyv2DataPolicyDataMaskingPolicyArgs
            {
                Routine = customMaskingRoutine.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.bigquery.Dataset;
    import com.pulumi.gcp.bigquery.DatasetArgs;
    import com.pulumi.gcp.bigquery.Routine;
    import com.pulumi.gcp.bigquery.RoutineArgs;
    import com.pulumi.gcp.bigquery.inputs.RoutineArgumentArgs;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicy;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicyArgs;
    import com.pulumi.gcp.bigquery.inputs.Datapolicyv2DataPolicyDataMaskingPolicyArgs;
    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 test = new Dataset("test", DatasetArgs.builder()
                .datasetId("dataset_id")
                .location("us-central1")
                .build());
    
            var customMaskingRoutine = new Routine("customMaskingRoutine", RoutineArgs.builder()
                .datasetId(test.datasetId())
                .routineId("custom_masking_routine")
                .routineType("SCALAR_FUNCTION")
                .language("SQL")
                .dataGovernanceType("DATA_MASKING")
                .definitionBody("SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')")
                .returnType("{\"typeKind\" :  \"STRING\"}")
                .arguments(RoutineArgumentArgs.builder()
                    .name("ssn")
                    .dataType("{\"typeKind\" :  \"STRING\"}")
                    .build())
                .build());
    
            var routineDataPolicy = new Datapolicyv2DataPolicy("routineDataPolicy", Datapolicyv2DataPolicyArgs.builder()
                .location("us-central1")
                .dataPolicyId("routine_data_policy")
                .dataPolicyType("DATA_MASKING_POLICY")
                .dataMaskingPolicy(Datapolicyv2DataPolicyDataMaskingPolicyArgs.builder()
                    .routine(customMaskingRoutine.id())
                    .build())
                .build());
    
        }
    }
    
    resources:
      routineDataPolicy:
        type: gcp:bigquery:Datapolicyv2DataPolicy
        name: routine_data_policy
        properties:
          location: us-central1
          dataPolicyId: routine_data_policy
          dataPolicyType: DATA_MASKING_POLICY
          dataMaskingPolicy:
            routine: ${customMaskingRoutine.id}
      test:
        type: gcp:bigquery:Dataset
        properties:
          datasetId: dataset_id
          location: us-central1
      customMaskingRoutine:
        type: gcp:bigquery:Routine
        name: custom_masking_routine
        properties:
          datasetId: ${test.datasetId}
          routineId: custom_masking_routine
          routineType: SCALAR_FUNCTION
          language: SQL
          dataGovernanceType: DATA_MASKING
          definitionBody: SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')
          returnType: '{"typeKind" :  "STRING"}'
          arguments:
            - name: ssn
              dataType: '{"typeKind" :  "STRING"}'
    

    Bigquery Datapolicyv2 Datapolicy Withgrantees

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const dataPolicyWithGrantees = new gcp.bigquery.Datapolicyv2DataPolicy("data_policy_with_grantees", {
        location: "us-central1",
        dataPolicyType: "RAW_DATA_ACCESS_POLICY",
        grantees: ["principal://goog/subject/jane@example.com"],
        dataPolicyId: "data_policy_with_grantees",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    data_policy_with_grantees = gcp.bigquery.Datapolicyv2DataPolicy("data_policy_with_grantees",
        location="us-central1",
        data_policy_type="RAW_DATA_ACCESS_POLICY",
        grantees=["principal://goog/subject/jane@example.com"],
        data_policy_id="data_policy_with_grantees")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/bigquery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := bigquery.NewDatapolicyv2DataPolicy(ctx, "data_policy_with_grantees", &bigquery.Datapolicyv2DataPolicyArgs{
    			Location:       pulumi.String("us-central1"),
    			DataPolicyType: pulumi.String("RAW_DATA_ACCESS_POLICY"),
    			Grantees: pulumi.StringArray{
    				pulumi.String("principal://goog/subject/jane@example.com"),
    			},
    			DataPolicyId: pulumi.String("data_policy_with_grantees"),
    		})
    		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 dataPolicyWithGrantees = new Gcp.BigQuery.Datapolicyv2DataPolicy("data_policy_with_grantees", new()
        {
            Location = "us-central1",
            DataPolicyType = "RAW_DATA_ACCESS_POLICY",
            Grantees = new[]
            {
                "principal://goog/subject/jane@example.com",
            },
            DataPolicyId = "data_policy_with_grantees",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicy;
    import com.pulumi.gcp.bigquery.Datapolicyv2DataPolicyArgs;
    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 dataPolicyWithGrantees = new Datapolicyv2DataPolicy("dataPolicyWithGrantees", Datapolicyv2DataPolicyArgs.builder()
                .location("us-central1")
                .dataPolicyType("RAW_DATA_ACCESS_POLICY")
                .grantees("principal://goog/subject/jane@example.com")
                .dataPolicyId("data_policy_with_grantees")
                .build());
    
        }
    }
    
    resources:
      dataPolicyWithGrantees:
        type: gcp:bigquery:Datapolicyv2DataPolicy
        name: data_policy_with_grantees
        properties:
          location: us-central1
          dataPolicyType: RAW_DATA_ACCESS_POLICY
          grantees:
            - principal://goog/subject/jane@example.com
          dataPolicyId: data_policy_with_grantees
    

    Create Datapolicyv2DataPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Datapolicyv2DataPolicy(name: string, args: Datapolicyv2DataPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def Datapolicyv2DataPolicy(resource_name: str,
                               args: Datapolicyv2DataPolicyArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Datapolicyv2DataPolicy(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               data_policy_id: Optional[str] = None,
                               data_policy_type: Optional[str] = None,
                               location: Optional[str] = None,
                               data_masking_policy: Optional[Datapolicyv2DataPolicyDataMaskingPolicyArgs] = None,
                               etag: Optional[str] = None,
                               grantees: Optional[Sequence[str]] = None,
                               project: Optional[str] = None)
    func NewDatapolicyv2DataPolicy(ctx *Context, name string, args Datapolicyv2DataPolicyArgs, opts ...ResourceOption) (*Datapolicyv2DataPolicy, error)
    public Datapolicyv2DataPolicy(string name, Datapolicyv2DataPolicyArgs args, CustomResourceOptions? opts = null)
    public Datapolicyv2DataPolicy(String name, Datapolicyv2DataPolicyArgs args)
    public Datapolicyv2DataPolicy(String name, Datapolicyv2DataPolicyArgs args, CustomResourceOptions options)
    
    type: gcp:bigquery:Datapolicyv2DataPolicy
    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 Datapolicyv2DataPolicyArgs
    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 Datapolicyv2DataPolicyArgs
    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 Datapolicyv2DataPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args Datapolicyv2DataPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args Datapolicyv2DataPolicyArgs
    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 datapolicyv2DataPolicyResource = new Gcp.BigQuery.Datapolicyv2DataPolicy("datapolicyv2DataPolicyResource", new()
    {
        DataPolicyId = "string",
        DataPolicyType = "string",
        Location = "string",
        DataMaskingPolicy = new Gcp.BigQuery.Inputs.Datapolicyv2DataPolicyDataMaskingPolicyArgs
        {
            PredefinedExpression = "string",
            Routine = "string",
        },
        Etag = "string",
        Grantees = new[]
        {
            "string",
        },
        Project = "string",
    });
    
    example, err := bigquery.NewDatapolicyv2DataPolicy(ctx, "datapolicyv2DataPolicyResource", &bigquery.Datapolicyv2DataPolicyArgs{
    	DataPolicyId:   pulumi.String("string"),
    	DataPolicyType: pulumi.String("string"),
    	Location:       pulumi.String("string"),
    	DataMaskingPolicy: &bigquery.Datapolicyv2DataPolicyDataMaskingPolicyArgs{
    		PredefinedExpression: pulumi.String("string"),
    		Routine:              pulumi.String("string"),
    	},
    	Etag: pulumi.String("string"),
    	Grantees: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Project: pulumi.String("string"),
    })
    
    var datapolicyv2DataPolicyResource = new Datapolicyv2DataPolicy("datapolicyv2DataPolicyResource", Datapolicyv2DataPolicyArgs.builder()
        .dataPolicyId("string")
        .dataPolicyType("string")
        .location("string")
        .dataMaskingPolicy(Datapolicyv2DataPolicyDataMaskingPolicyArgs.builder()
            .predefinedExpression("string")
            .routine("string")
            .build())
        .etag("string")
        .grantees("string")
        .project("string")
        .build());
    
    datapolicyv2_data_policy_resource = gcp.bigquery.Datapolicyv2DataPolicy("datapolicyv2DataPolicyResource",
        data_policy_id="string",
        data_policy_type="string",
        location="string",
        data_masking_policy={
            "predefined_expression": "string",
            "routine": "string",
        },
        etag="string",
        grantees=["string"],
        project="string")
    
    const datapolicyv2DataPolicyResource = new gcp.bigquery.Datapolicyv2DataPolicy("datapolicyv2DataPolicyResource", {
        dataPolicyId: "string",
        dataPolicyType: "string",
        location: "string",
        dataMaskingPolicy: {
            predefinedExpression: "string",
            routine: "string",
        },
        etag: "string",
        grantees: ["string"],
        project: "string",
    });
    
    type: gcp:bigquery:Datapolicyv2DataPolicy
    properties:
        dataMaskingPolicy:
            predefinedExpression: string
            routine: string
        dataPolicyId: string
        dataPolicyType: string
        etag: string
        grantees:
            - string
        location: string
        project: string
    

    Datapolicyv2DataPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Datapolicyv2DataPolicy 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 {data_policy_id} in part of the resource name.
    DataPolicyType string
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    Location string
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    DataMaskingPolicy Datapolicyv2DataPolicyDataMaskingPolicy
    The policy used to specify data masking rule. Structure is documented below.
    Etag string
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    Grantees List<string>
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    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 {data_policy_id} in part of the resource name.
    DataPolicyType string
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    Location string
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    DataMaskingPolicy Datapolicyv2DataPolicyDataMaskingPolicyArgs
    The policy used to specify data masking rule. Structure is documented below.
    Etag string
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    Grantees []string
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    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 {data_policy_id} in part of the resource name.
    dataPolicyType String
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    location String
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    dataMaskingPolicy Datapolicyv2DataPolicyDataMaskingPolicy
    The policy used to specify data masking rule. Structure is documented below.
    etag String
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees List<String>
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    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 {data_policy_id} in part of the resource name.
    dataPolicyType string
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    location string
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    dataMaskingPolicy Datapolicyv2DataPolicyDataMaskingPolicy
    The policy used to specify data masking rule. Structure is documented below.
    etag string
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees string[]
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    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 {data_policy_id} in part of the resource name.
    data_policy_type str
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    location str
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    data_masking_policy Datapolicyv2DataPolicyDataMaskingPolicyArgs
    The policy used to specify data masking rule. Structure is documented below.
    etag str
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees Sequence[str]
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    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 {data_policy_id} in part of the resource name.
    dataPolicyType String
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    location String
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    dataMaskingPolicy Property Map
    The policy used to specify data masking rule. Structure is documented below.
    etag String
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees List<String>
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    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 Datapolicyv2DataPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    PolicyTag string
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    Version string
    The version of the Data Policy resource. Possible values: V1 V2
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    PolicyTag string
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    Version string
    The version of the Data Policy resource. Possible values: V1 V2
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policyTag String
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    version String
    The version of the Data Policy resource. Possible values: V1 V2
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policyTag string
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    version string
    The version of the Data Policy resource. Possible values: V1 V2
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policy_tag str
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    version str
    The version of the Data Policy resource. Possible values: V1 V2
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policyTag String
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    version String
    The version of the Data Policy resource. Possible values: V1 V2

    Look up Existing Datapolicyv2DataPolicy Resource

    Get an existing Datapolicyv2DataPolicy 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?: Datapolicyv2DataPolicyState, opts?: CustomResourceOptions): Datapolicyv2DataPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data_masking_policy: Optional[Datapolicyv2DataPolicyDataMaskingPolicyArgs] = None,
            data_policy_id: Optional[str] = None,
            data_policy_type: Optional[str] = None,
            etag: Optional[str] = None,
            grantees: Optional[Sequence[str]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            policy_tag: Optional[str] = None,
            project: Optional[str] = None,
            version: Optional[str] = None) -> Datapolicyv2DataPolicy
    func GetDatapolicyv2DataPolicy(ctx *Context, name string, id IDInput, state *Datapolicyv2DataPolicyState, opts ...ResourceOption) (*Datapolicyv2DataPolicy, error)
    public static Datapolicyv2DataPolicy Get(string name, Input<string> id, Datapolicyv2DataPolicyState? state, CustomResourceOptions? opts = null)
    public static Datapolicyv2DataPolicy get(String name, Output<String> id, Datapolicyv2DataPolicyState state, CustomResourceOptions options)
    resources:  _:    type: gcp:bigquery:Datapolicyv2DataPolicy    get:      id: ${id}
    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 Datapolicyv2DataPolicyDataMaskingPolicy
    The policy used to specify data masking rule. 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 {data_policy_id} in part of the resource name.
    DataPolicyType string
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    Etag string
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    Grantees List<string>
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    Location string
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    Name string
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    PolicyTag string
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Version string
    The version of the Data Policy resource. Possible values: V1 V2
    DataMaskingPolicy Datapolicyv2DataPolicyDataMaskingPolicyArgs
    The policy used to specify data masking rule. 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 {data_policy_id} in part of the resource name.
    DataPolicyType string
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    Etag string
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    Grantees []string
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    Location string
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    Name string
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    PolicyTag string
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Version string
    The version of the Data Policy resource. Possible values: V1 V2
    dataMaskingPolicy Datapolicyv2DataPolicyDataMaskingPolicy
    The policy used to specify data masking rule. 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 {data_policy_id} in part of the resource name.
    dataPolicyType String
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    etag String
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees List<String>
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    location String
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    name String
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policyTag String
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    version String
    The version of the Data Policy resource. Possible values: V1 V2
    dataMaskingPolicy Datapolicyv2DataPolicyDataMaskingPolicy
    The policy used to specify data masking rule. 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 {data_policy_id} in part of the resource name.
    dataPolicyType string
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    etag string
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees string[]
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    location string
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    name string
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policyTag string
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    version string
    The version of the Data Policy resource. Possible values: V1 V2
    data_masking_policy Datapolicyv2DataPolicyDataMaskingPolicyArgs
    The policy used to specify data masking rule. 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 {data_policy_id} in part of the resource name.
    data_policy_type str
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    etag str
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees Sequence[str]
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    location str
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    name str
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policy_tag str
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    version str
    The version of the Data Policy resource. Possible values: V1 V2
    dataMaskingPolicy Property Map
    The policy used to specify data masking rule. 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 {data_policy_id} in part of the resource name.
    dataPolicyType String
    Type of data policy. Possible values: DATA_MASKING_POLICY RAW_DATA_ACCESS_POLICY COLUMN_LEVEL_SECURITY_POLICY
    etag String
    The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
    grantees List<String>
    The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the IAM V2 principal syntax Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
    location String
    Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
    name String
    Identifier. Resource name of this data policy, in the format of projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.
    policyTag String
    Policy tag resource name, in the format of projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}. policy_tag is supported only for V1 data policies.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    version String
    The version of the Data Policy resource. Possible values: V1 V2

    Supporting Types

    Datapolicyv2DataPolicyDataMaskingPolicy, Datapolicyv2DataPolicyDataMaskingPolicyArgs

    PredefinedExpression string
    A predefined masking expression. Possible values: SHA256 ALWAYS_NULL DEFAULT_MASKING_VALUE LAST_FOUR_CHARACTERS FIRST_FOUR_CHARACTERS EMAIL_MASK DATE_YEAR_MASK RANDOM_HASH
    Routine string
    The name of the BigQuery routine that contains the custom masking routine, in the format of projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}.
    PredefinedExpression string
    A predefined masking expression. Possible values: SHA256 ALWAYS_NULL DEFAULT_MASKING_VALUE LAST_FOUR_CHARACTERS FIRST_FOUR_CHARACTERS EMAIL_MASK DATE_YEAR_MASK RANDOM_HASH
    Routine string
    The name of the BigQuery routine that contains the custom masking routine, in the format of projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}.
    predefinedExpression String
    A predefined masking expression. Possible values: SHA256 ALWAYS_NULL DEFAULT_MASKING_VALUE LAST_FOUR_CHARACTERS FIRST_FOUR_CHARACTERS EMAIL_MASK DATE_YEAR_MASK RANDOM_HASH
    routine String
    The name of the BigQuery routine that contains the custom masking routine, in the format of projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}.
    predefinedExpression string
    A predefined masking expression. Possible values: SHA256 ALWAYS_NULL DEFAULT_MASKING_VALUE LAST_FOUR_CHARACTERS FIRST_FOUR_CHARACTERS EMAIL_MASK DATE_YEAR_MASK RANDOM_HASH
    routine string
    The name of the BigQuery routine that contains the custom masking routine, in the format of projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}.
    predefined_expression str
    A predefined masking expression. Possible values: SHA256 ALWAYS_NULL DEFAULT_MASKING_VALUE LAST_FOUR_CHARACTERS FIRST_FOUR_CHARACTERS EMAIL_MASK DATE_YEAR_MASK RANDOM_HASH
    routine str
    The name of the BigQuery routine that contains the custom masking routine, in the format of projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}.
    predefinedExpression String
    A predefined masking expression. Possible values: SHA256 ALWAYS_NULL DEFAULT_MASKING_VALUE LAST_FOUR_CHARACTERS FIRST_FOUR_CHARACTERS EMAIL_MASK DATE_YEAR_MASK RANDOM_HASH
    routine String
    The name of the BigQuery routine that contains the custom masking routine, in the format of projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}.

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

    When using the pulumi import command, DataPolicy can be imported using one of the formats above. For example:

    $ pulumi import gcp:bigquery/datapolicyv2DataPolicy:Datapolicyv2DataPolicy default projects/{{project}}/locations/{{location}}/dataPolicies/{{data_policy_id}}
    
    $ pulumi import gcp:bigquery/datapolicyv2DataPolicy:Datapolicyv2DataPolicy default {{project}}/{{location}}/{{data_policy_id}}
    
    $ pulumi import gcp:bigquery/datapolicyv2DataPolicy:Datapolicyv2DataPolicy default {{location}}/{{data_policy_id}}
    

    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.
    gcp logo
    Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate