Skip to content

Commit

Permalink
added sleep time optional parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
RavinderReddyF5 committed Dec 9, 2021
1 parent 9a68904 commit ad7d0d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -433,16 +433,18 @@ 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)
}
)
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")
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}

0 comments on commit ad7d0d3

Please sign in to comment.