diff --git a/README.md b/README.md index 6660e9c..5d5a6b2 100644 --- a/README.md +++ b/README.md @@ -181,12 +181,12 @@ No modules. | [business\_unit](#input\_business\_unit) | Area of the MOJ responsible for the service | `string` | n/a | yes | | [ca\_cert\_identifier](#input\_ca\_cert\_identifier) | Specifies the identifier of the CA certificate for the DB instance | `string` | `"rds-ca-rsa2048-g1"` | no | | [character\_set\_name](#input\_character\_set\_name) | DB char set, used only by MS-SQL | `string` | `"SQL_Latin1_General_CP1_CI_AS"` | no | -| [db\_allocated\_storage](#input\_db\_allocated\_storage) | The allocated storage in gibibytes | `string` | `"10"` | no | +| [db\_allocated\_storage](#input\_db\_allocated\_storage) | The allocated storage in gibibytes | `number` | `"20"` | no | | [db\_backup\_retention\_period](#input\_db\_backup\_retention\_period) | The days to retain backups. Must be 1 or greater to be a source for a Read Replica | `string` | `"7"` | no | | [db\_engine](#input\_db\_engine) | Database engine used e.g. postgres, mysql, sqlserver-ex | `string` | `"postgres"` | no | | [db\_engine\_version](#input\_db\_engine\_version) | The engine version to use e.g. 13.2 for Postgresql, 8.0 for MySQL, 15.00.4073.23.v1 for MS-SQL. Omitting the minor release part allows for automatic updates. | `string` | `"10"` | no | | [db\_instance\_class](#input\_db\_instance\_class) | The instance type of the RDS instance | `string` | `"db.t2.small"` | no | -| [db\_iops](#input\_db\_iops) | The amount of provisioned IOPS. Setting this to a value other than 0 implies a storage\_type of io1 | `number` | `0` | no | +| [db\_iops](#input\_db\_iops) | The amount of provisioned IOPS. | `number` | `null` | no | | [db\_max\_allocated\_storage](#input\_db\_max\_allocated\_storage) | Maximum storage limit for storage autoscaling | `string` | `"10000"` | no | | [db\_name](#input\_db\_name) | The name of the database to be created on the instance (if empty, it will be the generated random identifier) | `string` | `""` | no | | [db\_parameter](#input\_db\_parameter) | A list of DB parameters to apply. Note that parameters may differ from a DB family to another |
list(object({
apply_method = string
name = string
value = string
}))
|
[
{
"apply_method": "immediate",
"name": "rds.force_ssl",
"value": "1"
}
]
| no | @@ -197,7 +197,7 @@ No modules. | [infrastructure\_support](#input\_infrastructure\_support) | The team responsible for managing the infrastructure. Should be of the form () | `string` | n/a | yes | | [is\_production](#input\_is\_production) | Whether this is used for production or not | `string` | n/a | yes | | [license\_model](#input\_license\_model) | License model information for this DB instance, options for MS-SQL are: license-included \| bring-your-own-license \| general-public-license | `string` | `null` | no | -| [maintenance\_window](#input\_maintenance\_window) | The window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". For example: "Mon:00:00-Mon:03:00". | `string` | `""` | no | +| [maintenance\_window](#input\_maintenance\_window) | The window to perform maintenance in. Syntax: 'ddd:hh24:mi-ddd:hh24:mi'. Eg: 'Mon:00:00-Mon:03:00' | `string` | `null` | no | | [namespace](#input\_namespace) | Namespace name | `string` | n/a | yes | | [option\_group\_name](#input\_option\_group\_name) | (Optional) The name of an 'aws\_db\_option\_group' to associate to the DB instance | `string` | `null` | no | | [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Enable performance insights for RDS? Note: the user should ensure insights are disabled once the desired outcome is achieved. | `bool` | `false` | no | @@ -207,6 +207,7 @@ No modules. | [replicate\_source\_db](#input\_replicate\_source\_db) | Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate. | `string` | `null` | no | | [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | if false(default), a DB snapshot is created before the DB instance is deleted, using the value from final\_snapshot\_identifier. If true no DBSnapshot is created | `string` | `"false"` | no | | [snapshot\_identifier](#input\_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 | +| [storage\_type](#input\_storage\_type) | One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), 'io1' (provisioned IOPS SSD), or 'io2' (new generation of provisioned IOPS SSD). If you specify 'io2', you must also include a value for the 'iops' parameter and the `allocated_storage` must be at least 100 GiB (except for SQL Server which the minimum is 20 GiB). | `string` | `"gp3"` | no | | [team\_name](#input\_team\_name) | Team name | `string` | n/a | yes | | [vpc\_name](#input\_vpc\_name) | The name of the vpc (eg.: cloud-platform-live-0) | `string` | n/a | yes | | [vpc\_security\_group\_ids](#input\_vpc\_security\_group\_ids) | (Optional) A list of additional VPC security group IDs to associate with the DB instance - in adition to the default VPC security groups granting access from the Cloud Platform | `list(string)` | `[]` | no | diff --git a/variables.tf b/variables.tf index 1a05090..885d5bb 100644 --- a/variables.tf +++ b/variables.tf @@ -20,7 +20,7 @@ variable "snapshot_identifier" { variable "db_allocated_storage" { description = "The allocated storage in gibibytes" - default = "20" # 20 GiG is minimum storage size for RDS PostgreSQL gp3 storage type. + default = "20" # Minimum 'gp3' storage size is 20 GiB for Amazon RDS. type = number } @@ -60,13 +60,16 @@ variable "db_backup_retention_period" { } variable "storage_type" { - description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), 'io1' (provisioned IOPS SSD), or 'io2' (new generation of provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io2' or 'gp3' , you must also include a value for the 'iops' parameter" + description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), 'io1' (provisioned IOPS SSD), or 'io2' (new generation of provisioned IOPS SSD). If you specify 'io2', you must also include a value for the 'iops' parameter and the `allocated_storage` must be at least 100 GiB (except for SQL Server which the minimum is 20 GiB)." type = string default = "gp3" } +# For larger database sizes, you need to adjust the 'iops' value accordingly. +# The valid ranges for IOPS depend on the DB engine and storage size. +# Please refer to https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html for detailed information: variable "db_iops" { - description = "The amount of provisioned IOPS. Setting this implies a storage_type of 'io1' or `gp3`. See `notes` for limitations regarding this variable for `gp3`" + description = "The amount of provisioned IOPS." type = number default = null # Default to null to omit 'iops' unless explicitly specified, preventing unintended changes }