vultr / terraform-provider-vultr-community

Terraform Vultr provider
Mozilla Public License 2.0
50 stars 7 forks source link

[Feature] - timeout control for resource creation and destroying #87

Closed yeongjukang closed 5 years ago

yeongjukang commented 5 years ago

Is your feature request related to a problem? Please describe. I was installing Kubernetes using this, and met timeout. So I wanted to extend timeout but it doesn't work.

# first attempt - timeout
terraform apply
# ...
# vultr_server.master_standalone: Still creating... [5m40s elapsed]
# vultr_server.master_standalone: Still creating... [5m50s elapsed]
# vultr_server.master_standalone: Still creating... [6m0s elapsed]
# Error: timeout - last error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

# second attempt - timeout not supporting
terraform plan
# ...
# Error: Unsupported block type
#  on a.tf line 44, in resource "vultr_server" "master_standalone":
#  44:   timeouts {
# Blocks of type "timeouts" are not expected here.
# my template

resource "vultr_server" "master_standalone" {
    plan_id = "${data.vultr_plan.plan_2c4g.id}"
    region_id = "${data.vultr_region.tokyo.id}"
    os_id = "${data.vultr_os.coreos.id}"
    hostname = "master-01"
    provisioner "file" {
    source      = "common.sh"
    destination = "/tmp/common.sh"
  }
  provisioner "remote-exec" {
    inline = [
      "chmod +x /tmp/common.sh",
      "/tmp/common.sh",
    ]
  }
  timeouts {
    create = "10m"
  }
}

Describe the solution you'd like timeout support https://www.terraform.io/docs/configuration/resources.html#timeouts

Describe alternatives you've considered I just got rid of "/tmp/common.sh" from my template.

Additional context Thank you for official repository providing!

ddymko commented 5 years ago

@979156

We already have timeouts set to 60 mins during the server/bare metal create & destroy process that watches for state change. Adding the timeout functionality here wouldn't add anything also the issue you were seeing here is related to #88 where the SSH connection was causing TF to stop execution.

yeongjukang commented 5 years ago

@ddymko thanks David, I got your point related to #88.