terraform-provider-digitalocean icon indicating copy to clipboard operation
terraform-provider-digitalocean copied to clipboard

Add timeout configuration for digitalocean_droplet resource

Open dfradejas opened this issue 2 years ago • 1 comments

Hi,

When you create a big droplet from a snapshot in Digitalocean, it usually spends more than 1 hour creating this droplet. When you do it with terraform, the provider throws a timeout error because default timeout is 1 hour in the provider.

Could be possible to add timeouts block configuration to digitalocean_droplet resources?

Regards, Daniel.

dfradejas avatar May 16 '22 08:05 dfradejas

I have proposed #839 as a possible solution but am very open to feedback on choices made.

ngharrington avatar Jun 15 '22 23:06 ngharrington

Hi,

I'm trying to create the resource with timeout configuration, but it is not doing anything, the default timeout (1h) is still present, i can't configure it to, for example, 2 hours.

I am writting this block inside digitalocean_droplet resource and it goes to 1h again: timeouts { create = "1m" }

How can i configure it?

Regards, Daniel

dfradejas avatar Aug 17 '22 09:08 dfradejas

The droplet configuration is:

resource "digitalocean_droplet" "postgres_master_droplet" {
      ...
      timeouts {
          create = "2h"
          delete = "2h"
          update = "2h"
        }
    }

And the error code after an hour:

digitalocean_droplet.postgres_master_droplet: Still creating... [57m51s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [58m1s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [58m11s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [58m21s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [58m31s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [58m41s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [58m51s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [59m1s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [59m11s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [59m21s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [59m31s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [59m41s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [59m51s elapsed]
digitalocean_droplet.postgres_master_droplet: Still creating... [1h0m1s elapsed]
Error: Droplet (xxx) create action (xxx) errorred: timeout while waiting for state to become 'completed' (last state: 'in-progress', timeout: 1h0m0s)
  with digitalocean_droplet.postgres_master_droplet,
  on postgres_master_droplet_main.tf line 9, in resource "digitalocean_droplet" "postgres_master_droplet":
   9: resource "digitalocean_droplet" "postgres_master_droplet" 

dfradejas avatar Aug 17 '22 09:08 dfradejas

@dfradejas Looks like we're still missing a needed change here. This should do the trick https://github.com/digitalocean/terraform-provider-digitalocean/pull/867

andrewsomething avatar Aug 17 '22 13:08 andrewsomething

Hi @andrewsomething, do you notice when it is going to be merged that PR?

dfradejas avatar Sep 07 '22 08:09 dfradejas

Well it has been some time, but still - #828 and #867 are not pushed, and DO is playing games with a combination of the less popular distro and droplet type.

NedkoHristov avatar Mar 13 '23 15:03 NedkoHristov

#867 was released as v2.22.3

https://github.com/digitalocean/terraform-provider-digitalocean/releases/tag/v2.22.3

andrewsomething avatar Mar 13 '23 16:03 andrewsomething