This repo contains modules for running relational databases such as MySQL and PostgreSQL on Google Cloud Platform (GCP) using Cloud SQL.
- Deploy a fully-managed relational database
- Supports MySQL and PostgreSQL
- Optional failover instances
- Optional read replicas
This repo is a part of the Gruntwork Infrastructure as Code Library, a collection of reusable, battle-tested, production ready infrastructure code. If you’ve never used the Infrastructure as Code Library before, make sure to read How to use the Gruntwork Infrastructure as Code Library!
- What is Cloud SQL
- Cloud SQL documentation
- Designing Data Intensive Applications: the best book we’ve found for understanding data systems, including relational databases, NoSQL, replication, sharding, consistency, and so on.
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:
- cloud-sql: Deploy a Cloud SQL MySQL or PostgreSQL database.
-
examples: This folder contains examples of how to use the submodules.
-
test: Automated tests for the submodules and examples.
If you just want to try this repo out for experimenting and learning, check out the following resources:
- examples folder: The
examples
folder contains sample code optimized for learning, experimenting, and testing (but not production usage).
If you want to deploy this repo in production, check out the following resources:
- cloud-sql module in the GCP Reference Architecture: Production-ready sample code from the GCP Reference Architecture. Note that the repository is private and accessible only with Gruntwork subscription. To get access, subscribe now or contact us at [email protected] for more information.
- How to connect to a Cloud SQL instance
- How to configure high availability
- How to secure the database instance
- How to scale the database
If you need help with this repo or anything else related to infrastructure or DevOps, Gruntwork offers Commercial Support via Slack, email, and phone/video. If you’re already a Gruntwork customer, hop on Slack and ask away! If not, subscribe now. If you’re not sure, feel free to email us at [email protected].
Contributions to this repo are very welcome and appreciated! If you find a bug or want to add a new feature or even contribute an entirely new module, we are very happy to accept pull requests, provide feedback, and run your changes through our automated test suite.
Please see Contributing to the Gruntwork Infrastructure as Code Library for instructions.
Please see LICENSE for details on how the code in this repo is licensed.
Copyright © 2019 Gruntwork, Inc.