diff --git a/README.md b/README.md index 9573002..5573e0e 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ See [this example](example/rds.tf) | cluster_name | The name of the cluster (eg.: cloud-platform-live-0) | string | | yes | | cluster_state_bucket | The name of the S3 bucket holding the terraform state for the cluster | string | | yes | | db_allocated_storage | The allocated storage in gibibytes | string | `10` | no | +| db_max_allocated_storage | Total storage in gibibytes up to which this RDS will autoscale | string | `10000` | no | | db_engine | Database engine used | string | `postgres` | no | | db_engine_version | The engine version to use | string | `10.4` | no | | db_instance_class | The instance type of the RDS instance | string | `db.t2.small` | no | diff --git a/example/rds.tf b/example/rds.tf index 9489fd1..aa610b7 100644 --- a/example/rds.tf +++ b/example/rds.tf @@ -21,7 +21,7 @@ variable "cluster_state_bucket" { # Make sure you restart your pods which use this RDS secret to avoid any down time. module "example_team_rds" { - source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.11" + source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.12" cluster_name = var.cluster_name cluster_state_bucket = var.cluster_state_bucket team_name = "example-repo" diff --git a/main.tf b/main.tf index 1cf5214..fe70e3a 100644 --- a/main.tf +++ b/main.tf @@ -96,6 +96,7 @@ resource "aws_db_instance" "rds" { identifier = var.rds_name != "" ? var.rds_name : local.identifier final_snapshot_identifier = var.replicate_source_db != "" ? null : "${local.identifier}-finalsnapshot" allocated_storage = var.db_allocated_storage + max_allocated_storage = var.db_max_allocated_storage apply_immediately = true engine = var.db_engine engine_version = var.db_engine_version diff --git a/template/rds.tmpl b/template/rds.tmpl index 0f05051..cc9f61e 100644 --- a/template/rds.tmpl +++ b/template/rds.tmpl @@ -1,6 +1,6 @@ module "rds" { - source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.9" + source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.12" cluster_name = var.cluster_name cluster_state_bucket = var.cluster_state_bucket team_name = var.team_name diff --git a/variables.tf b/variables.tf index 862b37e..caa20e2 100644 --- a/variables.tf +++ b/variables.tf @@ -44,6 +44,11 @@ variable "db_allocated_storage" { default = "10" } +variable "db_max_allocated_storage" { + description = "Maximum storage limit for storage autoscaling" + default = "10000" +} + variable "db_engine" { description = "Database engine used e.g. postgres, mqsql" default = "postgres"