1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. spanner
  5. getDatabaseIamPolicy
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.spanner.getDatabaseIamPolicy

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    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:

    Database string
    The name of the Spanner database.
    Instance string
    The name of the Spanner instance the database belongs to.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Database string
    The name of the Spanner database.
    Instance string
    The name of the Spanner instance the database belongs to.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    database String
    The name of the Spanner database.
    instance String
    The name of the Spanner instance the database belongs to.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    database string
    The name of the Spanner database.
    instance string
    The name of the Spanner instance the database belongs to.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    database str
    The name of the Spanner database.
    instance str
    The name of the Spanner instance the database belongs to.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    database String
    The name of the Spanner database.
    instance String
    The name of the Spanner instance the database belongs to.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    getDatabaseIamPolicy Result

    The following output properties are available:

    Database string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Instance string
    PolicyData string
    (Computed) The policy data
    Project string
    Database string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Instance string
    PolicyData string
    (Computed) The policy data
    Project string
    database String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    instance String
    policyData String
    (Computed) The policy data
    project String
    database string
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    instance string
    policyData string
    (Computed) The policy data
    project string
    database str
    etag str
    (Computed) The etag of the IAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    instance str
    policy_data str
    (Computed) The policy data
    project str
    database String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    instance String
    policyData String
    (Computed) The policy data
    project 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.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi