Skip to main content
A DB parameter group acts as a container for engine configuration values that apply to all instances associated with that group. Common use cases include setting character encodings, adjusting connection limits, tuning autovacuum behavior in PostgreSQL, and enabling slow query logs. By default, this module creates a parameter group automatically. You can also reference an existing parameter group or fall back to the AWS-managed default.

Variables

The parameters object

Each entry in parameters accepts the following fields, as defined in variables.tf:
When apply_method is omitted, AWS uses the default for that parameter (usually immediate for dynamic parameters and pending-reboot for static ones).

Usage patterns

The module creates a parameter group by default. Provide family and parameters to configure it:
To use an exact name instead of a generated prefix:
To use a prefix (the default):
AWS will create a parameter group named something like prod-instance-mysql-8.0-20240101120000000000000001.

PostgreSQL example

For PostgreSQL, the family format is postgres{major_version}:

Blue/green deployment parameter example

Some parameters require apply_method = "pending-reboot". For example, enabling logical replication in PostgreSQL for blue/green deployments:

Family naming reference

Set parameter_group_skip_destroy = true in production to prevent accidental deletion of a parameter group that is associated with multiple instances. The parameter group will be removed from Terraform state but remain in AWS.