gruntwork-io / terraform-google-sql

Terraform modules for deploying Google Cloud SQL (e.g. MySQL, PostgreSQL) in GCP
https://gruntwork.io
Apache License 2.0
92 stars 103 forks source link

RDD with proposed structure and files. #1

Closed autero1 closed 5 years ago

autero1 commented 5 years ago

This PR sets up initial structure for the Cloud SQL terraform module.

autero1 commented 5 years ago

Does it support:

  1. Automatic backup / restore?
  2. Encryption over the wire (TLS) and on disk?
  3. Read replicas?
  1. Yes for backups. For restore, terraform seems to lack the capability: https://github.com/terraform-providers/terraform-provider-google/issues/2446
  2. Yes - encryption supported in flight and at rest: https://cloud.google.com/sql/docs/features
  3. Yes - both flavors, MySQL and Postgres, support one or more read replicas
autero1 commented 5 years ago
  • Will we support First Gen Instances? Or entirely Second Gen?

I would personally only support Second gen, as support for First Generation instances ends January 30, 2020. I cannot see any advantages in creating a First Gen instance knowing you'd soon have to upgrade it.

  • Will we provide a single unified module for an SQL instance

When provisioning a DB I feel everyone knows which flavor they want... Although we might have slight duplication with separate modules for PG and MySQL, I agree that the UX would be better and there would be significantly less chance for misconfiguration. One option is to make a "master" Cloud SQL module, then source that module in PG and MySQL modules, only exposing DB-specific vars for each.

brikis98 commented 5 years ago

Yes for backups. For restore, terraform seems to lack the capability: terraform-providers/terraform-provider-google#2446

Wow, that's quite a limitation. Perhaps +1 that issue to get it visibility? At the least, we should document this, as well as the other key items (encryption, replicas).

rileykarson commented 5 years ago

I think with that issue we're not sure what the Terraform config would look like; is https://www.terraform.io/docs/providers/aws/r/rds_cluster.html#s3-import-options the AWS equivalent of what you mean?

brikis98 commented 5 years ago

With RDS, each nightly snapshot has an ID. To restore your DB from such a snapshot, you specify its ID using the snapshot_id param.

rileykarson commented 5 years ago

Thanks! I'll update the issue with that context. For backups, let's track that issue for now, and we can reevaluate when we're closer to releasing this module what we can evaluate what we want to do; I can make the change if there's no updates on it otherwise by then.

brikis98 commented 5 years ago

Nice thx!

autero1 commented 5 years ago

Added module README.md (ignore the vars file...). I decided to use the cloud-sql -module as a starting point and split when needed.

robmorgan commented 5 years ago

Looks good to me, I will also vote Second Gen support only.

autero1 commented 5 years ago

The PR #11 branch was created from this one and this is now somewhat outdated.

autero1 commented 5 years ago

Closing in favor of #11