Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.dataproc.getClusterIamPolicy
Explore with Pulumi AI
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:
getClusterIamPolicy Result
The following output properties are available:
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.