Skip to content
Terraform modules for deploying Cloud SQL (e.g. MySQL, PostgreSQL) in GCP
Branch: master
Clone or download
robmorgan Merge pull request #35 from gruntwork-io/version-bump
Bump version to a 0.12-compatible one.
Latest commit 5f896dd May 24, 2019

Maintained by GitHub tag (latest SemVer)

Cloud SQL Modules

This repo contains modules for running relational databases such as MySQL and PostgreSQL on Google Cloud Platform (GCP) using Cloud SQL.


If you want to quickly spin up a Cloud SQL database, you can run the example that is in the root of this repo. Check out postgres-private-ip example documentation for instructions.

What's in this repo

This repo has the following folder structure:

  • root: The root folder contains an example of how to deploy a private PostgreSQL instance in Cloud SQL. See postgres-private-ip for the documentation.

  • modules: This folder contains the main implementation code for this Module, broken down into multiple standalone submodules.

    The primary module is:

  • examples: This folder contains examples of how to use the submodules.

  • test: Automated tests for the submodules and examples.

What is Cloud SQL?

Cloud SQL is Google's fully-managed database service that makes it easy to set up, maintain, manage, and administer your relational databases on Google Cloud Platform. Cloud SQL automatically includes:

  • Data replication between multiple zones with automatic failover.
  • Automated and on-demand backups, and point-in-time recovery.
  • Data encryption on networks, database tables, temporary files, and backups.
  • Secure external connections with the Cloud SQL Proxy or with the SSL/TLS protocol.

You can learn more about Cloud SQL from the official documentation.

What's a Module?

A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such as a database or server cluster. Each Module is written using a combination of Terraform and scripts (mostly bash) and include automated tests, documentation, and examples. It is maintained both by the open source community and companies that provide commercial support.

Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse existing code that has been proven in production. And instead of maintaining all that infrastructure code yourself, you can leverage the work of the Module community to pick up infrastructure improvements through a version number bump.

Who maintains this Module?

This Module and its Submodules are maintained by Gruntwork. Read the Gruntwork Philosophy document to learn more about how Gruntwork builds production grade infrastructure code. If you are looking for help or commercial support, send an email to

Gruntwork can help with:

  • Setup, customization, and support for this Module.
  • Modules and submodules for other types of infrastructure, such as VPCs, Docker clusters, databases, and continuous integration.
  • Modules and Submodules that meet compliance requirements, such as HIPAA.
  • Consulting & Training on GCP, AWS, Terraform, and DevOps.

How do I contribute to this Module?

Contributions are very welcome! Check out the Contribution Guidelines for instructions.

How is this Module versioned?

This Module follows the principles of Semantic Versioning. You can find each new release, along with the changelog, in the Releases Page.

During initial development, the major version will be 0 (e.g., 0.x.y), which indicates the code does not yet have a stable API. Once we hit 1.0.0, we will make every effort to maintain a backwards compatible API and use the MAJOR, MINOR, and PATCH versions on each release to indicate any incompatibilities.


Please see LICENSE for how the code in this repo is licensed.

Copyright © 2019 Gruntwork, Inc.

You can’t perform that action at this time.