1. Packages
  2. Packages
  3. Google Cloud (GCP) Classic
  4. API Docs
  5. bigquery
  6. getRoutineIamPolicy
Viewing docs for Google Cloud v9.30.0
published on Monday, Jul 13, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.30.0
published on Monday, Jul 13, 2026 by Pulumi

    Retrieves the current IAM policy data for routine

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const policy = gcp.bigquery.getRoutineIamPolicy({
        project: sproc.project,
        datasetId: sproc.datasetId,
        routineId: sproc.routineId,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.bigquery.get_routine_iam_policy(project=sproc["project"],
        dataset_id=sproc["datasetId"],
        routine_id=sproc["routineId"])
    
    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.LookupRoutineIamPolicy(ctx, &bigquery.LookupRoutineIamPolicyArgs{
    			Project:   pulumi.StringRef(sproc.Project),
    			DatasetId: sproc.DatasetId,
    			RoutineId: sproc.RoutineId,
    		}, 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.GetRoutineIamPolicy.Invoke(new()
        {
            Project = sproc.Project,
            DatasetId = sproc.DatasetId,
            RoutineId = sproc.RoutineId,
        });
    
    });
    
    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.GetRoutineIamPolicyArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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.getRoutineIamPolicy(GetRoutineIamPolicyArgs.builder()
                .project(sproc.project())
                .datasetId(sproc.datasetId())
                .routineId(sproc.routineId())
                .build());
    
        }
    }
    
    variables:
      policy:
        fn::invoke:
          function: gcp:bigquery:getRoutineIamPolicy
          arguments:
            project: ${sproc.project}
            datasetId: ${sproc.datasetId}
            routineId: ${sproc.routineId}
    
    pulumi {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    data "gcp_bigquery_getroutineiampolicy" "policy" {
      project    = sproc.project
      dataset_id = sproc.datasetId
      routine_id = sproc.routineId
    }
    

    Using getRoutineIamPolicy

    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 getRoutineIamPolicy(args: GetRoutineIamPolicyArgs, opts?: InvokeOptions): Promise<GetRoutineIamPolicyResult>
    function getRoutineIamPolicyOutput(args: GetRoutineIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetRoutineIamPolicyResult>
    def get_routine_iam_policy(dataset_id: Optional[str] = None,
                               project: Optional[str] = None,
                               routine_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetRoutineIamPolicyResult
    def get_routine_iam_policy_output(dataset_id: pulumi.Input[Optional[str]] = None,
                               project: pulumi.Input[Optional[str]] = None,
                               routine_id: pulumi.Input[Optional[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetRoutineIamPolicyResult]
    func LookupRoutineIamPolicy(ctx *Context, args *LookupRoutineIamPolicyArgs, opts ...InvokeOption) (*LookupRoutineIamPolicyResult, error)
    func LookupRoutineIamPolicyOutput(ctx *Context, args *LookupRoutineIamPolicyOutputArgs, opts ...InvokeOption) LookupRoutineIamPolicyResultOutput

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

    public static class GetRoutineIamPolicy 
    {
        public static Task<GetRoutineIamPolicyResult> InvokeAsync(GetRoutineIamPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetRoutineIamPolicyResult> Invoke(GetRoutineIamPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRoutineIamPolicyResult> getRoutineIamPolicy(GetRoutineIamPolicyArgs args, InvokeOptions options)
    public static Output<GetRoutineIamPolicyResult> getRoutineIamPolicy(GetRoutineIamPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:bigquery/getRoutineIamPolicy:getRoutineIamPolicy
      arguments:
        # arguments dictionary
    data "gcp_bigquery_getroutineiampolicy" "name" {
        # arguments
    }

    The following arguments are supported:

    DatasetId string
    Used to find the parent resource to bind the IAM policy to
    RoutineId string
    Used to find the parent resource to bind the IAM policy to
    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.
    DatasetId string
    Used to find the parent resource to bind the IAM policy to
    RoutineId string
    Used to find the parent resource to bind the IAM policy to
    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.
    dataset_id string
    Used to find the parent resource to bind the IAM policy to
    routine_id string
    Used to find the parent resource to bind the IAM policy to
    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.
    datasetId String
    Used to find the parent resource to bind the IAM policy to
    routineId String
    Used to find the parent resource to bind the IAM policy to
    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.
    datasetId string
    Used to find the parent resource to bind the IAM policy to
    routineId string
    Used to find the parent resource to bind the IAM policy to
    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.
    dataset_id str
    Used to find the parent resource to bind the IAM policy to
    routine_id str
    Used to find the parent resource to bind the IAM policy to
    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.
    datasetId String
    Used to find the parent resource to bind the IAM policy to
    routineId String
    Used to find the parent resource to bind the IAM policy to
    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.

    getRoutineIamPolicy Result

    The following output properties are available:

    DatasetId string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyData string
    (Required only by gcp.bigquery.RoutineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    Project string
    RoutineId string
    DatasetId string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyData string
    (Required only by gcp.bigquery.RoutineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    Project string
    RoutineId string
    dataset_id string
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    policy_data string
    (Required only by gcp.bigquery.RoutineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project string
    routine_id string
    datasetId String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    policyData String
    (Required only by gcp.bigquery.RoutineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project String
    routineId String
    datasetId string
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    policyData string
    (Required only by gcp.bigquery.RoutineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project string
    routineId string
    dataset_id str
    etag str
    (Computed) The etag of the IAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    policy_data str
    (Required only by gcp.bigquery.RoutineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project str
    routine_id str
    datasetId String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    policyData String
    (Required only by gcp.bigquery.RoutineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project String
    routineId 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
    Viewing docs for Google Cloud v9.30.0
    published on Monday, Jul 13, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial