This module handles Spanner instance and database creation in Cluster Toolkit.
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.
| Name | Version |
|---|---|
| terraform | = 1.12.2 |
| >= 6.0 |
| Name | Version |
|---|---|
| >= 6.0 |
No modules.
| Name | Type |
|---|---|
| google_spanner_database.db | resource |
| google_spanner_database_iam_member.member | resource |
| google_spanner_instance.main | resource |
| 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({ |
{} |
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 |
| Name | Description |
|---|---|
| database_ids | A map from logical database name to the actual created database ID. |
| instance_name | The name of the Spanner instance. |