diff --git a/README.md b/README.md index f609583..f6b0960 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,7 @@ These variables have default values and don't have to be set to use this module. | external\_securitygroup\_ids | The Network Security Group ids for external network | `List` | [] | | internal\_securitygroup\_ids | The Network Security Group ids for internal network | `List` | [] | | tags | `key:value` tags to apply to resources built by the module | `map` | {} | +| sleep_time | The number of seconds/minutes of delay to build into creation of BIG-IP VMs | `string` | 300s | ~> **NOTE:** For each external interface there will be one primary,secondary private ip will be assigned. diff --git a/main.tf b/main.tf index 7d4f03d..58b94d1 100644 --- a/main.tf +++ b/main.tf @@ -433,9 +433,6 @@ resource "aws_instance" "f5_bigip" { } iam_instance_profile = var.aws_iam_instance_profile user_data = coalesce(var.custom_user_data, data.template_file.user_data_vm0.rendered) - provisioner "local-exec" { - command = "sleep 420" - } tags = merge(local.tags, { Name = format("BIGIP-Instance-%s", local.instance_prefix) } @@ -443,6 +440,11 @@ resource "aws_instance" "f5_bigip" { depends_on = [aws_eip.mgmt, aws_network_interface.public, aws_network_interface.private] } +resource "time_sleep" "wait_for_aws_instance_f5_bigip" { + depends_on = [aws_instance.f5_bigip] + create_duration = var.sleep_time +} + data "template_file" "clustermemberDO1" { count = local.total_nics == 1 ? 1 : 0 template = file("${path.module}/onboard_do_1nic.tpl") diff --git a/variables.tf b/variables.tf index 42ea200..3338b12 100644 --- a/variables.tf +++ b/variables.tf @@ -177,3 +177,9 @@ variable "tags" { type = map(any) default = {} } + +variable "sleep_time" { + type = string + default = "300s" + description = "The number of seconds/minutes of delay to build into creation of BIG-IP VMs; default is 250. BIG-IP requires a few minutes to complete the onboarding process and this value can be used to delay the processing of dependent Terraform resources." +}