Skip to content

Commit 9ae80a2

Browse files
DaveSpeDave Spedziacloudpossebot
authored
feat: add timeouts to the instance resource + timeouts variable (#146)
* add timeouts to the instance, timeouts variable and update readme * Auto Format Co-authored-by: Dave Spedzia <[email protected]> Co-authored-by: cloudpossebot <[email protected]>
1 parent 28a0ca5 commit 9ae80a2

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ Available targets:
321321
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of subnet IDs for the DB. DB instance will be created in the VPC associated with the DB subnet group provisioned using the subnet IDs. Specify one of `subnet_ids`, `db_subnet_group_name` or `availability_zone` | `list(string)` | `[]` | no |
322322
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
323323
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
324+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | A list of DB timeouts to apply to the running code while creating, updating, or deleting the DB instance. | <pre>object({<br> create = string<br> update = string<br> delete = string<br> })</pre> | <pre>{<br> "create": "40m",<br> "delete": "60m",<br> "update": "80m"<br>}</pre> | no |
324325
| <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](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone) for more information. | `string` | `null` | no |
325326
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC ID the DB instance will be created in | `string` | n/a | yes |
326327

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of subnet IDs for the DB. DB instance will be created in the VPC associated with the DB subnet group provisioned using the subnet IDs. Specify one of `subnet_ids`, `db_subnet_group_name` or `availability_zone` | `list(string)` | `[]` | no |
107107
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
108108
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
109+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | A list of DB timeouts to apply to the running code while creating, updating, or deleting the DB instance. | <pre>object({<br> create = string<br> update = string<br> delete = string<br> })</pre> | <pre>{<br> "create": "40m",<br> "delete": "60m",<br> "update": "80m"<br>}</pre> | no |
109110
| <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](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone) for more information. | `string` | `null` | no |
110111
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC ID the DB instance will be created in | `string` | n/a | yes |
111112

main.tf

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ resource "aws_db_instance" "default" {
9595
snapshot_identifier, # if created from a snapshot, will be non-null at creation, but null afterwards
9696
]
9797
}
98+
99+
timeouts {
100+
create = var.timeouts.create
101+
update = var.timeouts.update
102+
delete = var.timeouts.delete
103+
}
98104
}
99105

100106
resource "aws_db_parameter_group" "default" {

variables.tf

+14
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,17 @@ variable "timezone" {
337337
description = "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](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone) for more information."
338338
default = null
339339
}
340+
341+
variable "timeouts" {
342+
type = object({
343+
create = string
344+
update = string
345+
delete = string
346+
})
347+
description = "A list of DB timeouts to apply to the running code while creating, updating, or deleting the DB instance."
348+
default = {
349+
create = "40m"
350+
update = "80m"
351+
delete = "60m"
352+
}
353+
}

0 commit comments

Comments
 (0)