com.pulumi.gcp.datafusion.kotlin.DatafusionFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.datafusion.kotlin
import com.pulumi.gcp.datafusion.DatafusionFunctions.getInstanceIamPolicyPlain
import com.pulumi.gcp.datafusion.kotlin.inputs.GetInstanceIamPolicyPlainArgs
import com.pulumi.gcp.datafusion.kotlin.inputs.GetInstanceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.datafusion.kotlin.outputs.GetInstanceIamPolicyResult
import com.pulumi.gcp.datafusion.kotlin.outputs.GetInstanceIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object DatafusionFunctions {
/**
* Retrieves the current IAM policy data for instance
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.datafusion.getInstanceIamPolicy({
* project: basicInstance.project,
* region: basicInstance.region,
* name: basicInstance.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.datafusion.get_instance_iam_policy(project=basic_instance["project"],
* region=basic_instance["region"],
* name=basic_instance["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.DataFusion.GetInstanceIamPolicy.Invoke(new()
* {
* Project = basicInstance.Project,
* Region = basicInstance.Region,
* Name = basicInstance.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datafusion"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := datafusion.GetInstanceIamPolicy(ctx, &datafusion.GetInstanceIamPolicyArgs{
* Project: pulumi.StringRef(basicInstance.Project),
* Region: pulumi.StringRef(basicInstance.Region),
* Name: basicInstance.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.datafusion.DatafusionFunctions;
* import com.pulumi.gcp.datafusion.inputs.GetInstanceIamPolicyArgs;
* 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 = DatafusionFunctions.getInstanceIamPolicy(GetInstanceIamPolicyArgs.builder()
* .project(basicInstance.project())
* .region(basicInstance.region())
* .name(basicInstance.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:datafusion:getInstanceIamPolicy
* Arguments:
* project: ${basicInstance.project}
* region: ${basicInstance.region}
* name: ${basicInstance.name}
* ```
*
* @param argument A collection of arguments for invoking getInstanceIamPolicy.
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(argument: GetInstanceIamPolicyPlainArgs): GetInstanceIamPolicyResult = toKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
/**
* @see [getInstanceIamPolicy].
* @param name Used to find the parent resource to bind the IAM policy to
* @param project 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.
* @param region The region of the Data Fusion instance.
* Used to find the parent resource to bind the IAM policy to. If not specified,
* the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no
* region is specified, it is taken from the provider configuration.
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(
name: String,
project: String? = null,
region: String? = null,
): GetInstanceIamPolicyResult {
val argument = GetInstanceIamPolicyPlainArgs(
name = name,
project = project,
region = region,
)
return toKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getInstanceIamPolicy].
* @param argument Builder for [com.pulumi.gcp.datafusion.kotlin.inputs.GetInstanceIamPolicyPlainArgs].
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(argument: suspend GetInstanceIamPolicyPlainArgsBuilder.() -> Unit): GetInstanceIamPolicyResult {
val builder = GetInstanceIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getInstanceIamPolicyPlain(builtArgument.toJava()).await())
}
}