cloudposse / terraform-aws-rds

Terraform module to provision AWS RDS instances
https://cloudposse.com/accelerate
Apache License 2.0
153 stars 180 forks source link

Add support for the availability_zone option #93

Closed simonsparks closed 3 years ago

simonsparks commented 3 years ago

Describe the Feature

The aws_db_instance resource supports an availability_zone option for deployment to a single, explicitly named availability zone. It would be useful to expose that feature through this module.

Expected Behavior

Setting availability_zone = "eu-west-1a", for example, would deploy an RDS instance in just that availability zone. Setting multi_az = true would override the availability_zone setting and distribute the deployment across many availability zones as usual.

Use Case

Small scale deployments, for example POC experiments using free tier AWS resources, may not require the resilience of a multi-datacenter deployment and would incur unnecessary cost. Being able to use this module with minimal resources initially, and scale up later when required, would be useful.

Describe Ideal Solution

Expose the aws_db_instance's availability_zone option as an option on this module but ignore any value set for it if this module's multi_az option is set to true.

Alternatives Considered

Not using this module for small-scale deployments and refactoring the infrastructure later when there is demand for a larger scale deployment. This approach however requires more maintenance than the configuration option described here.

aknysh commented 3 years ago

please see comment here https://github.com/cloudposse/terraform-aws-rds/pull/108#issuecomment-799809878