diff --git a/README.md b/README.md index cd4f869f..9aef845b 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,7 @@ module "db" { | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | allocated\_storage | The allocated storage in gigabytes | string | n/a | yes | +| max\_allocated\_storage | Specifies the maximum value for storage autoscaling | string | `"0"` | no | | allow\_major\_version\_upgrade | Indicates that major version upgrades are allowed. Changing this parameter does not result in an outage and the change is asynchronously applied as soon as possible | string | `"false"` | no | | apply\_immediately | Specifies whether any database modifications are applied immediately, or during the next maintenance window | string | `"false"` | no | | auto\_minor\_version\_upgrade | Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window | string | `"true"` | no | diff --git a/main.tf b/main.tf index d121127b..21235855 100644 --- a/main.tf +++ b/main.tf @@ -54,16 +54,17 @@ module "db_option_group" { module "db_instance" { source = "./modules/db_instance" - create = "${var.create_db_instance}" - identifier = "${var.identifier}" - engine = "${var.engine}" - engine_version = "${var.engine_version}" - instance_class = "${var.instance_class}" - allocated_storage = "${var.allocated_storage}" - storage_type = "${var.storage_type}" - storage_encrypted = "${var.storage_encrypted}" - kms_key_id = "${var.kms_key_id}" - license_model = "${var.license_model}" + create = "${var.create_db_instance}" + identifier = "${var.identifier}" + engine = "${var.engine}" + engine_version = "${var.engine_version}" + instance_class = "${var.instance_class}" + allocated_storage = "${var.allocated_storage}" + max_allocated_storage = "${var.max_allocated_storage}" + storage_type = "${var.storage_type}" + storage_encrypted = "${var.storage_encrypted}" + kms_key_id = "${var.kms_key_id}" + license_model = "${var.license_model}" name = "${var.name}" username = "${var.username}" diff --git a/modules/db_instance/main.tf b/modules/db_instance/main.tf index 6602d69a..f85b5919 100644 --- a/modules/db_instance/main.tf +++ b/modules/db_instance/main.tf @@ -22,14 +22,15 @@ resource "aws_db_instance" "this" { identifier = "${var.identifier}" - engine = "${var.engine}" - engine_version = "${var.engine_version}" - instance_class = "${var.instance_class}" - allocated_storage = "${var.allocated_storage}" - storage_type = "${var.storage_type}" - storage_encrypted = "${var.storage_encrypted}" - kms_key_id = "${var.kms_key_id}" - license_model = "${var.license_model}" + engine = "${var.engine}" + engine_version = "${var.engine_version}" + instance_class = "${var.instance_class}" + allocated_storage = "${var.allocated_storage}" + max_allocated_storage = "${var.max_allocated_storage}" + storage_type = "${var.storage_type}" + storage_encrypted = "${var.storage_encrypted}" + kms_key_id = "${var.kms_key_id}" + license_model = "${var.license_model}" name = "${var.name}" username = "${var.username}" @@ -82,14 +83,15 @@ resource "aws_db_instance" "this_mssql" { identifier = "${var.identifier}" - engine = "${var.engine}" - engine_version = "${var.engine_version}" - instance_class = "${var.instance_class}" - allocated_storage = "${var.allocated_storage}" - storage_type = "${var.storage_type}" - storage_encrypted = "${var.storage_encrypted}" - kms_key_id = "${var.kms_key_id}" - license_model = "${var.license_model}" + engine = "${var.engine}" + engine_version = "${var.engine_version}" + instance_class = "${var.instance_class}" + allocated_storage = "${var.allocated_storage}" + max_allocated_storage = "${var.max_allocated_storage}" + storage_type = "${var.storage_type}" + storage_encrypted = "${var.storage_encrypted}" + kms_key_id = "${var.kms_key_id}" + license_model = "${var.license_model}" name = "${var.name}" username = "${var.username}" diff --git a/modules/db_instance/variables.tf b/modules/db_instance/variables.tf index 92454e06..641e8c71 100644 --- a/modules/db_instance/variables.tf +++ b/modules/db_instance/variables.tf @@ -11,6 +11,11 @@ variable "allocated_storage" { description = "The allocated storage in gigabytes" } +variable "max_allocated_storage" { + description = "Specifies the value for Storage Autoscaling" + default = 0 +} + variable "storage_type" { description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'standard' if not. Note that this behaviour is different from the AWS web console, where the default is 'gp2'." default = "gp2" diff --git a/variables.tf b/variables.tf index 65275ec7..9ea28be0 100644 --- a/variables.tf +++ b/variables.tf @@ -6,6 +6,11 @@ variable "allocated_storage" { description = "The allocated storage in gigabytes" } +variable "max_allocated_storage" { + description = "Specifies the value for Storage Autoscaling" + default = 0 +} + variable "storage_type" { description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'standard' if not. Note that this behaviour is different from the AWS web console, where the default is 'gp2'." default = "gp2"