pulumiverse-scaleway 1.30.0a1752168858__py3-none-any.whl → 1.31.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. pulumiverse_scaleway/__init__.py +27 -0
  2. pulumiverse_scaleway/_inputs.py +94 -32
  3. pulumiverse_scaleway/apple_silicon_server.py +47 -0
  4. pulumiverse_scaleway/applesilicon/server.py +47 -0
  5. pulumiverse_scaleway/autoscaling/__init__.py +13 -0
  6. pulumiverse_scaleway/autoscaling/_inputs.py +559 -0
  7. pulumiverse_scaleway/autoscaling/instance_group.py +808 -0
  8. pulumiverse_scaleway/autoscaling/instance_policy.py +635 -0
  9. pulumiverse_scaleway/autoscaling/instance_template.py +879 -0
  10. pulumiverse_scaleway/autoscaling/outputs.py +439 -0
  11. pulumiverse_scaleway/edge_services_cache_stage.py +47 -0
  12. pulumiverse_scaleway/get_cockpit_source.py +50 -7
  13. pulumiverse_scaleway/get_kubernetes_node_pool.py +12 -1
  14. pulumiverse_scaleway/get_vpc.py +12 -1
  15. pulumiverse_scaleway/get_vpc_private_network.py +12 -1
  16. pulumiverse_scaleway/kubernetes/get_pool.py +12 -1
  17. pulumiverse_scaleway/kubernetes/pool.py +61 -0
  18. pulumiverse_scaleway/kubernetes_node_pool.py +61 -0
  19. pulumiverse_scaleway/loadbalancer_acl.py +7 -7
  20. pulumiverse_scaleway/loadbalancers/_inputs.py +51 -11
  21. pulumiverse_scaleway/loadbalancers/acl.py +7 -7
  22. pulumiverse_scaleway/loadbalancers/outputs.py +60 -10
  23. pulumiverse_scaleway/network/get_private_network.py +12 -1
  24. pulumiverse_scaleway/network/get_vpc.py +12 -1
  25. pulumiverse_scaleway/network/private_network.py +47 -0
  26. pulumiverse_scaleway/network/vpc.py +47 -0
  27. pulumiverse_scaleway/object/_inputs.py +43 -21
  28. pulumiverse_scaleway/object/bucket_acl.py +6 -4
  29. pulumiverse_scaleway/object/outputs.py +26 -12
  30. pulumiverse_scaleway/object_bucket_acl.py +6 -4
  31. pulumiverse_scaleway/observability/get_source.py +50 -7
  32. pulumiverse_scaleway/outputs.py +86 -22
  33. pulumiverse_scaleway/pulumi-plugin.json +1 -1
  34. pulumiverse_scaleway/vpc.py +47 -0
  35. pulumiverse_scaleway/vpc_private_network.py +47 -0
  36. {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0.dist-info}/METADATA +1 -1
  37. {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0.dist-info}/RECORD +39 -36
  38. pulumiverse_scaleway/elasticmetal/get_easy_partitioning.py +0 -177
  39. pulumiverse_scaleway/get_cockpit_plan.py +0 -94
  40. pulumiverse_scaleway/observability/get_plan.py +0 -90
  41. {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0.dist-info}/WHEEL +0 -0
  42. {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,808 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import builtins
6
+ import copy
7
+ import warnings
8
+ import sys
9
+ import pulumi
10
+ import pulumi.runtime
11
+ from typing import Any, Mapping, Optional, Sequence, Union, overload
12
+ if sys.version_info >= (3, 11):
13
+ from typing import NotRequired, TypedDict, TypeAlias
14
+ else:
15
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
16
+ from .. import _utilities
17
+ from . import outputs
18
+ from ._inputs import *
19
+
20
+ __all__ = ['InstanceGroupArgs', 'InstanceGroup']
21
+
22
+ @pulumi.input_type
23
+ class InstanceGroupArgs:
24
+ def __init__(__self__, *,
25
+ template_id: pulumi.Input[builtins.str],
26
+ capacities: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]]] = None,
27
+ delete_servers_on_destroy: Optional[pulumi.Input[builtins.bool]] = None,
28
+ load_balancers: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]]] = None,
29
+ name: Optional[pulumi.Input[builtins.str]] = None,
30
+ project_id: Optional[pulumi.Input[builtins.str]] = None,
31
+ tags: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
32
+ zone: Optional[pulumi.Input[builtins.str]] = None):
33
+ """
34
+ The set of arguments for constructing a InstanceGroup resource.
35
+ :param pulumi.Input[builtins.str] template_id: The ID of the Instance template to attach to the Instance group.
36
+ :param pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]] capacities: The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
37
+ :param pulumi.Input[builtins.bool] delete_servers_on_destroy: 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.
38
+ :param pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]] load_balancers: The specification of the Load Balancer to link to the Instance group.
39
+ :param pulumi.Input[builtins.str] name: The Instance group name.
40
+ :param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance group is associated with.
41
+ :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] tags: The tags associated with the Instance group.
42
+ :param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance group exists.
43
+ """
44
+ pulumi.set(__self__, "template_id", template_id)
45
+ if capacities is not None:
46
+ pulumi.set(__self__, "capacities", capacities)
47
+ if delete_servers_on_destroy is not None:
48
+ pulumi.set(__self__, "delete_servers_on_destroy", delete_servers_on_destroy)
49
+ if load_balancers is not None:
50
+ pulumi.set(__self__, "load_balancers", load_balancers)
51
+ if name is not None:
52
+ pulumi.set(__self__, "name", name)
53
+ if project_id is not None:
54
+ pulumi.set(__self__, "project_id", project_id)
55
+ if tags is not None:
56
+ pulumi.set(__self__, "tags", tags)
57
+ if zone is not None:
58
+ pulumi.set(__self__, "zone", zone)
59
+
60
+ @property
61
+ @pulumi.getter(name="templateId")
62
+ def template_id(self) -> pulumi.Input[builtins.str]:
63
+ """
64
+ The ID of the Instance template to attach to the Instance group.
65
+ """
66
+ return pulumi.get(self, "template_id")
67
+
68
+ @template_id.setter
69
+ def template_id(self, value: pulumi.Input[builtins.str]):
70
+ pulumi.set(self, "template_id", value)
71
+
72
+ @property
73
+ @pulumi.getter
74
+ def capacities(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]]]:
75
+ """
76
+ The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
77
+ """
78
+ return pulumi.get(self, "capacities")
79
+
80
+ @capacities.setter
81
+ def capacities(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]]]):
82
+ pulumi.set(self, "capacities", value)
83
+
84
+ @property
85
+ @pulumi.getter(name="deleteServersOnDestroy")
86
+ def delete_servers_on_destroy(self) -> Optional[pulumi.Input[builtins.bool]]:
87
+ """
88
+ 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.
89
+ """
90
+ return pulumi.get(self, "delete_servers_on_destroy")
91
+
92
+ @delete_servers_on_destroy.setter
93
+ def delete_servers_on_destroy(self, value: Optional[pulumi.Input[builtins.bool]]):
94
+ pulumi.set(self, "delete_servers_on_destroy", value)
95
+
96
+ @property
97
+ @pulumi.getter(name="loadBalancers")
98
+ def load_balancers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]]]:
99
+ """
100
+ The specification of the Load Balancer to link to the Instance group.
101
+ """
102
+ return pulumi.get(self, "load_balancers")
103
+
104
+ @load_balancers.setter
105
+ def load_balancers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]]]):
106
+ pulumi.set(self, "load_balancers", value)
107
+
108
+ @property
109
+ @pulumi.getter
110
+ def name(self) -> Optional[pulumi.Input[builtins.str]]:
111
+ """
112
+ The Instance group name.
113
+ """
114
+ return pulumi.get(self, "name")
115
+
116
+ @name.setter
117
+ def name(self, value: Optional[pulumi.Input[builtins.str]]):
118
+ pulumi.set(self, "name", value)
119
+
120
+ @property
121
+ @pulumi.getter(name="projectId")
122
+ def project_id(self) -> Optional[pulumi.Input[builtins.str]]:
123
+ """
124
+ `project_id`) The ID of the Project the Instance group is associated with.
125
+ """
126
+ return pulumi.get(self, "project_id")
127
+
128
+ @project_id.setter
129
+ def project_id(self, value: Optional[pulumi.Input[builtins.str]]):
130
+ pulumi.set(self, "project_id", value)
131
+
132
+ @property
133
+ @pulumi.getter
134
+ def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]:
135
+ """
136
+ The tags associated with the Instance group.
137
+ """
138
+ return pulumi.get(self, "tags")
139
+
140
+ @tags.setter
141
+ def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]):
142
+ pulumi.set(self, "tags", value)
143
+
144
+ @property
145
+ @pulumi.getter
146
+ def zone(self) -> Optional[pulumi.Input[builtins.str]]:
147
+ """
148
+ `zone`) The zone in which the Instance group exists.
149
+ """
150
+ return pulumi.get(self, "zone")
151
+
152
+ @zone.setter
153
+ def zone(self, value: Optional[pulumi.Input[builtins.str]]):
154
+ pulumi.set(self, "zone", value)
155
+
156
+
157
+ @pulumi.input_type
158
+ class _InstanceGroupState:
159
+ def __init__(__self__, *,
160
+ capacities: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]]] = None,
161
+ created_at: Optional[pulumi.Input[builtins.str]] = None,
162
+ delete_servers_on_destroy: Optional[pulumi.Input[builtins.bool]] = None,
163
+ load_balancers: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]]] = None,
164
+ name: Optional[pulumi.Input[builtins.str]] = None,
165
+ project_id: Optional[pulumi.Input[builtins.str]] = None,
166
+ tags: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
167
+ template_id: Optional[pulumi.Input[builtins.str]] = None,
168
+ updated_at: Optional[pulumi.Input[builtins.str]] = None,
169
+ zone: Optional[pulumi.Input[builtins.str]] = None):
170
+ """
171
+ Input properties used for looking up and filtering InstanceGroup resources.
172
+ :param pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]] capacities: The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
173
+ :param pulumi.Input[builtins.str] created_at: Date and time of Instance group's creation (RFC 3339 format).
174
+ :param pulumi.Input[builtins.bool] delete_servers_on_destroy: 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.
175
+ :param pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]] load_balancers: The specification of the Load Balancer to link to the Instance group.
176
+ :param pulumi.Input[builtins.str] name: The Instance group name.
177
+ :param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance group is associated with.
178
+ :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] tags: The tags associated with the Instance group.
179
+ :param pulumi.Input[builtins.str] template_id: The ID of the Instance template to attach to the Instance group.
180
+ :param pulumi.Input[builtins.str] updated_at: Date and time of Instance group's last update (RFC 3339 format).
181
+ :param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance group exists.
182
+ """
183
+ if capacities is not None:
184
+ pulumi.set(__self__, "capacities", capacities)
185
+ if created_at is not None:
186
+ pulumi.set(__self__, "created_at", created_at)
187
+ if delete_servers_on_destroy is not None:
188
+ pulumi.set(__self__, "delete_servers_on_destroy", delete_servers_on_destroy)
189
+ if load_balancers is not None:
190
+ pulumi.set(__self__, "load_balancers", load_balancers)
191
+ if name is not None:
192
+ pulumi.set(__self__, "name", name)
193
+ if project_id is not None:
194
+ pulumi.set(__self__, "project_id", project_id)
195
+ if tags is not None:
196
+ pulumi.set(__self__, "tags", tags)
197
+ if template_id is not None:
198
+ pulumi.set(__self__, "template_id", template_id)
199
+ if updated_at is not None:
200
+ pulumi.set(__self__, "updated_at", updated_at)
201
+ if zone is not None:
202
+ pulumi.set(__self__, "zone", zone)
203
+
204
+ @property
205
+ @pulumi.getter
206
+ def capacities(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]]]:
207
+ """
208
+ The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
209
+ """
210
+ return pulumi.get(self, "capacities")
211
+
212
+ @capacities.setter
213
+ def capacities(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupCapacityArgs']]]]):
214
+ pulumi.set(self, "capacities", value)
215
+
216
+ @property
217
+ @pulumi.getter(name="createdAt")
218
+ def created_at(self) -> Optional[pulumi.Input[builtins.str]]:
219
+ """
220
+ Date and time of Instance group's creation (RFC 3339 format).
221
+ """
222
+ return pulumi.get(self, "created_at")
223
+
224
+ @created_at.setter
225
+ def created_at(self, value: Optional[pulumi.Input[builtins.str]]):
226
+ pulumi.set(self, "created_at", value)
227
+
228
+ @property
229
+ @pulumi.getter(name="deleteServersOnDestroy")
230
+ def delete_servers_on_destroy(self) -> Optional[pulumi.Input[builtins.bool]]:
231
+ """
232
+ 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.
233
+ """
234
+ return pulumi.get(self, "delete_servers_on_destroy")
235
+
236
+ @delete_servers_on_destroy.setter
237
+ def delete_servers_on_destroy(self, value: Optional[pulumi.Input[builtins.bool]]):
238
+ pulumi.set(self, "delete_servers_on_destroy", value)
239
+
240
+ @property
241
+ @pulumi.getter(name="loadBalancers")
242
+ def load_balancers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]]]:
243
+ """
244
+ The specification of the Load Balancer to link to the Instance group.
245
+ """
246
+ return pulumi.get(self, "load_balancers")
247
+
248
+ @load_balancers.setter
249
+ def load_balancers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['InstanceGroupLoadBalancerArgs']]]]):
250
+ pulumi.set(self, "load_balancers", value)
251
+
252
+ @property
253
+ @pulumi.getter
254
+ def name(self) -> Optional[pulumi.Input[builtins.str]]:
255
+ """
256
+ The Instance group name.
257
+ """
258
+ return pulumi.get(self, "name")
259
+
260
+ @name.setter
261
+ def name(self, value: Optional[pulumi.Input[builtins.str]]):
262
+ pulumi.set(self, "name", value)
263
+
264
+ @property
265
+ @pulumi.getter(name="projectId")
266
+ def project_id(self) -> Optional[pulumi.Input[builtins.str]]:
267
+ """
268
+ `project_id`) The ID of the Project the Instance group is associated with.
269
+ """
270
+ return pulumi.get(self, "project_id")
271
+
272
+ @project_id.setter
273
+ def project_id(self, value: Optional[pulumi.Input[builtins.str]]):
274
+ pulumi.set(self, "project_id", value)
275
+
276
+ @property
277
+ @pulumi.getter
278
+ def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]:
279
+ """
280
+ The tags associated with the Instance group.
281
+ """
282
+ return pulumi.get(self, "tags")
283
+
284
+ @tags.setter
285
+ def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]):
286
+ pulumi.set(self, "tags", value)
287
+
288
+ @property
289
+ @pulumi.getter(name="templateId")
290
+ def template_id(self) -> Optional[pulumi.Input[builtins.str]]:
291
+ """
292
+ The ID of the Instance template to attach to the Instance group.
293
+ """
294
+ return pulumi.get(self, "template_id")
295
+
296
+ @template_id.setter
297
+ def template_id(self, value: Optional[pulumi.Input[builtins.str]]):
298
+ pulumi.set(self, "template_id", value)
299
+
300
+ @property
301
+ @pulumi.getter(name="updatedAt")
302
+ def updated_at(self) -> Optional[pulumi.Input[builtins.str]]:
303
+ """
304
+ Date and time of Instance group's last update (RFC 3339 format).
305
+ """
306
+ return pulumi.get(self, "updated_at")
307
+
308
+ @updated_at.setter
309
+ def updated_at(self, value: Optional[pulumi.Input[builtins.str]]):
310
+ pulumi.set(self, "updated_at", value)
311
+
312
+ @property
313
+ @pulumi.getter
314
+ def zone(self) -> Optional[pulumi.Input[builtins.str]]:
315
+ """
316
+ `zone`) The zone in which the Instance group exists.
317
+ """
318
+ return pulumi.get(self, "zone")
319
+
320
+ @zone.setter
321
+ def zone(self, value: Optional[pulumi.Input[builtins.str]]):
322
+ pulumi.set(self, "zone", value)
323
+
324
+
325
+ @pulumi.type_token("scaleway:autoscaling/instanceGroup:InstanceGroup")
326
+ class InstanceGroup(pulumi.CustomResource):
327
+ @overload
328
+ def __init__(__self__,
329
+ resource_name: str,
330
+ opts: Optional[pulumi.ResourceOptions] = None,
331
+ capacities: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupCapacityArgs', 'InstanceGroupCapacityArgsDict']]]]] = None,
332
+ delete_servers_on_destroy: Optional[pulumi.Input[builtins.bool]] = None,
333
+ load_balancers: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupLoadBalancerArgs', 'InstanceGroupLoadBalancerArgsDict']]]]] = None,
334
+ name: Optional[pulumi.Input[builtins.str]] = None,
335
+ project_id: Optional[pulumi.Input[builtins.str]] = None,
336
+ tags: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
337
+ template_id: Optional[pulumi.Input[builtins.str]] = None,
338
+ zone: Optional[pulumi.Input[builtins.str]] = None,
339
+ __props__=None):
340
+ """
341
+ Books and manages Autoscaling Instance groups.
342
+
343
+ ## Example Usage
344
+
345
+ ### Basic
346
+
347
+ ```python
348
+ import pulumi
349
+ import pulumiverse_scaleway as scaleway
350
+
351
+ main = scaleway.autoscaling.InstanceGroup("main",
352
+ name="asg-group",
353
+ template_id=main_scaleway_autoscaling_instance_template["id"],
354
+ tags=[
355
+ "terraform-test",
356
+ "instance-group",
357
+ ],
358
+ capacities=[{
359
+ "max_replicas": 5,
360
+ "min_replicas": 1,
361
+ "cooldown_delay": 300,
362
+ }],
363
+ load_balancers=[{
364
+ "id": main_scaleway_lb["id"],
365
+ "backend_ids": [main_scaleway_lb_backend["id"]],
366
+ "private_network_id": main_scaleway_vpc_private_network["id"],
367
+ }])
368
+ ```
369
+
370
+ ### With template and policies
371
+
372
+ ```python
373
+ import pulumi
374
+ import pulumiverse_scaleway as scaleway
375
+
376
+ main = scaleway.network.Vpc("main", name="TestAccAutoscalingVPC")
377
+ main_private_network = scaleway.network.PrivateNetwork("main",
378
+ name="TestAccAutoscalingVPC",
379
+ vpc_id=main.id)
380
+ main_volume = scaleway.block.Volume("main",
381
+ iops=5000,
382
+ size_in_gb=10)
383
+ main_snapshot = scaleway.block.Snapshot("main",
384
+ name="test-ds-block-snapshot-basic",
385
+ volume_id=main_volume.id)
386
+ main_ip = scaleway.loadbalancers.Ip("main")
387
+ main_load_balancer = scaleway.loadbalancers.LoadBalancer("main",
388
+ ip_id=main_ip.id,
389
+ name="test-lb",
390
+ type="lb-s",
391
+ private_networks=[{
392
+ "private_network_id": main_private_network.id,
393
+ }])
394
+ main_backend = scaleway.loadbalancers.Backend("main",
395
+ lb_id=main_load_balancer.id,
396
+ forward_protocol="tcp",
397
+ forward_port=80,
398
+ proxy_protocol="none")
399
+ main_instance_template = scaleway.autoscaling.InstanceTemplate("main",
400
+ name="autoscaling-instance-template-basic",
401
+ commercial_type="PLAY2-MICRO",
402
+ tags=[
403
+ "terraform-test",
404
+ "basic",
405
+ ],
406
+ volumes=[{
407
+ "name": "as-volume",
408
+ "volume_type": "sbs",
409
+ "boot": True,
410
+ "from_snapshot": {
411
+ "snapshot_id": main_snapshot.id,
412
+ },
413
+ "perf_iops": 5000,
414
+ }],
415
+ public_ips_v4_count=1,
416
+ private_network_ids=[main_private_network.id])
417
+ main_instance_group = scaleway.autoscaling.InstanceGroup("main",
418
+ name="autoscaling-instance-group-basic",
419
+ template_id=main_instance_template.id,
420
+ tags=[
421
+ "terraform-test",
422
+ "instance-group",
423
+ ],
424
+ capacities=[{
425
+ "max_replicas": 5,
426
+ "min_replicas": 1,
427
+ "cooldown_delay": 300,
428
+ }],
429
+ load_balancers=[{
430
+ "id": main_load_balancer.id,
431
+ "backend_ids": [main_backend.id],
432
+ "private_network_id": main_private_network.id,
433
+ }],
434
+ delete_servers_on_destroy=True)
435
+ up = scaleway.autoscaling.InstancePolicy("up",
436
+ instance_group_id=main_instance_group.id,
437
+ name="scale-up-if-cpu-high",
438
+ action="scale_up",
439
+ type="flat_count",
440
+ value=1,
441
+ priority=1,
442
+ metrics=[{
443
+ "name": "cpu scale up",
444
+ "managed_metric": "managed_metric_instance_cpu",
445
+ "operator": "operator_greater_than",
446
+ "aggregate": "aggregate_average",
447
+ "sampling_range_min": 5,
448
+ "threshold": 70,
449
+ }])
450
+ down = scaleway.autoscaling.InstancePolicy("down",
451
+ instance_group_id=main_instance_group.id,
452
+ name="scale-down-if-cpu-low",
453
+ action="scale_down",
454
+ type="flat_count",
455
+ value=1,
456
+ priority=2,
457
+ metrics=[{
458
+ "name": "cpu scale down",
459
+ "managed_metric": "managed_metric_instance_cpu",
460
+ "operator": "operator_less_than",
461
+ "aggregate": "aggregate_average",
462
+ "sampling_range_min": 5,
463
+ "threshold": 40,
464
+ }])
465
+ ```
466
+
467
+ ## Import
468
+
469
+ Autoscaling Instance groups can be imported using `{zone}/{id}`, e.g.
470
+
471
+ bash
472
+
473
+ ```sh
474
+ $ pulumi import scaleway:autoscaling/instanceGroup:InstanceGroup main fr-par-1/11111111-1111-1111-1111-111111111111
475
+ ```
476
+
477
+ :param str resource_name: The name of the resource.
478
+ :param pulumi.ResourceOptions opts: Options for the resource.
479
+ :param pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupCapacityArgs', 'InstanceGroupCapacityArgsDict']]]] capacities: The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
480
+ :param pulumi.Input[builtins.bool] delete_servers_on_destroy: 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.
481
+ :param pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupLoadBalancerArgs', 'InstanceGroupLoadBalancerArgsDict']]]] load_balancers: The specification of the Load Balancer to link to the Instance group.
482
+ :param pulumi.Input[builtins.str] name: The Instance group name.
483
+ :param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance group is associated with.
484
+ :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] tags: The tags associated with the Instance group.
485
+ :param pulumi.Input[builtins.str] template_id: The ID of the Instance template to attach to the Instance group.
486
+ :param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance group exists.
487
+ """
488
+ ...
489
+ @overload
490
+ def __init__(__self__,
491
+ resource_name: str,
492
+ args: InstanceGroupArgs,
493
+ opts: Optional[pulumi.ResourceOptions] = None):
494
+ """
495
+ Books and manages Autoscaling Instance groups.
496
+
497
+ ## Example Usage
498
+
499
+ ### Basic
500
+
501
+ ```python
502
+ import pulumi
503
+ import pulumiverse_scaleway as scaleway
504
+
505
+ main = scaleway.autoscaling.InstanceGroup("main",
506
+ name="asg-group",
507
+ template_id=main_scaleway_autoscaling_instance_template["id"],
508
+ tags=[
509
+ "terraform-test",
510
+ "instance-group",
511
+ ],
512
+ capacities=[{
513
+ "max_replicas": 5,
514
+ "min_replicas": 1,
515
+ "cooldown_delay": 300,
516
+ }],
517
+ load_balancers=[{
518
+ "id": main_scaleway_lb["id"],
519
+ "backend_ids": [main_scaleway_lb_backend["id"]],
520
+ "private_network_id": main_scaleway_vpc_private_network["id"],
521
+ }])
522
+ ```
523
+
524
+ ### With template and policies
525
+
526
+ ```python
527
+ import pulumi
528
+ import pulumiverse_scaleway as scaleway
529
+
530
+ main = scaleway.network.Vpc("main", name="TestAccAutoscalingVPC")
531
+ main_private_network = scaleway.network.PrivateNetwork("main",
532
+ name="TestAccAutoscalingVPC",
533
+ vpc_id=main.id)
534
+ main_volume = scaleway.block.Volume("main",
535
+ iops=5000,
536
+ size_in_gb=10)
537
+ main_snapshot = scaleway.block.Snapshot("main",
538
+ name="test-ds-block-snapshot-basic",
539
+ volume_id=main_volume.id)
540
+ main_ip = scaleway.loadbalancers.Ip("main")
541
+ main_load_balancer = scaleway.loadbalancers.LoadBalancer("main",
542
+ ip_id=main_ip.id,
543
+ name="test-lb",
544
+ type="lb-s",
545
+ private_networks=[{
546
+ "private_network_id": main_private_network.id,
547
+ }])
548
+ main_backend = scaleway.loadbalancers.Backend("main",
549
+ lb_id=main_load_balancer.id,
550
+ forward_protocol="tcp",
551
+ forward_port=80,
552
+ proxy_protocol="none")
553
+ main_instance_template = scaleway.autoscaling.InstanceTemplate("main",
554
+ name="autoscaling-instance-template-basic",
555
+ commercial_type="PLAY2-MICRO",
556
+ tags=[
557
+ "terraform-test",
558
+ "basic",
559
+ ],
560
+ volumes=[{
561
+ "name": "as-volume",
562
+ "volume_type": "sbs",
563
+ "boot": True,
564
+ "from_snapshot": {
565
+ "snapshot_id": main_snapshot.id,
566
+ },
567
+ "perf_iops": 5000,
568
+ }],
569
+ public_ips_v4_count=1,
570
+ private_network_ids=[main_private_network.id])
571
+ main_instance_group = scaleway.autoscaling.InstanceGroup("main",
572
+ name="autoscaling-instance-group-basic",
573
+ template_id=main_instance_template.id,
574
+ tags=[
575
+ "terraform-test",
576
+ "instance-group",
577
+ ],
578
+ capacities=[{
579
+ "max_replicas": 5,
580
+ "min_replicas": 1,
581
+ "cooldown_delay": 300,
582
+ }],
583
+ load_balancers=[{
584
+ "id": main_load_balancer.id,
585
+ "backend_ids": [main_backend.id],
586
+ "private_network_id": main_private_network.id,
587
+ }],
588
+ delete_servers_on_destroy=True)
589
+ up = scaleway.autoscaling.InstancePolicy("up",
590
+ instance_group_id=main_instance_group.id,
591
+ name="scale-up-if-cpu-high",
592
+ action="scale_up",
593
+ type="flat_count",
594
+ value=1,
595
+ priority=1,
596
+ metrics=[{
597
+ "name": "cpu scale up",
598
+ "managed_metric": "managed_metric_instance_cpu",
599
+ "operator": "operator_greater_than",
600
+ "aggregate": "aggregate_average",
601
+ "sampling_range_min": 5,
602
+ "threshold": 70,
603
+ }])
604
+ down = scaleway.autoscaling.InstancePolicy("down",
605
+ instance_group_id=main_instance_group.id,
606
+ name="scale-down-if-cpu-low",
607
+ action="scale_down",
608
+ type="flat_count",
609
+ value=1,
610
+ priority=2,
611
+ metrics=[{
612
+ "name": "cpu scale down",
613
+ "managed_metric": "managed_metric_instance_cpu",
614
+ "operator": "operator_less_than",
615
+ "aggregate": "aggregate_average",
616
+ "sampling_range_min": 5,
617
+ "threshold": 40,
618
+ }])
619
+ ```
620
+
621
+ ## Import
622
+
623
+ Autoscaling Instance groups can be imported using `{zone}/{id}`, e.g.
624
+
625
+ bash
626
+
627
+ ```sh
628
+ $ pulumi import scaleway:autoscaling/instanceGroup:InstanceGroup main fr-par-1/11111111-1111-1111-1111-111111111111
629
+ ```
630
+
631
+ :param str resource_name: The name of the resource.
632
+ :param InstanceGroupArgs args: The arguments to use to populate this resource's properties.
633
+ :param pulumi.ResourceOptions opts: Options for the resource.
634
+ """
635
+ ...
636
+ def __init__(__self__, resource_name: str, *args, **kwargs):
637
+ resource_args, opts = _utilities.get_resource_args_opts(InstanceGroupArgs, pulumi.ResourceOptions, *args, **kwargs)
638
+ if resource_args is not None:
639
+ __self__._internal_init(resource_name, opts, **resource_args.__dict__)
640
+ else:
641
+ __self__._internal_init(resource_name, *args, **kwargs)
642
+
643
+ def _internal_init(__self__,
644
+ resource_name: str,
645
+ opts: Optional[pulumi.ResourceOptions] = None,
646
+ capacities: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupCapacityArgs', 'InstanceGroupCapacityArgsDict']]]]] = None,
647
+ delete_servers_on_destroy: Optional[pulumi.Input[builtins.bool]] = None,
648
+ load_balancers: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupLoadBalancerArgs', 'InstanceGroupLoadBalancerArgsDict']]]]] = None,
649
+ name: Optional[pulumi.Input[builtins.str]] = None,
650
+ project_id: Optional[pulumi.Input[builtins.str]] = None,
651
+ tags: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
652
+ template_id: Optional[pulumi.Input[builtins.str]] = None,
653
+ zone: Optional[pulumi.Input[builtins.str]] = None,
654
+ __props__=None):
655
+ opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
656
+ if not isinstance(opts, pulumi.ResourceOptions):
657
+ raise TypeError('Expected resource options to be a ResourceOptions instance')
658
+ if opts.id is None:
659
+ if __props__ is not None:
660
+ raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
661
+ __props__ = InstanceGroupArgs.__new__(InstanceGroupArgs)
662
+
663
+ __props__.__dict__["capacities"] = capacities
664
+ __props__.__dict__["delete_servers_on_destroy"] = delete_servers_on_destroy
665
+ __props__.__dict__["load_balancers"] = load_balancers
666
+ __props__.__dict__["name"] = name
667
+ __props__.__dict__["project_id"] = project_id
668
+ __props__.__dict__["tags"] = tags
669
+ if template_id is None and not opts.urn:
670
+ raise TypeError("Missing required property 'template_id'")
671
+ __props__.__dict__["template_id"] = template_id
672
+ __props__.__dict__["zone"] = zone
673
+ __props__.__dict__["created_at"] = None
674
+ __props__.__dict__["updated_at"] = None
675
+ super(InstanceGroup, __self__).__init__(
676
+ 'scaleway:autoscaling/instanceGroup:InstanceGroup',
677
+ resource_name,
678
+ __props__,
679
+ opts)
680
+
681
+ @staticmethod
682
+ def get(resource_name: str,
683
+ id: pulumi.Input[str],
684
+ opts: Optional[pulumi.ResourceOptions] = None,
685
+ capacities: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupCapacityArgs', 'InstanceGroupCapacityArgsDict']]]]] = None,
686
+ created_at: Optional[pulumi.Input[builtins.str]] = None,
687
+ delete_servers_on_destroy: Optional[pulumi.Input[builtins.bool]] = None,
688
+ load_balancers: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupLoadBalancerArgs', 'InstanceGroupLoadBalancerArgsDict']]]]] = None,
689
+ name: Optional[pulumi.Input[builtins.str]] = None,
690
+ project_id: Optional[pulumi.Input[builtins.str]] = None,
691
+ tags: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
692
+ template_id: Optional[pulumi.Input[builtins.str]] = None,
693
+ updated_at: Optional[pulumi.Input[builtins.str]] = None,
694
+ zone: Optional[pulumi.Input[builtins.str]] = None) -> 'InstanceGroup':
695
+ """
696
+ Get an existing InstanceGroup resource's state with the given name, id, and optional extra
697
+ properties used to qualify the lookup.
698
+
699
+ :param str resource_name: The unique name of the resulting resource.
700
+ :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
701
+ :param pulumi.ResourceOptions opts: Options for the resource.
702
+ :param pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupCapacityArgs', 'InstanceGroupCapacityArgsDict']]]] capacities: The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
703
+ :param pulumi.Input[builtins.str] created_at: Date and time of Instance group's creation (RFC 3339 format).
704
+ :param pulumi.Input[builtins.bool] delete_servers_on_destroy: 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.
705
+ :param pulumi.Input[Sequence[pulumi.Input[Union['InstanceGroupLoadBalancerArgs', 'InstanceGroupLoadBalancerArgsDict']]]] load_balancers: The specification of the Load Balancer to link to the Instance group.
706
+ :param pulumi.Input[builtins.str] name: The Instance group name.
707
+ :param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance group is associated with.
708
+ :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] tags: The tags associated with the Instance group.
709
+ :param pulumi.Input[builtins.str] template_id: The ID of the Instance template to attach to the Instance group.
710
+ :param pulumi.Input[builtins.str] updated_at: Date and time of Instance group's last update (RFC 3339 format).
711
+ :param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance group exists.
712
+ """
713
+ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
714
+
715
+ __props__ = _InstanceGroupState.__new__(_InstanceGroupState)
716
+
717
+ __props__.__dict__["capacities"] = capacities
718
+ __props__.__dict__["created_at"] = created_at
719
+ __props__.__dict__["delete_servers_on_destroy"] = delete_servers_on_destroy
720
+ __props__.__dict__["load_balancers"] = load_balancers
721
+ __props__.__dict__["name"] = name
722
+ __props__.__dict__["project_id"] = project_id
723
+ __props__.__dict__["tags"] = tags
724
+ __props__.__dict__["template_id"] = template_id
725
+ __props__.__dict__["updated_at"] = updated_at
726
+ __props__.__dict__["zone"] = zone
727
+ return InstanceGroup(resource_name, opts=opts, __props__=__props__)
728
+
729
+ @property
730
+ @pulumi.getter
731
+ def capacities(self) -> pulumi.Output[Sequence['outputs.InstanceGroupCapacity']]:
732
+ """
733
+ The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
734
+ """
735
+ return pulumi.get(self, "capacities")
736
+
737
+ @property
738
+ @pulumi.getter(name="createdAt")
739
+ def created_at(self) -> pulumi.Output[builtins.str]:
740
+ """
741
+ Date and time of Instance group's creation (RFC 3339 format).
742
+ """
743
+ return pulumi.get(self, "created_at")
744
+
745
+ @property
746
+ @pulumi.getter(name="deleteServersOnDestroy")
747
+ def delete_servers_on_destroy(self) -> pulumi.Output[Optional[builtins.bool]]:
748
+ """
749
+ 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.
750
+ """
751
+ return pulumi.get(self, "delete_servers_on_destroy")
752
+
753
+ @property
754
+ @pulumi.getter(name="loadBalancers")
755
+ def load_balancers(self) -> pulumi.Output[Sequence['outputs.InstanceGroupLoadBalancer']]:
756
+ """
757
+ The specification of the Load Balancer to link to the Instance group.
758
+ """
759
+ return pulumi.get(self, "load_balancers")
760
+
761
+ @property
762
+ @pulumi.getter
763
+ def name(self) -> pulumi.Output[builtins.str]:
764
+ """
765
+ The Instance group name.
766
+ """
767
+ return pulumi.get(self, "name")
768
+
769
+ @property
770
+ @pulumi.getter(name="projectId")
771
+ def project_id(self) -> pulumi.Output[builtins.str]:
772
+ """
773
+ `project_id`) The ID of the Project the Instance group is associated with.
774
+ """
775
+ return pulumi.get(self, "project_id")
776
+
777
+ @property
778
+ @pulumi.getter
779
+ def tags(self) -> pulumi.Output[Optional[Sequence[builtins.str]]]:
780
+ """
781
+ The tags associated with the Instance group.
782
+ """
783
+ return pulumi.get(self, "tags")
784
+
785
+ @property
786
+ @pulumi.getter(name="templateId")
787
+ def template_id(self) -> pulumi.Output[builtins.str]:
788
+ """
789
+ The ID of the Instance template to attach to the Instance group.
790
+ """
791
+ return pulumi.get(self, "template_id")
792
+
793
+ @property
794
+ @pulumi.getter(name="updatedAt")
795
+ def updated_at(self) -> pulumi.Output[builtins.str]:
796
+ """
797
+ Date and time of Instance group's last update (RFC 3339 format).
798
+ """
799
+ return pulumi.get(self, "updated_at")
800
+
801
+ @property
802
+ @pulumi.getter
803
+ def zone(self) -> pulumi.Output[builtins.str]:
804
+ """
805
+ `zone`) The zone in which the Instance group exists.
806
+ """
807
+ return pulumi.get(self, "zone")
808
+