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

gcp.bigquery.getDatapolicyv2DataPolicyIamPolicy

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

    Retrieves the current IAM policy data for datapolicy

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const policy = gcp.bigquery.getDatapolicyv2DataPolicyIamPolicy({
        project: basicDataPolicy.project,
        location: basicDataPolicy.location,
        dataPolicyId: basicDataPolicy.dataPolicyId,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.bigquery.get_datapolicyv2_data_policy_iam_policy(project=basic_data_policy["project"],
        location=basic_data_policy["location"],
        data_policy_id=basic_data_policy["dataPolicyId"])
    
    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.LookupDatapolicyv2DataPolicyIamPolicy(ctx, &bigquery.LookupDatapolicyv2DataPolicyIamPolicyArgs{
    			Project:      pulumi.StringRef(basicDataPolicy.Project),
    			Location:     pulumi.StringRef(basicDataPolicy.Location),
    			DataPolicyId: basicDataPolicy.DataPolicyId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var policy = Gcp.BigQuery.GetDatapolicyv2DataPolicyIamPolicy.Invoke(new()
        {
            Project = basicDataPolicy.Project,
            Location = basicDataPolicy.Location,
            DataPolicyId = basicDataPolicy.DataPolicyId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.bigquery.BigqueryFunctions;
    import com.pulumi.gcp.bigquery.inputs.GetDatapolicyv2DataPolicyIamPolicyArgs;
    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) {
            final var policy = BigqueryFunctions.getDatapolicyv2DataPolicyIamPolicy(GetDatapolicyv2DataPolicyIamPolicyArgs.builder()
                .project(basicDataPolicy.project())
                .location(basicDataPolicy.location())
                .dataPolicyId(basicDataPolicy.dataPolicyId())
                .build());
    
        }
    }
    
    variables:
      policy:
        fn::invoke:
          function: gcp:bigquery:getDatapolicyv2DataPolicyIamPolicy
          arguments:
            project: ${basicDataPolicy.project}
            location: ${basicDataPolicy.location}
            dataPolicyId: ${basicDataPolicy.dataPolicyId}
    

    Using getDatapolicyv2DataPolicyIamPolicy

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDatapolicyv2DataPolicyIamPolicy(args: GetDatapolicyv2DataPolicyIamPolicyArgs, opts?: InvokeOptions): Promise<GetDatapolicyv2DataPolicyIamPolicyResult>
    function getDatapolicyv2DataPolicyIamPolicyOutput(args: GetDatapolicyv2DataPolicyIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetDatapolicyv2DataPolicyIamPolicyResult>
    def get_datapolicyv2_data_policy_iam_policy(data_policy_id: Optional[str] = None,
                                                location: Optional[str] = None,
                                                project: Optional[str] = None,
                                                opts: Optional[InvokeOptions] = None) -> GetDatapolicyv2DataPolicyIamPolicyResult
    def get_datapolicyv2_data_policy_iam_policy_output(data_policy_id: Optional[pulumi.Input[str]] = None,
                                                location: Optional[pulumi.Input[str]] = None,
                                                project: Optional[pulumi.Input[str]] = None,
                                                opts: Optional[InvokeOptions] = None) -> Output[GetDatapolicyv2DataPolicyIamPolicyResult]
    func LookupDatapolicyv2DataPolicyIamPolicy(ctx *Context, args *LookupDatapolicyv2DataPolicyIamPolicyArgs, opts ...InvokeOption) (*LookupDatapolicyv2DataPolicyIamPolicyResult, error)
    func LookupDatapolicyv2DataPolicyIamPolicyOutput(ctx *Context, args *LookupDatapolicyv2DataPolicyIamPolicyOutputArgs, opts ...InvokeOption) LookupDatapolicyv2DataPolicyIamPolicyResultOutput

    > Note: This function is named LookupDatapolicyv2DataPolicyIamPolicy in the Go SDK.

    public static class GetDatapolicyv2DataPolicyIamPolicy 
    {
        public static Task<GetDatapolicyv2DataPolicyIamPolicyResult> InvokeAsync(GetDatapolicyv2DataPolicyIamPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetDatapolicyv2DataPolicyIamPolicyResult> Invoke(GetDatapolicyv2DataPolicyIamPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDatapolicyv2DataPolicyIamPolicyResult> getDatapolicyv2DataPolicyIamPolicy(GetDatapolicyv2DataPolicyIamPolicyArgs args, InvokeOptions options)
    public static Output<GetDatapolicyv2DataPolicyIamPolicyResult> getDatapolicyv2DataPolicyIamPolicy(GetDatapolicyv2DataPolicyIamPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:bigquery/getDatapolicyv2DataPolicyIamPolicy:getDatapolicyv2DataPolicyIamPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DataPolicyId string
    Used to find the parent resource to bind the IAM policy to
    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. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    DataPolicyId string
    Used to find the parent resource to bind the IAM policy to
    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. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    dataPolicyId String
    Used to find the parent resource to bind the IAM policy to
    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. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    dataPolicyId string
    Used to find the parent resource to bind the IAM policy to
    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. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    data_policy_id str
    Used to find the parent resource to bind the IAM policy to
    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. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    dataPolicyId String
    Used to find the parent resource to bind the IAM policy to
    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. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

    getDatapolicyv2DataPolicyIamPolicy Result

    The following output properties are available:

    DataPolicyId string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    PolicyData string
    (Required only by gcp.bigquery.Datapolicyv2DataPolicyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    Project string
    DataPolicyId string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    PolicyData string
    (Required only by gcp.bigquery.Datapolicyv2DataPolicyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    Project string
    dataPolicyId String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    policyData String
    (Required only by gcp.bigquery.Datapolicyv2DataPolicyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project String
    dataPolicyId string
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    policyData string
    (Required only by gcp.bigquery.Datapolicyv2DataPolicyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project string
    data_policy_id str
    etag str
    (Computed) The etag of the IAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    policy_data str
    (Required only by gcp.bigquery.Datapolicyv2DataPolicyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project str
    dataPolicyId String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    policyData String
    (Required only by gcp.bigquery.Datapolicyv2DataPolicyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project String

    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