Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.spanner.getDatabaseIamPolicy
Explore with Pulumi AI
Retrieves the current IAM policy data for a Spanner database.
example
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const foo = gcp.spanner.getDatabaseIamPolicy({
project: database.project,
database: database.name,
instance: database.instance,
});
import pulumi
import pulumi_gcp as gcp
foo = gcp.spanner.get_database_iam_policy(project=database["project"],
database=database["name"],
instance=database["instance"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/spanner"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := spanner.GetDatabaseIamPolicy(ctx, &spanner.GetDatabaseIamPolicyArgs{
Project: pulumi.StringRef(database.Project),
Database: database.Name,
Instance: database.Instance,
}, 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 foo = Gcp.Spanner.GetDatabaseIamPolicy.Invoke(new()
{
Project = database.Project,
Database = database.Name,
Instance = database.Instance,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.spanner.SpannerFunctions;
import com.pulumi.gcp.spanner.inputs.GetDatabaseIamPolicyArgs;
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 foo = SpannerFunctions.getDatabaseIamPolicy(GetDatabaseIamPolicyArgs.builder()
.project(database.project())
.database(database.name())
.instance(database.instance())
.build());
}
}
variables:
foo:
fn::invoke:
Function: gcp:spanner:getDatabaseIamPolicy
Arguments:
project: ${database.project}
database: ${database.name}
instance: ${database.instance}
Using getDatabaseIamPolicy
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 getDatabaseIamPolicy(args: GetDatabaseIamPolicyArgs, opts?: InvokeOptions): Promise<GetDatabaseIamPolicyResult>
function getDatabaseIamPolicyOutput(args: GetDatabaseIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetDatabaseIamPolicyResult>
def get_database_iam_policy(database: Optional[str] = None,
instance: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatabaseIamPolicyResult
def get_database_iam_policy_output(database: Optional[pulumi.Input[str]] = None,
instance: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseIamPolicyResult]
func GetDatabaseIamPolicy(ctx *Context, args *GetDatabaseIamPolicyArgs, opts ...InvokeOption) (*GetDatabaseIamPolicyResult, error)
func GetDatabaseIamPolicyOutput(ctx *Context, args *GetDatabaseIamPolicyOutputArgs, opts ...InvokeOption) GetDatabaseIamPolicyResultOutput
> Note: This function is named GetDatabaseIamPolicy
in the Go SDK.
public static class GetDatabaseIamPolicy
{
public static Task<GetDatabaseIamPolicyResult> InvokeAsync(GetDatabaseIamPolicyArgs args, InvokeOptions? opts = null)
public static Output<GetDatabaseIamPolicyResult> Invoke(GetDatabaseIamPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatabaseIamPolicyResult> getDatabaseIamPolicy(GetDatabaseIamPolicyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:spanner/getDatabaseIamPolicy:getDatabaseIamPolicy
arguments:
# arguments dictionary
The following arguments are supported:
getDatabaseIamPolicy 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.