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

Expose network_type field to allow dual stack networking #166

Open OzoneChris opened 8 months ago

OzoneChris commented 8 months ago

Describe the Feature

The relatively new network-type field isn't broken out, or even used in the module, which means dual stack (IPv6) networking cannot be enabled.

Expected Behavior

Optional input network_type = DUAL would create the instance in dual stack networking mode.

Use Case

I have observed odd behaviour with RDS Postgres, creating an instance (via this module) in a dual stack VPC leads to the DB getting DNS records for both IPv4 and IPv6, even though the networking mode is set to IPv4 only.

This seems to lead to certain pq libraries favouring IPv6. This fails to connect, causing a timeout. The library then tries the IPv4 address and connects. The practical demonstration of this is psql taking 2 minutes to open a connection.

By making the DB dual stack, this problem is eliminated.

Describe Ideal Solution

Optional input network_type = DUAL would create the instance in dual stack networking mode.

Alternatives Considered

Additional Context

No response