|
| 1 | +--- |
| 2 | +page_title: "Increasing Timeout in terraform apply" |
| 3 | +--- |
| 4 | +# Increasing Timeout in terraform apply |
| 5 | + |
| 6 | +When deploying resources with the Scaleway Terraform provider, operations like creating or updating instances, buckets, or other infrastructure may take longer than the default timeout durations. To avoid failures caused by these timeouts, you can configure custom timeouts per resource. |
| 7 | + |
| 8 | +## How to set custom timeouts |
| 9 | + |
| 10 | +Most Scaleway Terraform resources support a timeouts block where you can specify how long Terraform should wait for each operation. |
| 11 | + |
| 12 | +#### Timeout keywords supported |
| 13 | + |
| 14 | +- `create` — Timeout duration for creating the resource. |
| 15 | +- `update` — Timeout duration for updating the resource. |
| 16 | +- `delete` — Timeout duration for deleting the resource. |
| 17 | +- `default` — (Scaleway-specific) A unified timeout applied to all operations (create, update, delete) if specific keys are not set. |
| 18 | + |
| 19 | +### Example: Using Specific Operation Timeouts |
| 20 | + |
| 21 | +```terraform |
| 22 | +resource "scaleway_vpc_private_network" "pn" {} |
| 23 | +
|
| 24 | +resource "scaleway_k8s_cluster" "cluster" { |
| 25 | + name = "tf-cluster" |
| 26 | + version = "1.32.3" |
| 27 | + cni = "cilium" |
| 28 | + private_network_id = scaleway_vpc_private_network.pn.id |
| 29 | + delete_additional_resources = false |
| 30 | +
|
| 31 | + timeouts { |
| 32 | + delete = "15m" |
| 33 | + create = "20m" |
| 34 | + update = "15m" |
| 35 | + } |
| 36 | +} |
| 37 | +
|
| 38 | +resource "scaleway_k8s_pool" "pool" { |
| 39 | + cluster_id = scaleway_k8s_cluster.cluster.id |
| 40 | + name = "tf-pool" |
| 41 | + node_type = "DEV1-M" |
| 42 | + size = 1 |
| 43 | +} |
| 44 | +
|
| 45 | +``` |
| 46 | + |
| 47 | +### Example: Using the default Timeout |
| 48 | + |
| 49 | +```terraform |
| 50 | +resource "scaleway_object_bucket" "test" { |
| 51 | + name = "this-is-a-test" |
| 52 | + tags = { |
| 53 | + TestName = "TestAccSCW_WebsiteConfig_basic" |
| 54 | + } |
| 55 | + timeouts { |
| 56 | + default = "5m" |
| 57 | + } |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +If both default and one of create, update, or delete are set, the specific key overrides the default value. |
| 62 | + |
| 63 | +If no timeouts block is set, Terraform uses the provider's internal defaults. |
| 64 | + |
| 65 | +Not all Scaleway resources support timeouts. |
| 66 | + |
| 67 | +Custom timeouts are useful for long-running operations but do not affect retry intervals or polling frequency. |
| 68 | + |
| 69 | +## Official Documentation |
| 70 | + |
| 71 | +For more details on timeout support, refer to the official [Terraform documentation](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts). |
0 commit comments