com.pulumi.gcp.bigtable.kotlin.BigtableFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.bigtable.kotlin
import com.pulumi.gcp.bigtable.BigtableFunctions.getInstanceIamPolicyPlain
import com.pulumi.gcp.bigtable.BigtableFunctions.getTableIamPolicyPlain
import com.pulumi.gcp.bigtable.kotlin.inputs.GetInstanceIamPolicyPlainArgs
import com.pulumi.gcp.bigtable.kotlin.inputs.GetInstanceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.bigtable.kotlin.inputs.GetTableIamPolicyPlainArgs
import com.pulumi.gcp.bigtable.kotlin.inputs.GetTableIamPolicyPlainArgsBuilder
import com.pulumi.gcp.bigtable.kotlin.outputs.GetInstanceIamPolicyResult
import com.pulumi.gcp.bigtable.kotlin.outputs.GetTableIamPolicyResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.bigtable.kotlin.outputs.GetInstanceIamPolicyResult.Companion.toKotlin as getInstanceIamPolicyResultToKotlin
import com.pulumi.gcp.bigtable.kotlin.outputs.GetTableIamPolicyResult.Companion.toKotlin as getTableIamPolicyResultToKotlin
public object BigtableFunctions {
/**
* Retrieves the current IAM policy data for a Bigtable instance.
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.bigtable.getInstanceIamPolicy({
* instance: instance.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.bigtable.get_instance_iam_policy(instance=instance["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.BigTable.GetInstanceIamPolicy.Invoke(new()
* {
* Instance = instance.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigtable"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := bigtable.LookupInstanceIamPolicy(ctx, &bigtable.LookupInstanceIamPolicyArgs{
* Instance: instance.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.bigtable.BigtableFunctions;
* import com.pulumi.gcp.bigtable.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 = BigtableFunctions.getInstanceIamPolicy(GetInstanceIamPolicyArgs.builder()
* .instance(instance.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:bigtable:getInstanceIamPolicy
* Arguments:
* instance: ${instance.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 =
getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
/**
* @see [getInstanceIamPolicy].
* @param instance The name or relative resource id of the instance to manage IAM policies for.
* @param project
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(instance: String, project: String? = null): GetInstanceIamPolicyResult {
val argument = GetInstanceIamPolicyPlainArgs(
instance = instance,
project = project,
)
return getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getInstanceIamPolicy].
* @param argument Builder for [com.pulumi.gcp.bigtable.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 getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for a Bigtable Table.
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.bigtable.getTableIamPolicy({
* instance: instance.name,
* table: table.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.bigtable.get_table_iam_policy(instance=instance["name"],
* table=table["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.BigTable.GetTableIamPolicy.Invoke(new()
* {
* Instance = instance.Name,
* Table = table.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigtable"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := bigtable.LookupTableIamPolicy(ctx, &bigtable.LookupTableIamPolicyArgs{
* Instance: instance.Name,
* Table: table.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.bigtable.BigtableFunctions;
* import com.pulumi.gcp.bigtable.inputs.GetTableIamPolicyArgs;
* 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 = BigtableFunctions.getTableIamPolicy(GetTableIamPolicyArgs.builder()
* .instance(instance.name())
* .table(table.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:bigtable:getTableIamPolicy
* Arguments:
* instance: ${instance.name}
* table: ${table.name}
* ```
*
* @param argument A collection of arguments for invoking getTableIamPolicy.
* @return A collection of values returned by getTableIamPolicy.
*/
public suspend fun getTableIamPolicy(argument: GetTableIamPolicyPlainArgs): GetTableIamPolicyResult =
getTableIamPolicyResultToKotlin(getTableIamPolicyPlain(argument.toJava()).await())
/**
* @see [getTableIamPolicy].
* @param instance The name or relative resource id of the instance that owns the table.
* @param project
* @param table The name or relative resource id of the table to manage IAM policies for.
* @return A collection of values returned by getTableIamPolicy.
*/
public suspend fun getTableIamPolicy(
instance: String,
project: String? = null,
table: String,
): GetTableIamPolicyResult {
val argument = GetTableIamPolicyPlainArgs(
instance = instance,
project = project,
table = table,
)
return getTableIamPolicyResultToKotlin(getTableIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getTableIamPolicy].
* @param argument Builder for [com.pulumi.gcp.bigtable.kotlin.inputs.GetTableIamPolicyPlainArgs].
* @return A collection of values returned by getTableIamPolicy.
*/
public suspend fun getTableIamPolicy(argument: suspend GetTableIamPolicyPlainArgsBuilder.() -> Unit): GetTableIamPolicyResult {
val builder = GetTableIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getTableIamPolicyResultToKotlin(getTableIamPolicyPlain(builtArgument.toJava()).await())
}
}