db_default instance using AWS-managed groups is also included.
Option groups are not supported for PostgreSQL. The module automatically skips option group creation when the engine is
postgres. Any value set for option_group_name will be ignored.Configuration
main.tf
PostgreSQL-specific configuration
No option groups
PostgreSQL on RDS does not support option groups. The module skips option group creation entirely whenengine = "postgres", regardless of what is set for create_db_option_group or option_group_name.
Log exports
PostgreSQL supports two CloudWatch log export types:
These differ from MySQL which uses
general, slowquery, audit, and error log types.
Parameter group configuration
The example sets two parameters:autovacuum = 1— ensures autovacuum is enabled (it is on by default, but making it explicit prevents accidental disabling)client_encoding = utf8— sets the client-side character encoding
Reserved usernames
Managed password rotation
The example configures Secrets Manager to rotate the master user password on a 15-day schedule usingmanage_master_user_password_rotation = true with master_user_password_rotation_schedule_expression = "rate(15 days)". Setting master_user_password_rotate_immediately = false prevents an immediate rotation on first apply.
Automated backup replication
The example uses thedb_instance_automated_backups_replication submodule to replicate automated backups to eu-central-1. A KMS key is created in the target region to encrypt the replicated backups.
Engine lifecycle support
engine_lifecycle_support = "open-source-rds-extended-support-disabled" opts out of RDS Extended Support (which incurs additional charges for end-of-life engine versions). This is appropriate for PostgreSQL 17, which is current. Remove this setting or use "open-source-rds-extended-support" if you need extended support for older engine versions.