IaC Bazaar
Google CloudLive-tested

Cloud Spanner Instance & Database

A regional Cloud Spanner instance at the smallest billable size (100 processing units) plus a database with optional starter schema, drop protection, and Terraform deletion protection on.

terraformGoogle Cloud#gcp
gcp-spannerterraform v1.7

Verification

Live-tested

Really deployed, verified, idempotent and destroyed in a cloud sandbox.

Conformance

  • Static validation (fmt · validate · tflint)
  • Security scan (Checkov)
  • Plan tests (mocked: validation rules · outputs)

Provenance

  • SHA-256 checksum
  • Signature (pending)

Functional

  • Live-tested — applied, verified, destroyed

Last verified 2026-06-30 · how we verify

Documentation

gcp-spanner

Cloud Spanner — a regional instance at the smallest billable size (100 processing units, 1/10th of a node) plus a database with optional starter schema. Works with Terraform and OpenTofu (>= 1.6), Google provider >= 7.0, < 8.0.

Cost-aware, secure defaults:

  • processing_units = 100 (the floor) — sub-node sizing, not num_nodes
  • edition = "STANDARD" (cheapest edition that fits 100 PU)
  • Database deletion_protection = true
  • enable_drop_protection exposed (off by default; turn on for prod databases)

Protection knobs (the two resources differ)

ResourceNative protectionThis module exposes
google_spanner_instanceno deletion_protectionforce_destroy (clears backups on destroy) + default_backup_schedule_type
google_spanner_databasedeletion_protection (bool)deletion_protection + enable_drop_protection

The instance keeps the provider default deletion_policy (DELETE), so destroy removes it; force_destroy = true ensures backups never block that.

Requirements

  • Terraform or OpenTofu >= 1.6
  • hashicorp/google >= 7.0, < 8.0
  • APIs: spanner.googleapis.com

Verification

Static-validated (fmt, validate, tflint). Live apply/destroy testing pending cloud sandbox availability — see catalog status.

License

Commercial — IaC Bazaar EULA. © IaC Bazaar. Original work (not derived from a third-party module).

Usage code & full reference unlock after purchase

The complete copy-paste usage, the full input/output reference, and operational notes ship with your licence — shown here and bundled in the download.

  • Usage
  • Inputs
  • Outputs
  • Notes