resource "google_spanner_instance" "banking-instance-3" {
name = "banking-instance-3"
config = "regional-us-west1"
display_name = "Banking Instance 3"
num_nodes = 2
labels = {
}
}
resource "google_spanner_database" "test-database" {
instance = google_spanner_instance.db-instance.name
name = "pets-db"
# Can't run destroy unless set to false
deletion_protection = var.deletion_protection
ddl = [
"CREATE TABLE Owners (OwnerID STRING(MAX) NOT NULL, OwnerName …",
"CREATE TABLE Pets (PetID STRING(MAX) NOT NULL, OwnerID …",
"CREATE INDEX PetsByOwnerID ON Pets(OwnerID)",
]
}