Skip to content

Commit 5edff77

Browse files
authored
Merge branch 'master' into feat/add-route-propagation
2 parents ae8b809 + 280975a commit 5edff77

39 files changed

+13779
-1041
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
products:
1414
- account
1515
- applesilicon
16+
- autoscaling
1617
- az
1718
- baremetal
1819
- billing
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
subcategory: "Autoscaling"
3+
page_title: "Scaleway: scaleway_autoscaling_instance_group"
4+
---
5+
6+
# Resource: scaleway_autoscaling_instance_group
7+
8+
Books and manages Autoscaling Instance groups.
9+
10+
## Example Usage
11+
12+
### Basic
13+
14+
```terraform
15+
resource "scaleway_autoscaling_instance_group" "main" {
16+
name = "asg-group"
17+
template_id = scaleway_autoscaling_instance_template.main.id
18+
tags = ["terraform-test", "instance-group"]
19+
capacity {
20+
max_replicas = 5
21+
min_replicas = 1
22+
cooldown_delay = "300"
23+
}
24+
load_balancer {
25+
id = scaleway_lb.main.id
26+
backend_ids = [scaleway_lb_backend.main.id]
27+
private_network_id = scaleway_vpc_private_network.main.id
28+
}
29+
}
30+
```
31+
32+
### With template and policies
33+
34+
```terraform
35+
resource "scaleway_vpc" "main" {
36+
name = "TestAccAutoscalingVPC"
37+
}
38+
39+
resource "scaleway_vpc_private_network" "main" {
40+
name = "TestAccAutoscalingVPC"
41+
vpc_id = scaleway_vpc.main.id
42+
}
43+
44+
resource "scaleway_block_volume" "main" {
45+
iops = 5000
46+
size_in_gb = 10
47+
}
48+
49+
resource "scaleway_block_snapshot" "main" {
50+
name = "test-ds-block-snapshot-basic"
51+
volume_id = scaleway_block_volume.main.id
52+
}
53+
54+
resource "scaleway_lb_ip" "main" {}
55+
resource "scaleway_lb" "main" {
56+
ip_id = scaleway_lb_ip.main.id
57+
name = "test-lb"
58+
type = "lb-s"
59+
private_network {
60+
private_network_id = scaleway_vpc_private_network.main.id
61+
}
62+
}
63+
64+
resource "scaleway_lb_backend" "main" {
65+
lb_id = scaleway_lb.main.id
66+
forward_protocol = "tcp"
67+
forward_port = 80
68+
proxy_protocol = "none"
69+
}
70+
71+
resource "scaleway_autoscaling_instance_template" "main" {
72+
name = "autoscaling-instance-template-basic"
73+
commercial_type = "PLAY2-MICRO"
74+
tags = ["terraform-test", "basic"]
75+
volumes {
76+
name = "as-volume"
77+
volume_type = "sbs"
78+
boot = true
79+
from_snapshot {
80+
snapshot_id = scaleway_block_snapshot.main.id
81+
}
82+
perf_iops = 5000
83+
}
84+
public_ips_v4_count = 1
85+
private_network_ids = [scaleway_vpc_private_network.main.id]
86+
}
87+
88+
resource "scaleway_autoscaling_instance_group" "main" {
89+
name = "autoscaling-instance-group-basic"
90+
template_id = scaleway_autoscaling_instance_template.main.id
91+
tags = ["terraform-test", "instance-group"]
92+
capacity {
93+
max_replicas = 5
94+
min_replicas = 1
95+
cooldown_delay = "300"
96+
}
97+
load_balancer {
98+
id = scaleway_lb.main.id
99+
backend_ids = [scaleway_lb_backend.main.id]
100+
private_network_id = scaleway_vpc_private_network.main.id
101+
}
102+
delete_servers_on_destroy = true
103+
}
104+
105+
resource "scaleway_autoscaling_instance_policy" "up" {
106+
instance_group_id = scaleway_autoscaling_instance_group.main.id
107+
name = "scale-up-if-cpu-high"
108+
action = "scale_up"
109+
type = "flat_count"
110+
value = 1
111+
priority = 1
112+
113+
metric {
114+
name = "cpu scale up"
115+
managed_metric = "managed_metric_instance_cpu"
116+
operator = "operator_greater_than"
117+
aggregate = "aggregate_average"
118+
sampling_range_min = 5
119+
threshold = 70
120+
}
121+
}
122+
123+
resource "scaleway_autoscaling_instance_policy" "down" {
124+
instance_group_id = scaleway_autoscaling_instance_group.main.id
125+
name = "scale-down-if-cpu-low"
126+
action = "scale_down"
127+
type = "flat_count"
128+
value = 1
129+
priority = 2
130+
131+
metric {
132+
name = "cpu scale down"
133+
managed_metric = "managed_metric_instance_cpu"
134+
operator = "operator_less_than"
135+
aggregate = "aggregate_average"
136+
sampling_range_min = 5
137+
threshold = 40
138+
}
139+
}
140+
```
141+
142+
## Argument Reference
143+
144+
The following arguments are supported:
145+
146+
- `template_id` - (Required) The ID of the Instance template to attach to the Instance group.
147+
- `tags` - (Optional) The tags associated with the Instance group.
148+
- `name` - (Optional) The Instance group name.
149+
- `capacity` - (Optional) The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
150+
- `max_replicas` - The maximum count of Instances for the Instance group.
151+
- `min_replicas` - The minimum count of Instances for the Instance group.
152+
- `cooldown_delay` - Time (in seconds) after a scaling action during which requests to carry out a new scaling action will be denied.
153+
- `load_balancer` - (Optional) The specification of the Load Balancer to link to the Instance group.
154+
- `id` - The ID of the Load Balancer.
155+
- `backend_ids` - The Load Balancer backend IDs.
156+
- `private_network_id` - The ID of the Private Network attached to the Load Balancer.
157+
- `delete_servers_on_destroy` - (Optional) Whether to delete all instances in this group when the group is destroyed. Set to `true` to tear them down, `false` (the default) leaves them running.
158+
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the Instance group exists.
159+
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the Project the Instance group is associated with.
160+
161+
## Attributes Reference
162+
163+
In addition to all arguments above, the following attributes are exported:
164+
165+
- `id` - The ID of the Instance group.
166+
- `created_at` - Date and time of Instance group's creation (RFC 3339 format).
167+
- `updated_at` - Date and time of Instance group's last update (RFC 3339 format).
168+
169+
~> **Important:** Autoscaling Instance group IDs are [zonal](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`
170+
171+
## Import
172+
173+
Autoscaling Instance groups can be imported using `{zone}/{id}`, e.g.
174+
175+
```bash
176+
terraform import scaleway_autoscaling_instance_group.main fr-par-1/11111111-1111-1111-1111-111111111111
177+
```
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
subcategory: "Autoscaling"
3+
page_title: "Scaleway: scaleway_autoscaling_instance_policy"
4+
---
5+
6+
# Resource: scaleway_autoscaling_instance_policy
7+
8+
Books and manages Autoscaling Instance policies.
9+
10+
## Example Usage
11+
12+
### Basic
13+
14+
```terraform
15+
resource "scaleway_autoscaling_instance_policy" "up" {
16+
instance_group_id = scaleway_autoscaling_instance_group.main.id
17+
name = "scale-up-if-cpu-high"
18+
action = "scale_up"
19+
type = "flat_count"
20+
value = 1
21+
priority = 1
22+
23+
metric {
24+
name = "cpu scale up"
25+
managed_metric = "managed_metric_instance_cpu"
26+
operator = "operator_greater_than"
27+
aggregate = "aggregate_average"
28+
sampling_range_min = 5
29+
threshold = 70
30+
}
31+
}
32+
33+
resource "scaleway_autoscaling_instance_policy" "down" {
34+
instance_group_id = scaleway_autoscaling_instance_group.main.id
35+
name = "scale-down-if-cpu-low"
36+
action = "scale_down"
37+
type = "flat_count"
38+
value = 1
39+
priority = 2
40+
41+
metric {
42+
name = "cpu scale down"
43+
managed_metric = "managed_metric_instance_cpu"
44+
operator = "operator_less_than"
45+
aggregate = "aggregate_average"
46+
sampling_range_min = 5
47+
threshold = 40
48+
}
49+
}
50+
```
51+
52+
## Argument Reference
53+
54+
The following arguments are supported:
55+
56+
- `instance_group_id` - (Required) The ID of the Instance group related to this policy.
57+
- `name` - (Optional) The Instance policy name.
58+
- `action` - (Required) The action to execute when the metric-based condition is met.
59+
- `type` - (Required) How to use the number defined in `value` when determining by how many Instances to scale up/down.
60+
- `value` - (Required) The value representing the magnitude of the scaling action to take for the Instance group. Depending on the `type` parameter, this number could represent a total number of Instances in the group, a number of Instances to add, or a percentage to scale the group by.
61+
- `priority` - (Required) The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
62+
- `metric` - (Optional) Cockpit metric to use when determining whether to trigger a scale up/down action.
63+
- `name` - Name or description of the metric policy.
64+
- `operator` - Operator used when comparing the threshold value of the chosen `metric` to the actual sampled and aggregated value.
65+
- `aggregate` - How the values sampled for the `metric` should be aggregated.
66+
- `managed_metric` - The managed metric to use for this policy. These are available by default in Cockpit without any configuration or `node_exporter`. The chosen metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered.
67+
- `cockpit_metric_name` - The custom metric to use for this policy. This must be stored in Scaleway Cockpit. The metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered
68+
- `sampling_range_min` - The Interval of time, in minutes, during which metric is sampled.
69+
- `threshold` - The threshold value to measure the aggregated sampled `metric` value against. Combined with the `operator` field, determines whether a scaling action should be triggered.
70+
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the Instance policy exists.
71+
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the Project the Instance policy is associated with.
72+
73+
## Attributes Reference
74+
75+
In addition to all arguments above, the following attributes are exported:
76+
77+
- `id` - The ID of the Instance policy.
78+
79+
~> **Important:** Autoscaling policies IDs are [zonal](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`
80+
81+
## Import
82+
83+
Autoscaling instance policies can be imported using `{zone}/{id}`, e.g.
84+
85+
```bash
86+
terraform import scaleway_autoscaling_instance_policy.main fr-par-1/11111111-1111-1111-1111-111111111111
87+
```
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
subcategory: "Autoscaling"
3+
page_title: "Scaleway: scaleway_autoscaling_instance_template"
4+
---
5+
6+
# Resource: scaleway_autoscaling_instance_template
7+
8+
Books and manages Autoscaling Instance templates.
9+
10+
## Example Usage
11+
12+
### Basic
13+
14+
```terraform
15+
resource "scaleway_autoscaling_instance_template" "main" {
16+
name = "asg-template"
17+
commercial_type = "PLAY2-MICRO"
18+
tags = ["terraform-test", "basic"]
19+
volumes {
20+
name = "as-volume"
21+
volume_type = "sbs"
22+
boot = true
23+
from_snapshot {
24+
snapshot_id = scaleway_block_snapshot.main.id
25+
}
26+
perf_iops = 5000
27+
}
28+
public_ips_v4_count = 1
29+
private_network_ids = [scaleway_vpc_private_network.main.id]
30+
}
31+
```
32+
33+
## Argument Reference
34+
35+
The following arguments are supported:
36+
37+
- `commercial_type` - (Required) The name of Instance commercial type.
38+
- `tags` - (Optional) The tags associated with the Instance template.
39+
- `name` - (Optional) The Instance group template.
40+
- `image_id` - (Optional) The instance image ID. Can be an ID of a marketplace or personal image. This image must be compatible with `volume` and `commercial_type` template.
41+
- `volumes` - (Required) The template of Instance volume.
42+
- `name` - The name of the volume.
43+
- `perf_iops` - The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`).
44+
- `tags` - The list of tags assigned to the volume.
45+
- `boot` - Force the Instance to boot on this volume.
46+
- `volume_type` - The type of the volume.
47+
- `security_group_id` - (Optional) The instance security group ID.
48+
- `placement_group_id` - (Optional) The instance placement group ID. This is optional, but it is highly recommended to set a preference for Instance location within Availability Zone.
49+
- `public_ips_v4_count` - (Optional) The number of flexible IPv4 addresses to attach to the new Instance.
50+
- `public_ips_v6_count` - (Optional) The number of flexible IPv6 addresses to attach to the new Instance.
51+
- `private_network_ids` - (Optional) The private Network IDs to attach to the new Instance.
52+
- `cloud_init` - (Optional) The instance image ID. Can be an ID of a marketplace or personal image. This image must be compatible with `volume` and `commercial_type` template.
53+
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the Instance template exists.
54+
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the Project the Instance template is associated with.
55+
56+
## Attributes Reference
57+
58+
In addition to all arguments above, the following attributes are exported:
59+
60+
- `id` - The ID of the Instance group.
61+
- `created_at` - Date and time of Instance group's creation (RFC 3339 format).
62+
- `updated_at` - Date and time of Instance group's last update (RFC 3339 format).
63+
64+
~> **Important:** Autoscaling Instance template IDs are [zonal](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`
65+
66+
## Import
67+
68+
Autoscaling Instance templates can be imported using `{zone}/{id}`, e.g.
69+
70+
```bash
71+
terraform import scaleway_autoscaling_instance_template.main fr-par-1/11111111-1111-1111-1111-111111111111
72+
```

docs/resources/edge_services_cache_stage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ resource "scaleway_edge_services_cache_stage" "main" {
4040
- `waf_stage_id` - (Optional) The WAF stage ID the cache stage will be linked to. Only one of `backend_stage_id`, `route_stage_id` and `waf_stage_id` should be specified.
4141
- `fallback_ttl` - (Optional) The Time To Live (TTL) in seconds. Defines how long content is cached.
4242
- `refresh_cache` - (Optional) Trigger a refresh of the cache by changing this field's value.
43+
- `include_cookies` - (Optional) Defines whether responses to requests with cookies must be stored in the cache.
4344
- `purge_requests` - (Optional) The Scaleway Object Storage origin bucket (S3) linked to the backend stage.
4445
- `pipeline_id` - The pipeline ID in which the purge request will be created.
4546
- `assets` - The list of asserts to purge.

docs/resources/object_bucket_acl.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ The `owner` configuration block supports the following arguments:
114114

115115
The `grantee` configuration block supports the following arguments:
116116

117-
* `id` - (Required) The canonical user ID of the grantee.
118-
* `type` - (Required) Type of grantee. Valid values: CanonicalUser.
117+
* `id` - (Optional) The canonical user ID of the grantee.
118+
* `type` - (Required) Type of grantee. Valid values: CanonicalUser, Group.
119+
* `uri` - (Optional) The uri of the grantee if type is Group.
119120

120121
## Attributes Reference
121122

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/nats-io/jwt/v2 v2.7.4
2929
github.com/nats-io/nats.go v1.38.0
3030
github.com/robfig/cron/v3 v3.0.1
31-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613133518-6987cd48643b
31+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250625143510-4421125d41b9
3232
github.com/stretchr/testify v1.10.0
3333
golang.org/x/crypto v0.38.0
3434
gopkg.in/dnaeon/go-vcr.v3 v3.2.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
447447
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
448448
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
449449
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
450-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613133518-6987cd48643b h1:7V7T9XzUl+B/6zHeNxyX0DV3OVjCSedA0stHo0BNKZw=
451-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613133518-6987cd48643b/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
450+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250625143510-4421125d41b9 h1:9twhtdDBC2hYdNk6dhdOUWyx+quP0MTsMyub8r6K86U=
451+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250625143510-4421125d41b9/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
452452
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
453453
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
454454
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=

0 commit comments

Comments
 (0)