Skip to content

Commit

Permalink
Merge pull request #82 from ministryofjustice/storg-autoscaling
Browse files Browse the repository at this point in the history
Add storage autoscaling
  • Loading branch information
digitalronin authored Dec 16, 2020
2 parents fc4299b + a7877fe commit 1bfd658
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion example/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion template/rds.tmpl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1bfd658

Please sign in to comment.