Skip to content

Commit c21e5f1

Browse files
authored
Merge branch 'master' into feat/add_key_managers_resource
2 parents 69cde79 + 38d87a6 commit c21e5f1

File tree

6 files changed

+77
-35
lines changed

6 files changed

+77
-35
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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).

docs/resources/k8s_cluster.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ resource "scaleway_vpc_private_network" "pn" {}
1616
1717
resource "scaleway_k8s_cluster" "cluster" {
1818
name = "tf-cluster"
19-
version = "1.29.1"
19+
version = "1.32.3"
2020
cni = "cilium"
2121
private_network_id = scaleway_vpc_private_network.pn.id
2222
delete_additional_resources = false
@@ -36,7 +36,7 @@ resource "scaleway_k8s_pool" "pool" {
3636
resource "scaleway_k8s_cluster" "cluster" {
3737
name = "tf-cluster"
3838
type = "multicloud"
39-
version = "1.29.1"
39+
version = "1.32.3"
4040
cni = "kilo"
4141
delete_additional_resources = false
4242
}
@@ -60,7 +60,7 @@ resource "scaleway_vpc_private_network" "pn" {}
6060
resource "scaleway_k8s_cluster" "cluster" {
6161
name = "tf-cluster"
6262
description = "cluster made in terraform"
63-
version = "1.29.1"
63+
version = "1.32.3"
6464
cni = "calico"
6565
tags = ["terraform"]
6666
private_network_id = scaleway_vpc_private_network.pn.id

docs/resources/k8s_pool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Creates and manages Scaleway Kubernetes cluster pools. For more information, see
1414
```terraform
1515
resource "scaleway_k8s_cluster" "jack" {
1616
name = "jack"
17-
version = "1.24.3"
17+
version = "1.32.3"
1818
cni = "cilium"
1919
}
2020
@@ -153,7 +153,7 @@ resource "scaleway_k8s_pool" "pool" {
153153
resource "scaleway_k8s_cluster" "cluster" {
154154
name = "placement_group"
155155
cni = "kilo"
156-
version = "%s"
156+
version = "1.32.3"
157157
tags = ["terraform-test", "scaleway_k8s_cluster", "placement_group"]
158158
region = "fr-par"
159159
type = "multicloud"

docs/resources/lb.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ The following arguments are supported:
109109
- `private_network_id` - (Required) The ID of the Private Network to attach to.
110110
- ~> **Important:** Updates to `private_network` will recreate the attachment.
111111
- `ipam_ids` - (Optional) IPAM ID of a pre-reserved IP address to assign to the Load Balancer on this Private Network.
112-
- `dhcp_config` - (Deprecated) Please use `ipam_ids`. Set to `true` if you want to let DHCP assign IP addresses.
113-
- `static_config` - (Deprecated) Please use `ipam_ids`. Define a local ip address of your choice for the load balancer instance.
114112
- `ssl_compatibility_level` - (Optional) Enforces minimal SSL version (in SSL/TLS offloading context). Please check [possible values](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/#path-load-balancer-create-a-load-balancer).
115113
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) of the Load Balancer.
116114
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the Project the Load Balancer is associated with.

internal/services/lb/lb.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,16 @@ func ResourceLb() *schema.Resource {
131131
"static_config": {
132132
Description: "Define an IP address in the subnet of your private network that will be assigned to your load balancer instance",
133133
Type: schema.TypeList,
134-
Optional: true,
134+
Computed: true,
135135
Deprecated: "static_config field is deprecated, please use `private_network_id` or `ipam_ids` instead",
136136
Elem: &schema.Schema{
137137
Type: schema.TypeString,
138138
ValidateDiagFunc: verify.IsStandaloneIPorCIDR(),
139139
},
140-
MaxItems: 1,
141140
},
142141
"dhcp_config": {
143142
Description: "Set to true if you want to let DHCP assign IP addresses",
144143
Type: schema.TypeBool,
145-
Optional: true,
146144
Computed: true,
147145
Deprecated: "dhcp_config field is deprecated, please use `private_network_id` or `ipam_ids` instead",
148146
},

internal/services/lb/types.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,6 @@ func expandPrivateNetworks(data any) ([]*lb.PrivateNetwork, error) {
400400
rawPn := pn.(map[string]any)
401401
privateNetwork := &lb.PrivateNetwork{}
402402
privateNetwork.PrivateNetworkID = locality.ExpandID(rawPn["private_network_id"].(string))
403-
404-
if staticConfig, hasStaticConfig := rawPn["static_config"]; hasStaticConfig && len(staticConfig.([]any)) > 0 {
405-
privateNetwork.StaticConfig = expandLbPrivateNetworkStaticConfig(staticConfig) //nolint:staticcheck
406-
} else {
407-
privateNetwork.DHCPConfig = expandLbPrivateNetworkDHCPConfig(rawPn["dhcp_config"]) //nolint:staticcheck
408-
}
409-
410403
privateNetwork.IpamIDs = locality.ExpandIDs(rawPn["ipam_ids"])
411404

412405
pns = append(pns, privateNetwork)
@@ -415,16 +408,6 @@ func expandPrivateNetworks(data any) ([]*lb.PrivateNetwork, error) {
415408
return pns, nil
416409
}
417410

418-
func expandLbPrivateNetworkStaticConfig(raw any) *lb.PrivateNetworkStaticConfig {
419-
if raw == nil || len(raw.([]any)) < 1 {
420-
return nil
421-
}
422-
423-
return &lb.PrivateNetworkStaticConfig{
424-
IPAddress: types.ExpandStringsPtr(raw),
425-
}
426-
}
427-
428411
func flattenLbPrivateNetworkStaticConfig(cfg *lb.PrivateNetworkStaticConfig) []string {
429412
if cfg == nil {
430413
return nil
@@ -433,14 +416,6 @@ func flattenLbPrivateNetworkStaticConfig(cfg *lb.PrivateNetworkStaticConfig) []s
433416
return *cfg.IPAddress //nolint:staticcheck
434417
}
435418

436-
func expandLbPrivateNetworkDHCPConfig(raw any) *lb.PrivateNetworkDHCPConfig {
437-
if raw == nil || !raw.(bool) {
438-
return nil
439-
}
440-
441-
return &lb.PrivateNetworkDHCPConfig{}
442-
}
443-
444419
func attachLBPrivateNetworks(ctx context.Context, lbAPI *lb.ZonedAPI, zone scw.Zone, pnConfigs []*lb.PrivateNetwork, lbID string, timeout time.Duration) ([]*lb.PrivateNetwork, error) {
445420
var privateNetworks []*lb.PrivateNetwork
446421

0 commit comments

Comments
 (0)