diff --git a/README.md b/README.md index b976aa7..3beabf8 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ module "example_team_rds" { is-production = "false" environment-name = "development" infrastructure-support = "example-team@digtal.justice.gov.uk" + rds_family = "postgres10" providers = { # This can be either "aws.london" or "aws.ireland: @@ -62,6 +63,8 @@ For more details, be sure to read [this example](example/rds.tf) | force_ssl | Enforce SSL connections | boolean | `false` | no | | snapshot_identifier | Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console. | string | | no | | providers | provider (and region) creating the resources | arrays of string | default provider | no | +| rds_family | rds configuration version | string | `postgres10` | no | + ### Tags diff --git a/example/rds.tf b/example/rds.tf index 3eadf08..f8713c3 100644 --- a/example/rds.tf +++ b/example/rds.tf @@ -15,17 +15,23 @@ variable "cluster_state_bucket" {} * */ module "example_team_rds" { - source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=4.3" + source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=4.5" cluster_name = "${var.cluster_name}" cluster_state_bucket = "${var.cluster_state_bucket}" team_name = "example-repo" business-unit = "example-bu" application = "exampleapp" is-production = "false" + # change the postgres version as you see fit. + db_engine_version = "10" environment-name = "development" infrastructure-support = "example-team@digtal.justice.gov.uk" force_ssl = "true" + # rds_family should be one of: postgres9.4, postgres9.5, postgres9.6, postgres10, postgres11 + # Pick the one that defines the postgres version the best + rds_family = "postgres10" + # use "allow_major_version_upgrade" when upgrading the major version of an engine allow_major_version_upgrade = "true" diff --git a/main.tf b/main.tf index 226db5a..99d6be3 100644 --- a/main.tf +++ b/main.tf @@ -122,7 +122,7 @@ resource "aws_db_instance" "rds" { resource "aws_db_parameter_group" "custom_parameters" { name = "${local.identifier}" - family = "postgres10" + family = "${var.rds_family}" parameter { name = "rds.force_ssl" diff --git a/variables.tf b/variables.tf index 2eee9ec..16d6a90 100644 --- a/variables.tf +++ b/variables.tf @@ -75,8 +75,7 @@ variable "force_ssl" { default = "false" } -#Deprecated from v3.2 -variable "aws_region" { - description = "Region into which the resource will be created." - default = "eu-west-2" +variable "rds_family" { + description = "Maps the postgres version with the rds family, a family often covers several versions" + default = "postgres10" }