Skip to content

Commit

Permalink
Merge pull request #34 from ministryofjustice/fix-rds-family
Browse files Browse the repository at this point in the history
Fix rds family
  • Loading branch information
mtrbls authored Jul 8, 2019
2 parents 952bd0f + 8062237 commit 3873852
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module "example_team_rds" {
is-production = "false"
environment-name = "development"
infrastructure-support = "[email protected]"
rds_family = "postgres10"
providers = {
# This can be either "aws.london" or "aws.ireland:
Expand Down Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion example/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"
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"

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 3 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 3873852

Please sign in to comment.