Skip to content

Commit 8bd5ee4

Browse files
committed
feat: Add support for storage_throughput
AWS recently [added support for `gp3` storage type][1], and Terraform AWS provider [implemented][2] this functionality as well in version 4.45.0. Closes terraform-aws-modules#452 [1]: https://aws.amazon.com/about-aws/whats-new/2022/11/amazon-rds-general-purpose-gp3-storage-volumes/ [2]: hashicorp/terraform-provider-aws#27670
1 parent 0631db0 commit 8bd5ee4

File tree

7 files changed

+24
-9
lines changed

7 files changed

+24
-9
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Users have the ability to:
209209
| Name | Version |
210210
|------|---------|
211211
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
212-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.28 |
212+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.45 |
213213
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.1 |
214214

215215
## Providers
@@ -314,7 +314,8 @@ Users have the ability to:
314314
| <a name="input_skip_final_snapshot"></a> [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted | `bool` | `false` | no |
315315
| <a name="input_snapshot_identifier"></a> [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, e.g: rds:production-2015-06-26-06-05 | `string` | `null` | no |
316316
| <a name="input_storage_encrypted"></a> [storage\_encrypted](#input\_storage\_encrypted) | Specifies whether the DB instance is encrypted | `bool` | `true` | no |
317-
| <a name="input_storage_type"></a> [storage\_type](#input\_storage\_type) | One of 'standard' (magnetic), 'gp2' (general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not | `string` | `null` | no |
317+
| <a name="input_storage_throughput"></a> [storage\_throughput](#input\_storage\_throughput) | Storage throughput value for the DB instance. This setting applies only to the `gp3` storage type. | `number` | `null` | no |
318+
| <a name="input_storage_type"></a> [storage\_type](#input\_storage\_type) | One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter | `string` | `null` | no |
318319
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | A list of VPC subnet IDs | `list(string)` | `[]` | no |
319320
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no |
320321
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | `map(string)` | `{}` | no |

modules/db_instance/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
| Name | Version |
77
|------|---------|
88
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
9-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.28 |
9+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.45 |
1010
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.1 |
1111

1212
## Providers
1313

1414
| Name | Version |
1515
|------|---------|
16-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.28 |
16+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.45 |
1717
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.1 |
1818

1919
## Modules
@@ -91,7 +91,8 @@ No modules.
9191
| <a name="input_skip_final_snapshot"></a> [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted | `bool` | `false` | no |
9292
| <a name="input_snapshot_identifier"></a> [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, e.g: rds:production-2015-06-26-06-05. | `string` | `null` | no |
9393
| <a name="input_storage_encrypted"></a> [storage\_encrypted](#input\_storage\_encrypted) | Specifies whether the DB instance is encrypted | `bool` | `true` | no |
94-
| <a name="input_storage_type"></a> [storage\_type](#input\_storage\_type) | 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'. | `string` | `null` | no |
94+
| <a name="input_storage_throughput"></a> [storage\_throughput](#input\_storage\_throughput) | Storage throughput value for the DB instance. This setting applies only to the `gp3` storage type. | `number` | `null` | no |
95+
| <a name="input_storage_type"></a> [storage\_type](#input\_storage\_type) | One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter | `string` | `null` | no |
9596
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no |
9697
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | `map(string)` | `{}` | no |
9798
| <a name="input_timezone"></a> [timezone](#input\_timezone) | Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information. | `string` | `null` | no |

modules/db_instance/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ resource "aws_db_instance" "this" {
6161
availability_zone = var.availability_zone
6262
multi_az = var.multi_az
6363
iops = var.iops
64+
storage_throuhghput = var.storage_throuhghput
6465
publicly_accessible = var.publicly_accessible
6566
ca_cert_identifier = var.ca_cert_identifier
6667

modules/db_instance/variables.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ variable "allocated_storage" {
2222
}
2323

2424
variable "storage_type" {
25-
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'."
25+
description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter"
2626
type = string
2727
default = null
2828
}
2929

30+
variable "storage_throughput" {
31+
description = "Storage throughput value for the DB instance. This setting applies only to the `gp3` storage type."
32+
type = number
33+
default = null
34+
}
35+
3036
variable "storage_encrypted" {
3137
description = "Specifies whether the DB instance is encrypted"
3238
type = bool

modules/db_instance/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.28"
7+
version = ">= 4.45"
88
}
99

1010
random = {

variables.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ variable "allocated_storage" {
1616
}
1717

1818
variable "storage_type" {
19-
description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not"
19+
description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter"
2020
type = string
2121
default = null
2222
}
2323

24+
variable "storage_throughput" {
25+
description = "Storage throughput value for the DB instance. This setting applies only to the `gp3` storage type."
26+
type = number
27+
default = null
28+
}
29+
2430
variable "storage_encrypted" {
2531
description = "Specifies whether the DB instance is encrypted"
2632
type = bool

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.28"
7+
version = ">= 4.45"
88
}
99

1010
random = {

0 commit comments

Comments
 (0)