1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. dataproc
  5. getClusterIamPolicy
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.dataproc.getClusterIamPolicy

Explore with Pulumi AI

Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 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",
});
Copy
import pulumi
import pulumi_gcp as gcp

policy = gcp.dataproc.get_cluster_iam_policy(cluster=cluster["name"],
    region="us-central1")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  policy:
    fn::invoke:
      function: gcp:dataproc:getClusterIamPolicy
      arguments:
        cluster: ${cluster.name}
        region: us-central1
Copy

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>
Copy
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]
Copy
func GetClusterIamPolicy(ctx *Context, args *GetClusterIamPolicyArgs, opts ...InvokeOption) (*GetClusterIamPolicyResult, error)
func GetClusterIamPolicyOutput(ctx *Context, args *GetClusterIamPolicyOutputArgs, opts ...InvokeOption) GetClusterIamPolicyResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetClusterIamPolicyResult> getClusterIamPolicy(GetClusterIamPolicyArgs args, InvokeOptions options)
public static Output<GetClusterIamPolicyResult> getClusterIamPolicy(GetClusterIamPolicyArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:dataproc/getClusterIamPolicy:getClusterIamPolicy
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Cluster
This property is required.
Changes to this property will trigger replacement.
string
The name or relative resource id of the cluster to manage IAM policies for.
Project Changes to this property will trigger replacement. string
Region Changes to this property will trigger replacement. string
Cluster
This property is required.
Changes to this property will trigger replacement.
string
The name or relative resource id of the cluster to manage IAM policies for.
Project Changes to this property will trigger replacement. string
Region Changes to this property will trigger replacement. string
cluster
This property is required.
Changes to this property will trigger replacement.
String
The name or relative resource id of the cluster to manage IAM policies for.
project Changes to this property will trigger replacement. String
region Changes to this property will trigger replacement. String
cluster
This property is required.
Changes to this property will trigger replacement.
string
The name or relative resource id of the cluster to manage IAM policies for.
project Changes to this property will trigger replacement. string
region Changes to this property will trigger replacement. string
cluster
This property is required.
Changes to this property will trigger replacement.
str
The name or relative resource id of the cluster to manage IAM policies for.
project Changes to this property will trigger replacement. str
region Changes to this property will trigger replacement. str
cluster
This property is required.
Changes to this property will trigger replacement.
String
The name or relative resource id of the cluster to manage IAM policies for.
project Changes to this property will trigger replacement. String
region Changes to this property will trigger replacement. 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.
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi