Skip to content

Commit fe43ed0

Browse files
committed
fix db parameter group family
1 parent 97e9baa commit fe43ed0

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Create and manage an RDS PostgreSQL instance. Includes the ability to manage the
4949
| monitoring\_role\_arn | Enhanced Monitoring ARN (blank to omit) | `string` | `null` | no |
5050
| multi\_az | whether to make database multi-az | `bool` | `true` | no |
5151
| name | common name for resources in this module | `string` | `"mysql-postgres"` | no |
52+
| parameter\_group\_family | Parameter Group Family. Need to make explicit for Postgres 9.x | `string` | `""` | no |
5253
| parameters | Database parameters (will create parameter group if not null) | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | <pre>[<br> {<br> "name": "client_encoding",<br> "value": "UTF8"<br> }<br>]</pre> | no |
5354
| pass\_version | Increment to force master user password change (not used if `password` is set) | `number` | `1` | no |
5455
| password | Master password (if not set, one will be generated dynamically) | `string` | `null` | no |

main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ resource "aws_db_parameter_group" "this" {
3333

3434
name_prefix = "${var.name}-param"
3535

36-
family = "postgres${var.engine_version}"
36+
family = coalesce(
37+
var.parameter_group_family,
38+
"postgres${replace(var.engine_version, "/\\.\\d+/", "")}" # strips the minor and patch digits from the version
39+
)
3740

3841
dynamic "parameter" {
3942
iterator = each

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ variable "parameters" {
136136
}))
137137
}
138138

139+
variable "parameter_group_family" {
140+
default = ""
141+
description = "Parameter Group Family. Need to make explicit for Postgres 9.x"
142+
type = string
143+
}
144+
139145
variable "performance_insights_enabled" {
140146
default = false
141147
description = "If true, performance insights will be enabled"

0 commit comments

Comments
 (0)