Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 3.64 KB

File metadata and controls

78 lines (60 loc) · 3.64 KB

Spanner Module

This module handles Spanner instance and database creation in Cluster Toolkit.

Usage

module "spanner_db" {
  source = "./modules/database/spanner"

  project_id    = var.project_id
  instance_name = "my-instance"
  databases = {
    "my-db" = {
      name = "actual-db-name"
    }
  }
}

Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Requirements

Name Version
terraform = 1.12.2
google >= 6.0

Providers

Name Version
google >= 6.0

Modules

No modules.

Resources

Name Type
google_spanner_database.db resource
google_spanner_database_iam_member.member resource
google_spanner_instance.main resource

Inputs

Name Description Type Default Required
config The name of the instance's configuration. string "regional-us-central1" no
databases A map of databases to create. Keys are logical names.
map(object({
name = string
deletion_protection = optional(bool, true)
iam_members = optional(list(object({
role = string
member = string
})), [])
}))
{} no
display_name The descriptive name for this instance as it appears in UIs. string "Spanner Instance" no
edition The edition of the Spanner instance (e.g., ENTERPRISE, ENTERPRISE_PLUS, or STANDARD). string "STANDARD" no
instance_name Name of the Spanner instance. string n/a yes
labels Labels to apply to the Spanner instance. map(string) {} no
processing_units The number of processing units allocated to this instance. number 100 no
project_id Project ID for Spanner instance. string n/a yes

Outputs

Name Description
database_ids A map from logical database name to the actual created database ID.
instance_name The name of the Spanner instance.