diff --git a/README.md b/README.md index 6a58b05e1..2f96c0480 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,7 @@ terraform destroy | docker\_machine\_spot\_price\_bid | Spot price bid. | `string` | `"0.06"` | no | | docker\_machine\_version | By default docker\_machine\_download\_url is used to set the docker machine version. Version of docker-machine. The version will be ingored once `docker_machine_download_url` is set. | `string` | `""` | no | | enable\_asg\_recreation | Enable automatic redeployment of the Runner ASG when the Launch Configs change. | `bool` | `true` | no | +| asg\_delete\_timeout | Timeout when trying to delete the Runner ASG. | `string` | `"10m"` | no | | enable\_cloudwatch\_logging | Boolean used to enable or disable the CloudWatch logging. | `bool` | `true` | no | | enable\_docker\_machine\_ssm\_access | Add IAM policies to the docker-machine instances to connect via the Session Manager. | `bool` | `false` | no | | enable\_eip | Enable the assignment of an EIP to the gitlab runner instance | `bool` | `false` | no | diff --git a/main.tf b/main.tf index c83f1df32..b7b60eb9a 100644 --- a/main.tf +++ b/main.tf @@ -163,6 +163,9 @@ resource "aws_autoscaling_group" "gitlab_runner_instance" { launch_configuration = aws_launch_configuration.gitlab_runner_instance.name enabled_metrics = var.metrics_autoscaling tags = data.null_data_source.agent_tags.*.outputs + timeouts { + delete = var.asg_delete_timeout + } } resource "aws_autoscaling_schedule" "scale_in" { diff --git a/variables.tf b/variables.tf index d242d583b..9f7993e0e 100644 --- a/variables.tf +++ b/variables.tf @@ -640,6 +640,12 @@ variable "enable_asg_recreation" { type = bool } +variable "asg_delete_timeout" { + description = "Timeout when trying to delete the Runner ASG." + default = "10m" + type = string +} + variable "enable_forced_updates" { description = "DEPRECATED! and is replaced by `enable_asg_recreation. Setting this variable to true will do the oposite as expected. For backward compatibility the variable will remain some releases. Old desription: Enable automatic redeployment of the Runner ASG when the Launch Configs change." default = null