Member-only story
How to Automate the creation of Spanner instances and databases using Terraform
Cloud Spanner is a fully managed, mission-critical, relational database service that offers transactional consistency at a global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL and PostgreSQL.
To use Spanner, you must first create a Spanner instance within your Google Cloud project. This instance is an allocation of resources that is used by Spanner databases created in that instance.
Instance creation includes two important choices:
- The instance configuration
- The compute capacity.
These choices determine the location and amount of the instance’s serving and storage resources.
Terraform
Terraform is a tool for building, changing, and versioning infrastructure.
It uses configuration files to describe the components needed to run a single application or your entire infrastructure.
Using Terraform, we can Automate the creation of Spanner instances and databases
In the below video, you will learn how to
- Create instances and databases using the gcloud CLI.