Skip to content

Commit 0089455

Browse files
authored
feat: Add timeouts configuration options (#229)
1 parent 3c7e133 commit 0089455

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ No modules.
214214
| <a name="input_computed_ingress_with_source_security_group_id"></a> [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no |
215215
| <a name="input_create"></a> [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no |
216216
| <a name="input_create_sg"></a> [create\_sg](#input\_create\_sg) | Whether to create security group | `bool` | `true` | no |
217+
| <a name="input_create_timeout"></a> [create_timeout](#input\_create\_timeout) | Time to wait for a security group to be created | `string` | `10m` | no |
218+
| <a name="input_delete_timeout"></a> [delete_timeout](#input\_delete\_timeout) | Time to wait for a security group to be deleted | `string` | `15m` | no |
217219
| <a name="input_description"></a> [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no |
218220
| <a name="input_egress_cidr_blocks"></a> [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
219221
| <a name="input_egress_ipv6_cidr_blocks"></a> [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` | <pre>[<br> "::/0"<br>]</pre> | no |

examples/complete/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ module "complete_sg" {
311311
]
312312

313313
number_of_computed_egress_with_self = 1
314+
315+
create_timeout = "15m"
316+
delete_timeout = "45m"
314317
}
315318

316319
######################################################

main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ resource "aws_security_group" "this" {
2222
},
2323
var.tags,
2424
)
25+
26+
timeouts {
27+
create = var.create_timeout
28+
delete = var.delete_timeout
29+
}
2530
}
2631

2732
#################################
@@ -45,6 +50,11 @@ resource "aws_security_group" "this_name_prefix" {
4550
lifecycle {
4651
create_before_destroy = true
4752
}
53+
54+
timeouts {
55+
create = var.create_timeout
56+
delete = var.delete_timeout
57+
}
4858
}
4959

5060
###################################

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ variable "tags" {
5555
default = {}
5656
}
5757

58+
variable "create_timeout" {
59+
description = "Time to wait for a security group to be created"
60+
type = string
61+
default = "10m"
62+
}
63+
64+
variable "delete_timeout" {
65+
description = "Time to wait for a security group to be deleted"
66+
type = string
67+
default = "15m"
68+
}
69+
5870
##########
5971
# Ingress
6072
##########

0 commit comments

Comments
 (0)