Show / Hide Table of Contents

Class Database

A Cloud Spanner Database which is hosted on a Spanner instance.

To get more information about Database, see:

  • API documentation
  • How-to Guides
  • Official Documentation

Example Usage - Spanner Database Basic

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var main = new Gcp.Spanner.Instance("main", new Gcp.Spanner.InstanceArgs
    {
        Config = "regional-europe-west1",
        DisplayName = "main-instance",
    });
    var database = new Gcp.Spanner.Database("database", new Gcp.Spanner.DatabaseArgs
    {
        Instance = main.Name,
        Ddls = 
        {
            "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
            "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Database
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.Spanner
Assembly: Pulumi.Gcp.dll
Syntax
public class Database : CustomResource

Constructors

View Source

Database(String, DatabaseArgs, CustomResourceOptions)

Create a Database resource with the given unique name, arguments, and options.

Declaration
public Database(string name, DatabaseArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

DatabaseArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Ddls

An optional list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created.

Declaration
public Output<ImmutableArray<string>> Ddls { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Instance

The instance to create the database on.

Declaration
public Output<string> Instance { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

A unique identifier for the database, which cannot be changed after the instance is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Project

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Declaration
public Output<string> Project { get; }
Property Value
Type Description
Output<System.String>
View Source

State

An explanation of the status of the database.

Declaration
public Output<string> State { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, DatabaseState, CustomResourceOptions)

Get an existing Database resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Database Get(string name, Input<string> id, DatabaseState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

DatabaseState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Database
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.