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

gcp.dataproc.getClusterIamPolicy

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

    example

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const policy = gcp.dataproc.getClusterIamPolicy({
        cluster: cluster.name,
        region: "us-central1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.dataproc.get_cluster_iam_policy(cluster=cluster["name"],
        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.GetClusterIamPolicy(ctx, &dataproc.GetClusterIamPolicyArgs{
    			Cluster: cluster.Name,
    			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.GetClusterIamPolicy.Invoke(new()
        {
            Cluster = cluster.Name,
            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.GetClusterIamPolicyArgs;
    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.getClusterIamPolicy(GetClusterIamPolicyArgs.builder()
                .cluster(cluster.name())
                .region("us-central1")
                .build());
    
        }
    }
    
    variables:
      policy:
        fn::invoke:
          Function: gcp:dataproc:getClusterIamPolicy
          Arguments:
            cluster: ${cluster.name}
            region: us-central1
    

    Using getClusterIamPolicy

    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 getClusterIamPolicy(args: GetClusterIamPolicyArgs, opts?: InvokeOptions): Promise<GetClusterIamPolicyResult>
    function getClusterIamPolicyOutput(args: GetClusterIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetClusterIamPolicyResult>
    def get_cluster_iam_policy(cluster: Optional[str] = None,
                               project: Optional[str] = None,
                               region: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetClusterIamPolicyResult
    def get_cluster_iam_policy_output(cluster: Optional[pulumi.Input[str]] = None,
                               project: Optional[pulumi.Input[str]] = None,
                               region: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetClusterIamPolicyResult]
    func GetClusterIamPolicy(ctx *Context, args *GetClusterIamPolicyArgs, opts ...InvokeOption) (*GetClusterIamPolicyResult, error)
    func GetClusterIamPolicyOutput(ctx *Context, args *GetClusterIamPolicyOutputArgs, opts ...InvokeOption) GetClusterIamPolicyResultOutput

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

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

    The following arguments are supported:

    Cluster string
    The name or relative resource id of the cluster to manage IAM policies for.
    Project string
    Region string
    Cluster string
    The name or relative resource id of the cluster to manage IAM policies for.
    Project string
    Region string
    cluster String
    The name or relative resource id of the cluster to manage IAM policies for.
    project String
    region String
    cluster string
    The name or relative resource id of the cluster to manage IAM policies for.
    project string
    region string
    cluster str
    The name or relative resource id of the cluster to manage IAM policies for.
    project str
    region str
    cluster String
    The name or relative resource id of the cluster to manage IAM policies for.
    project String
    region String

    getClusterIamPolicy Result

    The following output properties are available:

    Cluster string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyData string
    (Computed) The policy data
    Project string
    Region string
    Cluster string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyData string
    (Computed) The policy data
    Project string
    Region string
    cluster String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    policyData String
    (Computed) The policy data
    project String
    region String
    cluster string
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    policyData string
    (Computed) The policy data
    project string
    region string
    cluster str
    etag str
    (Computed) The etag of the IAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    policy_data str
    (Computed) The policy data
    project str
    region str
    cluster String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    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