pulumiverse-scaleway 1.30.0a1752168858__py3-none-any.whl → 1.31.0a1752171288__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.
- pulumiverse_scaleway/__init__.py +27 -0
- pulumiverse_scaleway/_inputs.py +94 -32
- pulumiverse_scaleway/apple_silicon_server.py +47 -0
- pulumiverse_scaleway/applesilicon/server.py +47 -0
- pulumiverse_scaleway/autoscaling/__init__.py +13 -0
- pulumiverse_scaleway/autoscaling/_inputs.py +559 -0
- pulumiverse_scaleway/autoscaling/instance_group.py +808 -0
- pulumiverse_scaleway/autoscaling/instance_policy.py +635 -0
- pulumiverse_scaleway/autoscaling/instance_template.py +879 -0
- pulumiverse_scaleway/autoscaling/outputs.py +439 -0
- pulumiverse_scaleway/edge_services_cache_stage.py +47 -0
- pulumiverse_scaleway/get_cockpit_source.py +50 -7
- pulumiverse_scaleway/get_kubernetes_node_pool.py +12 -1
- pulumiverse_scaleway/get_vpc.py +12 -1
- pulumiverse_scaleway/get_vpc_private_network.py +12 -1
- pulumiverse_scaleway/kubernetes/get_pool.py +12 -1
- pulumiverse_scaleway/kubernetes/pool.py +61 -0
- pulumiverse_scaleway/kubernetes_node_pool.py +61 -0
- pulumiverse_scaleway/loadbalancer_acl.py +7 -7
- pulumiverse_scaleway/loadbalancers/_inputs.py +51 -11
- pulumiverse_scaleway/loadbalancers/acl.py +7 -7
- pulumiverse_scaleway/loadbalancers/outputs.py +60 -10
- pulumiverse_scaleway/network/get_private_network.py +12 -1
- pulumiverse_scaleway/network/get_vpc.py +12 -1
- pulumiverse_scaleway/network/private_network.py +47 -0
- pulumiverse_scaleway/network/vpc.py +47 -0
- pulumiverse_scaleway/object/_inputs.py +43 -21
- pulumiverse_scaleway/object/bucket_acl.py +6 -4
- pulumiverse_scaleway/object/outputs.py +26 -12
- pulumiverse_scaleway/object_bucket_acl.py +6 -4
- pulumiverse_scaleway/observability/get_source.py +50 -7
- pulumiverse_scaleway/outputs.py +86 -22
- pulumiverse_scaleway/pulumi-plugin.json +1 -1
- pulumiverse_scaleway/vpc.py +47 -0
- pulumiverse_scaleway/vpc_private_network.py +47 -0
- {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0a1752171288.dist-info}/METADATA +1 -1
- {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0a1752171288.dist-info}/RECORD +39 -36
- pulumiverse_scaleway/elasticmetal/get_easy_partitioning.py +0 -177
- pulumiverse_scaleway/get_cockpit_plan.py +0 -94
- pulumiverse_scaleway/observability/get_plan.py +0 -90
- {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0a1752171288.dist-info}/WHEEL +0 -0
- {pulumiverse_scaleway-1.30.0a1752168858.dist-info → pulumiverse_scaleway-1.31.0a1752171288.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,635 @@
|
|
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__ = ['InstancePolicyArgs', 'InstancePolicy']
|
21
|
+
|
22
|
+
@pulumi.input_type
|
23
|
+
class InstancePolicyArgs:
|
24
|
+
def __init__(__self__, *,
|
25
|
+
action: pulumi.Input[builtins.str],
|
26
|
+
instance_group_id: pulumi.Input[builtins.str],
|
27
|
+
priority: pulumi.Input[builtins.int],
|
28
|
+
type: pulumi.Input[builtins.str],
|
29
|
+
value: pulumi.Input[builtins.int],
|
30
|
+
metrics: Optional[pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]]] = None,
|
31
|
+
name: Optional[pulumi.Input[builtins.str]] = None,
|
32
|
+
project_id: Optional[pulumi.Input[builtins.str]] = None,
|
33
|
+
zone: Optional[pulumi.Input[builtins.str]] = None):
|
34
|
+
"""
|
35
|
+
The set of arguments for constructing a InstancePolicy resource.
|
36
|
+
:param pulumi.Input[builtins.str] action: The action to execute when the metric-based condition is met.
|
37
|
+
:param pulumi.Input[builtins.str] instance_group_id: The ID of the Instance group related to this policy.
|
38
|
+
:param pulumi.Input[builtins.int] priority: The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
|
39
|
+
:param pulumi.Input[builtins.str] type: How to use the number defined in `value` when determining by how many Instances to scale up/down.
|
40
|
+
:param pulumi.Input[builtins.int] value: 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.
|
41
|
+
:param pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]] metrics: Cockpit metric to use when determining whether to trigger a scale up/down action.
|
42
|
+
:param pulumi.Input[builtins.str] name: The Instance policy name.
|
43
|
+
:param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance policy is associated with.
|
44
|
+
:param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance policy exists.
|
45
|
+
"""
|
46
|
+
pulumi.set(__self__, "action", action)
|
47
|
+
pulumi.set(__self__, "instance_group_id", instance_group_id)
|
48
|
+
pulumi.set(__self__, "priority", priority)
|
49
|
+
pulumi.set(__self__, "type", type)
|
50
|
+
pulumi.set(__self__, "value", value)
|
51
|
+
if metrics is not None:
|
52
|
+
pulumi.set(__self__, "metrics", metrics)
|
53
|
+
if name is not None:
|
54
|
+
pulumi.set(__self__, "name", name)
|
55
|
+
if project_id is not None:
|
56
|
+
pulumi.set(__self__, "project_id", project_id)
|
57
|
+
if zone is not None:
|
58
|
+
pulumi.set(__self__, "zone", zone)
|
59
|
+
|
60
|
+
@property
|
61
|
+
@pulumi.getter
|
62
|
+
def action(self) -> pulumi.Input[builtins.str]:
|
63
|
+
"""
|
64
|
+
The action to execute when the metric-based condition is met.
|
65
|
+
"""
|
66
|
+
return pulumi.get(self, "action")
|
67
|
+
|
68
|
+
@action.setter
|
69
|
+
def action(self, value: pulumi.Input[builtins.str]):
|
70
|
+
pulumi.set(self, "action", value)
|
71
|
+
|
72
|
+
@property
|
73
|
+
@pulumi.getter(name="instanceGroupId")
|
74
|
+
def instance_group_id(self) -> pulumi.Input[builtins.str]:
|
75
|
+
"""
|
76
|
+
The ID of the Instance group related to this policy.
|
77
|
+
"""
|
78
|
+
return pulumi.get(self, "instance_group_id")
|
79
|
+
|
80
|
+
@instance_group_id.setter
|
81
|
+
def instance_group_id(self, value: pulumi.Input[builtins.str]):
|
82
|
+
pulumi.set(self, "instance_group_id", value)
|
83
|
+
|
84
|
+
@property
|
85
|
+
@pulumi.getter
|
86
|
+
def priority(self) -> pulumi.Input[builtins.int]:
|
87
|
+
"""
|
88
|
+
The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
|
89
|
+
"""
|
90
|
+
return pulumi.get(self, "priority")
|
91
|
+
|
92
|
+
@priority.setter
|
93
|
+
def priority(self, value: pulumi.Input[builtins.int]):
|
94
|
+
pulumi.set(self, "priority", value)
|
95
|
+
|
96
|
+
@property
|
97
|
+
@pulumi.getter
|
98
|
+
def type(self) -> pulumi.Input[builtins.str]:
|
99
|
+
"""
|
100
|
+
How to use the number defined in `value` when determining by how many Instances to scale up/down.
|
101
|
+
"""
|
102
|
+
return pulumi.get(self, "type")
|
103
|
+
|
104
|
+
@type.setter
|
105
|
+
def type(self, value: pulumi.Input[builtins.str]):
|
106
|
+
pulumi.set(self, "type", value)
|
107
|
+
|
108
|
+
@property
|
109
|
+
@pulumi.getter
|
110
|
+
def value(self) -> pulumi.Input[builtins.int]:
|
111
|
+
"""
|
112
|
+
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.
|
113
|
+
"""
|
114
|
+
return pulumi.get(self, "value")
|
115
|
+
|
116
|
+
@value.setter
|
117
|
+
def value(self, value: pulumi.Input[builtins.int]):
|
118
|
+
pulumi.set(self, "value", value)
|
119
|
+
|
120
|
+
@property
|
121
|
+
@pulumi.getter
|
122
|
+
def metrics(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]]]:
|
123
|
+
"""
|
124
|
+
Cockpit metric to use when determining whether to trigger a scale up/down action.
|
125
|
+
"""
|
126
|
+
return pulumi.get(self, "metrics")
|
127
|
+
|
128
|
+
@metrics.setter
|
129
|
+
def metrics(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]]]):
|
130
|
+
pulumi.set(self, "metrics", value)
|
131
|
+
|
132
|
+
@property
|
133
|
+
@pulumi.getter
|
134
|
+
def name(self) -> Optional[pulumi.Input[builtins.str]]:
|
135
|
+
"""
|
136
|
+
The Instance policy name.
|
137
|
+
"""
|
138
|
+
return pulumi.get(self, "name")
|
139
|
+
|
140
|
+
@name.setter
|
141
|
+
def name(self, value: Optional[pulumi.Input[builtins.str]]):
|
142
|
+
pulumi.set(self, "name", value)
|
143
|
+
|
144
|
+
@property
|
145
|
+
@pulumi.getter(name="projectId")
|
146
|
+
def project_id(self) -> Optional[pulumi.Input[builtins.str]]:
|
147
|
+
"""
|
148
|
+
`project_id`) The ID of the Project the Instance policy is associated with.
|
149
|
+
"""
|
150
|
+
return pulumi.get(self, "project_id")
|
151
|
+
|
152
|
+
@project_id.setter
|
153
|
+
def project_id(self, value: Optional[pulumi.Input[builtins.str]]):
|
154
|
+
pulumi.set(self, "project_id", value)
|
155
|
+
|
156
|
+
@property
|
157
|
+
@pulumi.getter
|
158
|
+
def zone(self) -> Optional[pulumi.Input[builtins.str]]:
|
159
|
+
"""
|
160
|
+
`zone`) The zone in which the Instance policy exists.
|
161
|
+
"""
|
162
|
+
return pulumi.get(self, "zone")
|
163
|
+
|
164
|
+
@zone.setter
|
165
|
+
def zone(self, value: Optional[pulumi.Input[builtins.str]]):
|
166
|
+
pulumi.set(self, "zone", value)
|
167
|
+
|
168
|
+
|
169
|
+
@pulumi.input_type
|
170
|
+
class _InstancePolicyState:
|
171
|
+
def __init__(__self__, *,
|
172
|
+
action: Optional[pulumi.Input[builtins.str]] = None,
|
173
|
+
instance_group_id: Optional[pulumi.Input[builtins.str]] = None,
|
174
|
+
metrics: Optional[pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]]] = None,
|
175
|
+
name: Optional[pulumi.Input[builtins.str]] = None,
|
176
|
+
priority: Optional[pulumi.Input[builtins.int]] = None,
|
177
|
+
project_id: Optional[pulumi.Input[builtins.str]] = None,
|
178
|
+
type: Optional[pulumi.Input[builtins.str]] = None,
|
179
|
+
value: Optional[pulumi.Input[builtins.int]] = None,
|
180
|
+
zone: Optional[pulumi.Input[builtins.str]] = None):
|
181
|
+
"""
|
182
|
+
Input properties used for looking up and filtering InstancePolicy resources.
|
183
|
+
:param pulumi.Input[builtins.str] action: The action to execute when the metric-based condition is met.
|
184
|
+
:param pulumi.Input[builtins.str] instance_group_id: The ID of the Instance group related to this policy.
|
185
|
+
:param pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]] metrics: Cockpit metric to use when determining whether to trigger a scale up/down action.
|
186
|
+
:param pulumi.Input[builtins.str] name: The Instance policy name.
|
187
|
+
:param pulumi.Input[builtins.int] priority: The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
|
188
|
+
:param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance policy is associated with.
|
189
|
+
:param pulumi.Input[builtins.str] type: How to use the number defined in `value` when determining by how many Instances to scale up/down.
|
190
|
+
:param pulumi.Input[builtins.int] value: 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.
|
191
|
+
:param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance policy exists.
|
192
|
+
"""
|
193
|
+
if action is not None:
|
194
|
+
pulumi.set(__self__, "action", action)
|
195
|
+
if instance_group_id is not None:
|
196
|
+
pulumi.set(__self__, "instance_group_id", instance_group_id)
|
197
|
+
if metrics is not None:
|
198
|
+
pulumi.set(__self__, "metrics", metrics)
|
199
|
+
if name is not None:
|
200
|
+
pulumi.set(__self__, "name", name)
|
201
|
+
if priority is not None:
|
202
|
+
pulumi.set(__self__, "priority", priority)
|
203
|
+
if project_id is not None:
|
204
|
+
pulumi.set(__self__, "project_id", project_id)
|
205
|
+
if type is not None:
|
206
|
+
pulumi.set(__self__, "type", type)
|
207
|
+
if value is not None:
|
208
|
+
pulumi.set(__self__, "value", value)
|
209
|
+
if zone is not None:
|
210
|
+
pulumi.set(__self__, "zone", zone)
|
211
|
+
|
212
|
+
@property
|
213
|
+
@pulumi.getter
|
214
|
+
def action(self) -> Optional[pulumi.Input[builtins.str]]:
|
215
|
+
"""
|
216
|
+
The action to execute when the metric-based condition is met.
|
217
|
+
"""
|
218
|
+
return pulumi.get(self, "action")
|
219
|
+
|
220
|
+
@action.setter
|
221
|
+
def action(self, value: Optional[pulumi.Input[builtins.str]]):
|
222
|
+
pulumi.set(self, "action", value)
|
223
|
+
|
224
|
+
@property
|
225
|
+
@pulumi.getter(name="instanceGroupId")
|
226
|
+
def instance_group_id(self) -> Optional[pulumi.Input[builtins.str]]:
|
227
|
+
"""
|
228
|
+
The ID of the Instance group related to this policy.
|
229
|
+
"""
|
230
|
+
return pulumi.get(self, "instance_group_id")
|
231
|
+
|
232
|
+
@instance_group_id.setter
|
233
|
+
def instance_group_id(self, value: Optional[pulumi.Input[builtins.str]]):
|
234
|
+
pulumi.set(self, "instance_group_id", value)
|
235
|
+
|
236
|
+
@property
|
237
|
+
@pulumi.getter
|
238
|
+
def metrics(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]]]:
|
239
|
+
"""
|
240
|
+
Cockpit metric to use when determining whether to trigger a scale up/down action.
|
241
|
+
"""
|
242
|
+
return pulumi.get(self, "metrics")
|
243
|
+
|
244
|
+
@metrics.setter
|
245
|
+
def metrics(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['InstancePolicyMetricArgs']]]]):
|
246
|
+
pulumi.set(self, "metrics", value)
|
247
|
+
|
248
|
+
@property
|
249
|
+
@pulumi.getter
|
250
|
+
def name(self) -> Optional[pulumi.Input[builtins.str]]:
|
251
|
+
"""
|
252
|
+
The Instance policy name.
|
253
|
+
"""
|
254
|
+
return pulumi.get(self, "name")
|
255
|
+
|
256
|
+
@name.setter
|
257
|
+
def name(self, value: Optional[pulumi.Input[builtins.str]]):
|
258
|
+
pulumi.set(self, "name", value)
|
259
|
+
|
260
|
+
@property
|
261
|
+
@pulumi.getter
|
262
|
+
def priority(self) -> Optional[pulumi.Input[builtins.int]]:
|
263
|
+
"""
|
264
|
+
The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
|
265
|
+
"""
|
266
|
+
return pulumi.get(self, "priority")
|
267
|
+
|
268
|
+
@priority.setter
|
269
|
+
def priority(self, value: Optional[pulumi.Input[builtins.int]]):
|
270
|
+
pulumi.set(self, "priority", value)
|
271
|
+
|
272
|
+
@property
|
273
|
+
@pulumi.getter(name="projectId")
|
274
|
+
def project_id(self) -> Optional[pulumi.Input[builtins.str]]:
|
275
|
+
"""
|
276
|
+
`project_id`) The ID of the Project the Instance policy is associated with.
|
277
|
+
"""
|
278
|
+
return pulumi.get(self, "project_id")
|
279
|
+
|
280
|
+
@project_id.setter
|
281
|
+
def project_id(self, value: Optional[pulumi.Input[builtins.str]]):
|
282
|
+
pulumi.set(self, "project_id", value)
|
283
|
+
|
284
|
+
@property
|
285
|
+
@pulumi.getter
|
286
|
+
def type(self) -> Optional[pulumi.Input[builtins.str]]:
|
287
|
+
"""
|
288
|
+
How to use the number defined in `value` when determining by how many Instances to scale up/down.
|
289
|
+
"""
|
290
|
+
return pulumi.get(self, "type")
|
291
|
+
|
292
|
+
@type.setter
|
293
|
+
def type(self, value: Optional[pulumi.Input[builtins.str]]):
|
294
|
+
pulumi.set(self, "type", value)
|
295
|
+
|
296
|
+
@property
|
297
|
+
@pulumi.getter
|
298
|
+
def value(self) -> Optional[pulumi.Input[builtins.int]]:
|
299
|
+
"""
|
300
|
+
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.
|
301
|
+
"""
|
302
|
+
return pulumi.get(self, "value")
|
303
|
+
|
304
|
+
@value.setter
|
305
|
+
def value(self, value: Optional[pulumi.Input[builtins.int]]):
|
306
|
+
pulumi.set(self, "value", value)
|
307
|
+
|
308
|
+
@property
|
309
|
+
@pulumi.getter
|
310
|
+
def zone(self) -> Optional[pulumi.Input[builtins.str]]:
|
311
|
+
"""
|
312
|
+
`zone`) The zone in which the Instance policy exists.
|
313
|
+
"""
|
314
|
+
return pulumi.get(self, "zone")
|
315
|
+
|
316
|
+
@zone.setter
|
317
|
+
def zone(self, value: Optional[pulumi.Input[builtins.str]]):
|
318
|
+
pulumi.set(self, "zone", value)
|
319
|
+
|
320
|
+
|
321
|
+
@pulumi.type_token("scaleway:autoscaling/instancePolicy:InstancePolicy")
|
322
|
+
class InstancePolicy(pulumi.CustomResource):
|
323
|
+
@overload
|
324
|
+
def __init__(__self__,
|
325
|
+
resource_name: str,
|
326
|
+
opts: Optional[pulumi.ResourceOptions] = None,
|
327
|
+
action: Optional[pulumi.Input[builtins.str]] = None,
|
328
|
+
instance_group_id: Optional[pulumi.Input[builtins.str]] = None,
|
329
|
+
metrics: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstancePolicyMetricArgs', 'InstancePolicyMetricArgsDict']]]]] = None,
|
330
|
+
name: Optional[pulumi.Input[builtins.str]] = None,
|
331
|
+
priority: Optional[pulumi.Input[builtins.int]] = None,
|
332
|
+
project_id: Optional[pulumi.Input[builtins.str]] = None,
|
333
|
+
type: Optional[pulumi.Input[builtins.str]] = None,
|
334
|
+
value: Optional[pulumi.Input[builtins.int]] = None,
|
335
|
+
zone: Optional[pulumi.Input[builtins.str]] = None,
|
336
|
+
__props__=None):
|
337
|
+
"""
|
338
|
+
Books and manages Autoscaling Instance policies.
|
339
|
+
|
340
|
+
## Example Usage
|
341
|
+
|
342
|
+
### Basic
|
343
|
+
|
344
|
+
```python
|
345
|
+
import pulumi
|
346
|
+
import pulumiverse_scaleway as scaleway
|
347
|
+
|
348
|
+
up = scaleway.autoscaling.InstancePolicy("up",
|
349
|
+
instance_group_id=main["id"],
|
350
|
+
name="scale-up-if-cpu-high",
|
351
|
+
action="scale_up",
|
352
|
+
type="flat_count",
|
353
|
+
value=1,
|
354
|
+
priority=1,
|
355
|
+
metrics=[{
|
356
|
+
"name": "cpu scale up",
|
357
|
+
"managed_metric": "managed_metric_instance_cpu",
|
358
|
+
"operator": "operator_greater_than",
|
359
|
+
"aggregate": "aggregate_average",
|
360
|
+
"sampling_range_min": 5,
|
361
|
+
"threshold": 70,
|
362
|
+
}])
|
363
|
+
down = scaleway.autoscaling.InstancePolicy("down",
|
364
|
+
instance_group_id=main["id"],
|
365
|
+
name="scale-down-if-cpu-low",
|
366
|
+
action="scale_down",
|
367
|
+
type="flat_count",
|
368
|
+
value=1,
|
369
|
+
priority=2,
|
370
|
+
metrics=[{
|
371
|
+
"name": "cpu scale down",
|
372
|
+
"managed_metric": "managed_metric_instance_cpu",
|
373
|
+
"operator": "operator_less_than",
|
374
|
+
"aggregate": "aggregate_average",
|
375
|
+
"sampling_range_min": 5,
|
376
|
+
"threshold": 40,
|
377
|
+
}])
|
378
|
+
```
|
379
|
+
|
380
|
+
## Import
|
381
|
+
|
382
|
+
Autoscaling instance policies can be imported using `{zone}/{id}`, e.g.
|
383
|
+
|
384
|
+
bash
|
385
|
+
|
386
|
+
```sh
|
387
|
+
$ pulumi import scaleway:autoscaling/instancePolicy:InstancePolicy main fr-par-1/11111111-1111-1111-1111-111111111111
|
388
|
+
```
|
389
|
+
|
390
|
+
:param str resource_name: The name of the resource.
|
391
|
+
:param pulumi.ResourceOptions opts: Options for the resource.
|
392
|
+
:param pulumi.Input[builtins.str] action: The action to execute when the metric-based condition is met.
|
393
|
+
:param pulumi.Input[builtins.str] instance_group_id: The ID of the Instance group related to this policy.
|
394
|
+
:param pulumi.Input[Sequence[pulumi.Input[Union['InstancePolicyMetricArgs', 'InstancePolicyMetricArgsDict']]]] metrics: Cockpit metric to use when determining whether to trigger a scale up/down action.
|
395
|
+
:param pulumi.Input[builtins.str] name: The Instance policy name.
|
396
|
+
:param pulumi.Input[builtins.int] priority: The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
|
397
|
+
:param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance policy is associated with.
|
398
|
+
:param pulumi.Input[builtins.str] type: How to use the number defined in `value` when determining by how many Instances to scale up/down.
|
399
|
+
:param pulumi.Input[builtins.int] value: 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.
|
400
|
+
:param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance policy exists.
|
401
|
+
"""
|
402
|
+
...
|
403
|
+
@overload
|
404
|
+
def __init__(__self__,
|
405
|
+
resource_name: str,
|
406
|
+
args: InstancePolicyArgs,
|
407
|
+
opts: Optional[pulumi.ResourceOptions] = None):
|
408
|
+
"""
|
409
|
+
Books and manages Autoscaling Instance policies.
|
410
|
+
|
411
|
+
## Example Usage
|
412
|
+
|
413
|
+
### Basic
|
414
|
+
|
415
|
+
```python
|
416
|
+
import pulumi
|
417
|
+
import pulumiverse_scaleway as scaleway
|
418
|
+
|
419
|
+
up = scaleway.autoscaling.InstancePolicy("up",
|
420
|
+
instance_group_id=main["id"],
|
421
|
+
name="scale-up-if-cpu-high",
|
422
|
+
action="scale_up",
|
423
|
+
type="flat_count",
|
424
|
+
value=1,
|
425
|
+
priority=1,
|
426
|
+
metrics=[{
|
427
|
+
"name": "cpu scale up",
|
428
|
+
"managed_metric": "managed_metric_instance_cpu",
|
429
|
+
"operator": "operator_greater_than",
|
430
|
+
"aggregate": "aggregate_average",
|
431
|
+
"sampling_range_min": 5,
|
432
|
+
"threshold": 70,
|
433
|
+
}])
|
434
|
+
down = scaleway.autoscaling.InstancePolicy("down",
|
435
|
+
instance_group_id=main["id"],
|
436
|
+
name="scale-down-if-cpu-low",
|
437
|
+
action="scale_down",
|
438
|
+
type="flat_count",
|
439
|
+
value=1,
|
440
|
+
priority=2,
|
441
|
+
metrics=[{
|
442
|
+
"name": "cpu scale down",
|
443
|
+
"managed_metric": "managed_metric_instance_cpu",
|
444
|
+
"operator": "operator_less_than",
|
445
|
+
"aggregate": "aggregate_average",
|
446
|
+
"sampling_range_min": 5,
|
447
|
+
"threshold": 40,
|
448
|
+
}])
|
449
|
+
```
|
450
|
+
|
451
|
+
## Import
|
452
|
+
|
453
|
+
Autoscaling instance policies can be imported using `{zone}/{id}`, e.g.
|
454
|
+
|
455
|
+
bash
|
456
|
+
|
457
|
+
```sh
|
458
|
+
$ pulumi import scaleway:autoscaling/instancePolicy:InstancePolicy main fr-par-1/11111111-1111-1111-1111-111111111111
|
459
|
+
```
|
460
|
+
|
461
|
+
:param str resource_name: The name of the resource.
|
462
|
+
:param InstancePolicyArgs args: The arguments to use to populate this resource's properties.
|
463
|
+
:param pulumi.ResourceOptions opts: Options for the resource.
|
464
|
+
"""
|
465
|
+
...
|
466
|
+
def __init__(__self__, resource_name: str, *args, **kwargs):
|
467
|
+
resource_args, opts = _utilities.get_resource_args_opts(InstancePolicyArgs, pulumi.ResourceOptions, *args, **kwargs)
|
468
|
+
if resource_args is not None:
|
469
|
+
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
|
470
|
+
else:
|
471
|
+
__self__._internal_init(resource_name, *args, **kwargs)
|
472
|
+
|
473
|
+
def _internal_init(__self__,
|
474
|
+
resource_name: str,
|
475
|
+
opts: Optional[pulumi.ResourceOptions] = None,
|
476
|
+
action: Optional[pulumi.Input[builtins.str]] = None,
|
477
|
+
instance_group_id: Optional[pulumi.Input[builtins.str]] = None,
|
478
|
+
metrics: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstancePolicyMetricArgs', 'InstancePolicyMetricArgsDict']]]]] = None,
|
479
|
+
name: Optional[pulumi.Input[builtins.str]] = None,
|
480
|
+
priority: Optional[pulumi.Input[builtins.int]] = None,
|
481
|
+
project_id: Optional[pulumi.Input[builtins.str]] = None,
|
482
|
+
type: Optional[pulumi.Input[builtins.str]] = None,
|
483
|
+
value: Optional[pulumi.Input[builtins.int]] = None,
|
484
|
+
zone: Optional[pulumi.Input[builtins.str]] = None,
|
485
|
+
__props__=None):
|
486
|
+
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
487
|
+
if not isinstance(opts, pulumi.ResourceOptions):
|
488
|
+
raise TypeError('Expected resource options to be a ResourceOptions instance')
|
489
|
+
if opts.id is None:
|
490
|
+
if __props__ is not None:
|
491
|
+
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
|
492
|
+
__props__ = InstancePolicyArgs.__new__(InstancePolicyArgs)
|
493
|
+
|
494
|
+
if action is None and not opts.urn:
|
495
|
+
raise TypeError("Missing required property 'action'")
|
496
|
+
__props__.__dict__["action"] = action
|
497
|
+
if instance_group_id is None and not opts.urn:
|
498
|
+
raise TypeError("Missing required property 'instance_group_id'")
|
499
|
+
__props__.__dict__["instance_group_id"] = instance_group_id
|
500
|
+
__props__.__dict__["metrics"] = metrics
|
501
|
+
__props__.__dict__["name"] = name
|
502
|
+
if priority is None and not opts.urn:
|
503
|
+
raise TypeError("Missing required property 'priority'")
|
504
|
+
__props__.__dict__["priority"] = priority
|
505
|
+
__props__.__dict__["project_id"] = project_id
|
506
|
+
if type is None and not opts.urn:
|
507
|
+
raise TypeError("Missing required property 'type'")
|
508
|
+
__props__.__dict__["type"] = type
|
509
|
+
if value is None and not opts.urn:
|
510
|
+
raise TypeError("Missing required property 'value'")
|
511
|
+
__props__.__dict__["value"] = value
|
512
|
+
__props__.__dict__["zone"] = zone
|
513
|
+
super(InstancePolicy, __self__).__init__(
|
514
|
+
'scaleway:autoscaling/instancePolicy:InstancePolicy',
|
515
|
+
resource_name,
|
516
|
+
__props__,
|
517
|
+
opts)
|
518
|
+
|
519
|
+
@staticmethod
|
520
|
+
def get(resource_name: str,
|
521
|
+
id: pulumi.Input[str],
|
522
|
+
opts: Optional[pulumi.ResourceOptions] = None,
|
523
|
+
action: Optional[pulumi.Input[builtins.str]] = None,
|
524
|
+
instance_group_id: Optional[pulumi.Input[builtins.str]] = None,
|
525
|
+
metrics: Optional[pulumi.Input[Sequence[pulumi.Input[Union['InstancePolicyMetricArgs', 'InstancePolicyMetricArgsDict']]]]] = None,
|
526
|
+
name: Optional[pulumi.Input[builtins.str]] = None,
|
527
|
+
priority: Optional[pulumi.Input[builtins.int]] = None,
|
528
|
+
project_id: Optional[pulumi.Input[builtins.str]] = None,
|
529
|
+
type: Optional[pulumi.Input[builtins.str]] = None,
|
530
|
+
value: Optional[pulumi.Input[builtins.int]] = None,
|
531
|
+
zone: Optional[pulumi.Input[builtins.str]] = None) -> 'InstancePolicy':
|
532
|
+
"""
|
533
|
+
Get an existing InstancePolicy resource's state with the given name, id, and optional extra
|
534
|
+
properties used to qualify the lookup.
|
535
|
+
|
536
|
+
:param str resource_name: The unique name of the resulting resource.
|
537
|
+
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
538
|
+
:param pulumi.ResourceOptions opts: Options for the resource.
|
539
|
+
:param pulumi.Input[builtins.str] action: The action to execute when the metric-based condition is met.
|
540
|
+
:param pulumi.Input[builtins.str] instance_group_id: The ID of the Instance group related to this policy.
|
541
|
+
:param pulumi.Input[Sequence[pulumi.Input[Union['InstancePolicyMetricArgs', 'InstancePolicyMetricArgsDict']]]] metrics: Cockpit metric to use when determining whether to trigger a scale up/down action.
|
542
|
+
:param pulumi.Input[builtins.str] name: The Instance policy name.
|
543
|
+
:param pulumi.Input[builtins.int] priority: The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
|
544
|
+
:param pulumi.Input[builtins.str] project_id: `project_id`) The ID of the Project the Instance policy is associated with.
|
545
|
+
:param pulumi.Input[builtins.str] type: How to use the number defined in `value` when determining by how many Instances to scale up/down.
|
546
|
+
:param pulumi.Input[builtins.int] value: 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.
|
547
|
+
:param pulumi.Input[builtins.str] zone: `zone`) The zone in which the Instance policy exists.
|
548
|
+
"""
|
549
|
+
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
550
|
+
|
551
|
+
__props__ = _InstancePolicyState.__new__(_InstancePolicyState)
|
552
|
+
|
553
|
+
__props__.__dict__["action"] = action
|
554
|
+
__props__.__dict__["instance_group_id"] = instance_group_id
|
555
|
+
__props__.__dict__["metrics"] = metrics
|
556
|
+
__props__.__dict__["name"] = name
|
557
|
+
__props__.__dict__["priority"] = priority
|
558
|
+
__props__.__dict__["project_id"] = project_id
|
559
|
+
__props__.__dict__["type"] = type
|
560
|
+
__props__.__dict__["value"] = value
|
561
|
+
__props__.__dict__["zone"] = zone
|
562
|
+
return InstancePolicy(resource_name, opts=opts, __props__=__props__)
|
563
|
+
|
564
|
+
@property
|
565
|
+
@pulumi.getter
|
566
|
+
def action(self) -> pulumi.Output[builtins.str]:
|
567
|
+
"""
|
568
|
+
The action to execute when the metric-based condition is met.
|
569
|
+
"""
|
570
|
+
return pulumi.get(self, "action")
|
571
|
+
|
572
|
+
@property
|
573
|
+
@pulumi.getter(name="instanceGroupId")
|
574
|
+
def instance_group_id(self) -> pulumi.Output[builtins.str]:
|
575
|
+
"""
|
576
|
+
The ID of the Instance group related to this policy.
|
577
|
+
"""
|
578
|
+
return pulumi.get(self, "instance_group_id")
|
579
|
+
|
580
|
+
@property
|
581
|
+
@pulumi.getter
|
582
|
+
def metrics(self) -> pulumi.Output[Sequence['outputs.InstancePolicyMetric']]:
|
583
|
+
"""
|
584
|
+
Cockpit metric to use when determining whether to trigger a scale up/down action.
|
585
|
+
"""
|
586
|
+
return pulumi.get(self, "metrics")
|
587
|
+
|
588
|
+
@property
|
589
|
+
@pulumi.getter
|
590
|
+
def name(self) -> pulumi.Output[builtins.str]:
|
591
|
+
"""
|
592
|
+
The Instance policy name.
|
593
|
+
"""
|
594
|
+
return pulumi.get(self, "name")
|
595
|
+
|
596
|
+
@property
|
597
|
+
@pulumi.getter
|
598
|
+
def priority(self) -> pulumi.Output[builtins.int]:
|
599
|
+
"""
|
600
|
+
The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
|
601
|
+
"""
|
602
|
+
return pulumi.get(self, "priority")
|
603
|
+
|
604
|
+
@property
|
605
|
+
@pulumi.getter(name="projectId")
|
606
|
+
def project_id(self) -> pulumi.Output[builtins.str]:
|
607
|
+
"""
|
608
|
+
`project_id`) The ID of the Project the Instance policy is associated with.
|
609
|
+
"""
|
610
|
+
return pulumi.get(self, "project_id")
|
611
|
+
|
612
|
+
@property
|
613
|
+
@pulumi.getter
|
614
|
+
def type(self) -> pulumi.Output[builtins.str]:
|
615
|
+
"""
|
616
|
+
How to use the number defined in `value` when determining by how many Instances to scale up/down.
|
617
|
+
"""
|
618
|
+
return pulumi.get(self, "type")
|
619
|
+
|
620
|
+
@property
|
621
|
+
@pulumi.getter
|
622
|
+
def value(self) -> pulumi.Output[builtins.int]:
|
623
|
+
"""
|
624
|
+
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.
|
625
|
+
"""
|
626
|
+
return pulumi.get(self, "value")
|
627
|
+
|
628
|
+
@property
|
629
|
+
@pulumi.getter
|
630
|
+
def zone(self) -> pulumi.Output[builtins.str]:
|
631
|
+
"""
|
632
|
+
`zone`) The zone in which the Instance policy exists.
|
633
|
+
"""
|
634
|
+
return pulumi.get(self, "zone")
|
635
|
+
|