1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. dataproc
  5. getJobIamPolicy
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.dataproc.getJobIamPolicy

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    Retrieves the current IAM policy data for a Dataproc job.

    example

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const policy = gcp.dataproc.getJobIamPolicy({
        jobId: pyspark.reference[0].jobId,
        region: "us-central1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.dataproc.get_job_iam_policy(job_id=pyspark["reference"][0]["jobId"],
        region="us-central1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dataproc.GetJobIamPolicy(ctx, &dataproc.GetJobIamPolicyArgs{
    			JobId:  pyspark.Reference[0].JobId,
    			Region: pulumi.StringRef("us-central1"),
    		}, 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.Dataproc.GetJobIamPolicy.Invoke(new()
        {
            JobId = pyspark.Reference[0].JobId,
            Region = "us-central1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.dataproc.DataprocFunctions;
    import com.pulumi.gcp.dataproc.inputs.GetJobIamPolicyArgs;
    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 = DataprocFunctions.getJobIamPolicy(GetJobIamPolicyArgs.builder()
                .jobId(pyspark.reference()[0].jobId())
                .region("us-central1")
                .build());
    
        }
    }
    
    variables:
      policy:
        fn::invoke:
          Function: gcp:dataproc:getJobIamPolicy
          Arguments:
            jobId: ${pyspark.reference[0].jobId}
            region: us-central1
    

    Using getJobIamPolicy

    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 getJobIamPolicy(args: GetJobIamPolicyArgs, opts?: InvokeOptions): Promise<GetJobIamPolicyResult>
    function getJobIamPolicyOutput(args: GetJobIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetJobIamPolicyResult>
    def get_job_iam_policy(job_id: Optional[str] = None,
                           project: Optional[str] = None,
                           region: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetJobIamPolicyResult
    def get_job_iam_policy_output(job_id: Optional[pulumi.Input[str]] = None,
                           project: Optional[pulumi.Input[str]] = None,
                           region: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetJobIamPolicyResult]
    func GetJobIamPolicy(ctx *Context, args *GetJobIamPolicyArgs, opts ...InvokeOption) (*GetJobIamPolicyResult, error)
    func GetJobIamPolicyOutput(ctx *Context, args *GetJobIamPolicyOutputArgs, opts ...InvokeOption) GetJobIamPolicyResultOutput

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

    public static class GetJobIamPolicy 
    {
        public static Task<GetJobIamPolicyResult> InvokeAsync(GetJobIamPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetJobIamPolicyResult> Invoke(GetJobIamPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetJobIamPolicyResult> getJobIamPolicy(GetJobIamPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:dataproc/getJobIamPolicy:getJobIamPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    JobId string
    The name or relative resource id of the job to manage IAM policies for.
    Project string
    Region string
    JobId string
    The name or relative resource id of the job to manage IAM policies for.
    Project string
    Region string
    jobId String
    The name or relative resource id of the job to manage IAM policies for.
    project String
    region String
    jobId string
    The name or relative resource id of the job to manage IAM policies for.
    project string
    region string
    job_id str
    The name or relative resource id of the job to manage IAM policies for.
    project str
    region str
    jobId String
    The name or relative resource id of the job to manage IAM policies for.
    project String
    region String

    getJobIamPolicy Result

    The following output properties are available:

    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    JobId string
    PolicyData string
    (Computed) The policy data
    Project string
    Region string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    JobId string
    PolicyData string
    (Computed) The policy data
    Project string
    Region string
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    jobId String
    policyData String
    (Computed) The policy data
    project String
    region String
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    jobId string
    policyData string
    (Computed) The policy data
    project string
    region string
    etag str
    (Computed) The etag of the IAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    job_id str
    policy_data str
    (Computed) The policy data
    project str
    region str
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    jobId String
    policyData String
    (Computed) The policy data
    project String
    region 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 Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi