cloudposse / terraform-aws-rds

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

Add support for replicate_source_db variable #113

Closed adamantike closed 3 years ago

adamantike commented 3 years ago

Describe the Feature

Currently, this module cannot be used to create a read replica, as the replicate_source_db variable is not exposed. cloudposse/terraform-aws-rds-replica seems to be the alternative, but hasn't received any updates in over two years.

Use Case

Using this same module both for creating a RDS primary database, and its read replicas.

Describe Ideal Solution

Add the replicate_source_db variable in this module, and consider if there are variables that only must be provided to the aws_db_instance resource when this option is used.

Alternatives Considered

cloudposse/terraform-aws-rds-replica seems to be the alternative module provided by CloudPosse, but hasn't received any updates in over two years.

nitrocode commented 3 years ago

@adamantike have you been able to use the other module to create a read replica ?

If we add replicate_source_db variable to this module (and other inputs when this is used), would that not render the other module obsolete ?

adamantike commented 3 years ago

@nitrocode, I think it will! However, that module hasn't been updated in more than two years, so it makes sense to either update it with all the same feature this module currently provides (plus, support for newer Terraform versions), or centralize both functionalities here.

As stated in aws_db_instance docs:

NOTE: Removing the replicate_source_db attribute from an existing RDS Replicate database managed by Terraform will promote the database to a fully standalone database.

So, promoting replicas would be simpler just by using the same module, and not requiring Terraform state reimports.