pulumi-hcloud 1.18.0a1709364097__py3-none-any.whl → 1.22.0a1736833581__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 (66) hide show
  1. pulumi_hcloud/__init__.py +2 -0
  2. pulumi_hcloud/_inputs.py +247 -15
  3. pulumi_hcloud/_utilities.py +41 -5
  4. pulumi_hcloud/certificate.py +15 -10
  5. pulumi_hcloud/config/__init__.pyi +5 -0
  6. pulumi_hcloud/config/vars.py +5 -0
  7. pulumi_hcloud/firewall.py +77 -66
  8. pulumi_hcloud/firewall_attachment.py +31 -18
  9. pulumi_hcloud/floating_ip.py +39 -32
  10. pulumi_hcloud/floating_ip_assignment.py +11 -4
  11. pulumi_hcloud/get_certificate.py +25 -6
  12. pulumi_hcloud/get_certificates.py +14 -5
  13. pulumi_hcloud/get_datacenter.py +38 -23
  14. pulumi_hcloud/get_datacenters.py +28 -53
  15. pulumi_hcloud/get_firewall.py +38 -19
  16. pulumi_hcloud/get_firewalls.py +16 -5
  17. pulumi_hcloud/get_floating_ip.py +39 -13
  18. pulumi_hcloud/get_floating_ips.py +14 -5
  19. pulumi_hcloud/get_image.py +37 -9
  20. pulumi_hcloud/get_images.py +22 -5
  21. pulumi_hcloud/get_load_balancer.py +30 -7
  22. pulumi_hcloud/get_load_balancer_type.py +202 -0
  23. pulumi_hcloud/get_load_balancer_types.py +100 -0
  24. pulumi_hcloud/get_load_balancers.py +14 -5
  25. pulumi_hcloud/get_location.py +42 -25
  26. pulumi_hcloud/get_locations.py +28 -53
  27. pulumi_hcloud/get_network.py +28 -11
  28. pulumi_hcloud/get_networks.py +14 -5
  29. pulumi_hcloud/get_placement_group.py +31 -13
  30. pulumi_hcloud/get_placement_groups.py +16 -5
  31. pulumi_hcloud/get_primary_ip.py +44 -18
  32. pulumi_hcloud/get_primary_ips.py +14 -5
  33. pulumi_hcloud/get_server.py +43 -11
  34. pulumi_hcloud/get_server_type.py +75 -49
  35. pulumi_hcloud/get_server_types.py +39 -23
  36. pulumi_hcloud/get_servers.py +16 -5
  37. pulumi_hcloud/get_ssh_key.py +58 -32
  38. pulumi_hcloud/get_ssh_keys.py +35 -20
  39. pulumi_hcloud/get_volume.py +33 -12
  40. pulumi_hcloud/get_volumes.py +18 -7
  41. pulumi_hcloud/load_balancer.py +63 -60
  42. pulumi_hcloud/load_balancer_network.py +28 -15
  43. pulumi_hcloud/load_balancer_service.py +59 -52
  44. pulumi_hcloud/load_balancer_target.py +33 -24
  45. pulumi_hcloud/managed_certificate.py +57 -20
  46. pulumi_hcloud/network.py +27 -18
  47. pulumi_hcloud/network_route.py +15 -6
  48. pulumi_hcloud/network_subnet.py +15 -6
  49. pulumi_hcloud/outputs.py +265 -46
  50. pulumi_hcloud/placement_group.py +27 -18
  51. pulumi_hcloud/primary_ip.py +66 -43
  52. pulumi_hcloud/provider.py +5 -0
  53. pulumi_hcloud/pulumi-plugin.json +2 -1
  54. pulumi_hcloud/rdns.py +51 -34
  55. pulumi_hcloud/server.py +185 -130
  56. pulumi_hcloud/server_network.py +26 -15
  57. pulumi_hcloud/snapshot.py +25 -18
  58. pulumi_hcloud/ssh_key.py +52 -47
  59. pulumi_hcloud/uploaded_certificate.py +73 -20
  60. pulumi_hcloud/volume.py +37 -28
  61. pulumi_hcloud/volume_attachment.py +11 -4
  62. {pulumi_hcloud-1.18.0a1709364097.dist-info → pulumi_hcloud-1.22.0a1736833581.dist-info}/METADATA +7 -6
  63. pulumi_hcloud-1.22.0a1736833581.dist-info/RECORD +67 -0
  64. {pulumi_hcloud-1.18.0a1709364097.dist-info → pulumi_hcloud-1.22.0a1736833581.dist-info}/WHEEL +1 -1
  65. pulumi_hcloud-1.18.0a1709364097.dist-info/RECORD +0 -65
  66. {pulumi_hcloud-1.18.0a1709364097.dist-info → pulumi_hcloud-1.22.0a1736833581.dist-info}/top_level.txt +0 -0
pulumi_hcloud/firewall.py CHANGED
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
  from . import outputs
12
17
  from ._inputs import *
@@ -17,13 +22,13 @@ __all__ = ['FirewallArgs', 'Firewall']
17
22
  class FirewallArgs:
18
23
  def __init__(__self__, *,
19
24
  apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input['FirewallApplyToArgs']]]] = None,
20
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
25
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
21
26
  name: Optional[pulumi.Input[str]] = None,
22
27
  rules: Optional[pulumi.Input[Sequence[pulumi.Input['FirewallRuleArgs']]]] = None):
23
28
  """
24
29
  The set of arguments for constructing a Firewall resource.
25
30
  :param pulumi.Input[Sequence[pulumi.Input['FirewallApplyToArgs']]] apply_tos: Resources the firewall should be assigned to
26
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
31
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
27
32
  :param pulumi.Input[str] name: Name of the Firewall.
28
33
  :param pulumi.Input[Sequence[pulumi.Input['FirewallRuleArgs']]] rules: Configuration of a Rule from this Firewall.
29
34
  """
@@ -50,14 +55,14 @@ class FirewallArgs:
50
55
 
51
56
  @property
52
57
  @pulumi.getter
53
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
58
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
54
59
  """
55
60
  User-defined labels (key-value pairs) should be created with.
56
61
  """
57
62
  return pulumi.get(self, "labels")
58
63
 
59
64
  @labels.setter
60
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
65
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
61
66
  pulumi.set(self, "labels", value)
62
67
 
63
68
  @property
@@ -89,13 +94,13 @@ class FirewallArgs:
89
94
  class _FirewallState:
90
95
  def __init__(__self__, *,
91
96
  apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input['FirewallApplyToArgs']]]] = None,
92
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
97
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
93
98
  name: Optional[pulumi.Input[str]] = None,
94
99
  rules: Optional[pulumi.Input[Sequence[pulumi.Input['FirewallRuleArgs']]]] = None):
95
100
  """
96
101
  Input properties used for looking up and filtering Firewall resources.
97
102
  :param pulumi.Input[Sequence[pulumi.Input['FirewallApplyToArgs']]] apply_tos: Resources the firewall should be assigned to
98
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
103
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
99
104
  :param pulumi.Input[str] name: Name of the Firewall.
100
105
  :param pulumi.Input[Sequence[pulumi.Input['FirewallRuleArgs']]] rules: Configuration of a Rule from this Firewall.
101
106
  """
@@ -122,14 +127,14 @@ class _FirewallState:
122
127
 
123
128
  @property
124
129
  @pulumi.getter
125
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
130
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
126
131
  """
127
132
  User-defined labels (key-value pairs) should be created with.
128
133
  """
129
134
  return pulumi.get(self, "labels")
130
135
 
131
136
  @labels.setter
132
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
137
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
133
138
  pulumi.set(self, "labels", value)
134
139
 
135
140
  @property
@@ -162,10 +167,10 @@ class Firewall(pulumi.CustomResource):
162
167
  def __init__(__self__,
163
168
  resource_name: str,
164
169
  opts: Optional[pulumi.ResourceOptions] = None,
165
- apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallApplyToArgs']]]]] = None,
166
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
170
+ apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input[Union['FirewallApplyToArgs', 'FirewallApplyToArgsDict']]]]] = None,
171
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
167
172
  name: Optional[pulumi.Input[str]] = None,
168
- rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallRuleArgs']]]]] = None,
173
+ rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['FirewallRuleArgs', 'FirewallRuleArgsDict']]]]] = None,
169
174
  __props__=None):
170
175
  """
171
176
  Provides a Hetzner Cloud Firewall to represent a Firewall in the Hetzner Cloud.
@@ -176,28 +181,31 @@ class Firewall(pulumi.CustomResource):
176
181
  import pulumi
177
182
  import pulumi_hcloud as hcloud
178
183
 
179
- myfirewall = hcloud.Firewall("myfirewall", rules=[
180
- hcloud.FirewallRuleArgs(
181
- direction="in",
182
- protocol="icmp",
183
- source_ips=[
184
- "0.0.0.0/0",
185
- "::/0",
186
- ],
187
- ),
188
- hcloud.FirewallRuleArgs(
189
- direction="in",
190
- protocol="tcp",
191
- port="80-85",
192
- source_ips=[
193
- "0.0.0.0/0",
194
- "::/0",
195
- ],
196
- ),
197
- ])
184
+ myfirewall = hcloud.Firewall("myfirewall",
185
+ name="my-firewall",
186
+ rules=[
187
+ {
188
+ "direction": "in",
189
+ "protocol": "icmp",
190
+ "source_ips": [
191
+ "0.0.0.0/0",
192
+ "::/0",
193
+ ],
194
+ },
195
+ {
196
+ "direction": "in",
197
+ "protocol": "tcp",
198
+ "port": "80-85",
199
+ "source_ips": [
200
+ "0.0.0.0/0",
201
+ "::/0",
202
+ ],
203
+ },
204
+ ])
198
205
  node1 = hcloud.Server("node1",
206
+ name="node1",
199
207
  image="debian-11",
200
- server_type="cx11",
208
+ server_type="cx22",
201
209
  firewall_ids=[myfirewall.id])
202
210
  ```
203
211
 
@@ -206,15 +214,15 @@ class Firewall(pulumi.CustomResource):
206
214
  Firewalls can be imported using its `id`:
207
215
 
208
216
  ```sh
209
- $ pulumi import hcloud:index/firewall:Firewall myfirewall id
217
+ $ pulumi import hcloud:index/firewall:Firewall example "$FIREWALL_ID"
210
218
  ```
211
219
 
212
220
  :param str resource_name: The name of the resource.
213
221
  :param pulumi.ResourceOptions opts: Options for the resource.
214
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallApplyToArgs']]]] apply_tos: Resources the firewall should be assigned to
215
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
222
+ :param pulumi.Input[Sequence[pulumi.Input[Union['FirewallApplyToArgs', 'FirewallApplyToArgsDict']]]] apply_tos: Resources the firewall should be assigned to
223
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
216
224
  :param pulumi.Input[str] name: Name of the Firewall.
217
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallRuleArgs']]]] rules: Configuration of a Rule from this Firewall.
225
+ :param pulumi.Input[Sequence[pulumi.Input[Union['FirewallRuleArgs', 'FirewallRuleArgsDict']]]] rules: Configuration of a Rule from this Firewall.
218
226
  """
219
227
  ...
220
228
  @overload
@@ -231,28 +239,31 @@ class Firewall(pulumi.CustomResource):
231
239
  import pulumi
232
240
  import pulumi_hcloud as hcloud
233
241
 
234
- myfirewall = hcloud.Firewall("myfirewall", rules=[
235
- hcloud.FirewallRuleArgs(
236
- direction="in",
237
- protocol="icmp",
238
- source_ips=[
239
- "0.0.0.0/0",
240
- "::/0",
241
- ],
242
- ),
243
- hcloud.FirewallRuleArgs(
244
- direction="in",
245
- protocol="tcp",
246
- port="80-85",
247
- source_ips=[
248
- "0.0.0.0/0",
249
- "::/0",
250
- ],
251
- ),
252
- ])
242
+ myfirewall = hcloud.Firewall("myfirewall",
243
+ name="my-firewall",
244
+ rules=[
245
+ {
246
+ "direction": "in",
247
+ "protocol": "icmp",
248
+ "source_ips": [
249
+ "0.0.0.0/0",
250
+ "::/0",
251
+ ],
252
+ },
253
+ {
254
+ "direction": "in",
255
+ "protocol": "tcp",
256
+ "port": "80-85",
257
+ "source_ips": [
258
+ "0.0.0.0/0",
259
+ "::/0",
260
+ ],
261
+ },
262
+ ])
253
263
  node1 = hcloud.Server("node1",
264
+ name="node1",
254
265
  image="debian-11",
255
- server_type="cx11",
266
+ server_type="cx22",
256
267
  firewall_ids=[myfirewall.id])
257
268
  ```
258
269
 
@@ -261,7 +272,7 @@ class Firewall(pulumi.CustomResource):
261
272
  Firewalls can be imported using its `id`:
262
273
 
263
274
  ```sh
264
- $ pulumi import hcloud:index/firewall:Firewall myfirewall id
275
+ $ pulumi import hcloud:index/firewall:Firewall example "$FIREWALL_ID"
265
276
  ```
266
277
 
267
278
  :param str resource_name: The name of the resource.
@@ -279,10 +290,10 @@ class Firewall(pulumi.CustomResource):
279
290
  def _internal_init(__self__,
280
291
  resource_name: str,
281
292
  opts: Optional[pulumi.ResourceOptions] = None,
282
- apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallApplyToArgs']]]]] = None,
283
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
293
+ apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input[Union['FirewallApplyToArgs', 'FirewallApplyToArgsDict']]]]] = None,
294
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
284
295
  name: Optional[pulumi.Input[str]] = None,
285
- rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallRuleArgs']]]]] = None,
296
+ rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['FirewallRuleArgs', 'FirewallRuleArgsDict']]]]] = None,
286
297
  __props__=None):
287
298
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
288
299
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -306,10 +317,10 @@ class Firewall(pulumi.CustomResource):
306
317
  def get(resource_name: str,
307
318
  id: pulumi.Input[str],
308
319
  opts: Optional[pulumi.ResourceOptions] = None,
309
- apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallApplyToArgs']]]]] = None,
310
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
320
+ apply_tos: Optional[pulumi.Input[Sequence[pulumi.Input[Union['FirewallApplyToArgs', 'FirewallApplyToArgsDict']]]]] = None,
321
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
311
322
  name: Optional[pulumi.Input[str]] = None,
312
- rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallRuleArgs']]]]] = None) -> 'Firewall':
323
+ rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['FirewallRuleArgs', 'FirewallRuleArgsDict']]]]] = None) -> 'Firewall':
313
324
  """
314
325
  Get an existing Firewall resource's state with the given name, id, and optional extra
315
326
  properties used to qualify the lookup.
@@ -317,10 +328,10 @@ class Firewall(pulumi.CustomResource):
317
328
  :param str resource_name: The unique name of the resulting resource.
318
329
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
319
330
  :param pulumi.ResourceOptions opts: Options for the resource.
320
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallApplyToArgs']]]] apply_tos: Resources the firewall should be assigned to
321
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
331
+ :param pulumi.Input[Sequence[pulumi.Input[Union['FirewallApplyToArgs', 'FirewallApplyToArgsDict']]]] apply_tos: Resources the firewall should be assigned to
332
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
322
333
  :param pulumi.Input[str] name: Name of the Firewall.
323
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['FirewallRuleArgs']]]] rules: Configuration of a Rule from this Firewall.
334
+ :param pulumi.Input[Sequence[pulumi.Input[Union['FirewallRuleArgs', 'FirewallRuleArgsDict']]]] rules: Configuration of a Rule from this Firewall.
324
335
  """
325
336
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
326
337
 
@@ -342,7 +353,7 @@ class Firewall(pulumi.CustomResource):
342
353
 
343
354
  @property
344
355
  @pulumi.getter
345
- def labels(self) -> pulumi.Output[Mapping[str, Any]]:
356
+ def labels(self) -> pulumi.Output[Mapping[str, str]]:
346
357
  """
347
358
  User-defined labels (key-value pairs) should be created with.
348
359
  """
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = ['FirewallAttachmentArgs', 'FirewallAttachment']
@@ -146,39 +151,43 @@ class FirewallAttachment(pulumi.CustomResource):
146
151
  """
147
152
  Attaches resource to a Hetzner Cloud Firewall.
148
153
 
149
- *Note*: only one `FirewallAttachment` per Firewall is allowed.
154
+ _Note_: only one `FirewallAttachment` per Firewall is allowed.
150
155
  Any resources that should be attached to that Firewall need to be
151
156
  specified in that `FirewallAttachment`.
152
157
 
153
158
  ## Example Usage
159
+
154
160
  ### Attach Servers
155
161
 
156
162
  ```python
157
163
  import pulumi
158
164
  import pulumi_hcloud as hcloud
159
165
 
160
- test_server = hcloud.Server("testServer",
161
- server_type="cx11",
166
+ test_server = hcloud.Server("test_server",
167
+ name="test-server",
168
+ server_type="cx22",
162
169
  image="ubuntu-20.04")
163
- basic_firewall = hcloud.Firewall("basicFirewall")
164
- fw_ref = hcloud.FirewallAttachment("fwRef",
170
+ basic_firewall = hcloud.Firewall("basic_firewall", name="basic_firewall")
171
+ fw_ref = hcloud.FirewallAttachment("fw_ref",
165
172
  firewall_id=basic_firewall.id,
166
173
  server_ids=[test_server.id])
167
174
  ```
175
+
168
176
  ### Attach Label Selectors
169
177
 
170
178
  ```python
171
179
  import pulumi
172
180
  import pulumi_hcloud as hcloud
173
181
 
174
- test_server = hcloud.Server("testServer",
175
- server_type="cx11",
182
+ test_server = hcloud.Server("test_server",
183
+ name="test-server",
184
+ server_type="cx22",
176
185
  image="ubuntu-20.04",
177
186
  labels={
178
187
  "firewall-attachment": "test-server",
179
188
  })
180
- basic_firewall = hcloud.Firewall("basicFirewall")
181
- fw_ref = hcloud.FirewallAttachment("fwRef",
189
+ basic_firewall = hcloud.Firewall("basic_firewall", name="basic_firewall")
190
+ fw_ref = hcloud.FirewallAttachment("fw_ref",
182
191
  firewall_id=basic_firewall.id,
183
192
  label_selectors=["firewall-attachment=test-server"])
184
193
  ```
@@ -201,39 +210,43 @@ class FirewallAttachment(pulumi.CustomResource):
201
210
  """
202
211
  Attaches resource to a Hetzner Cloud Firewall.
203
212
 
204
- *Note*: only one `FirewallAttachment` per Firewall is allowed.
213
+ _Note_: only one `FirewallAttachment` per Firewall is allowed.
205
214
  Any resources that should be attached to that Firewall need to be
206
215
  specified in that `FirewallAttachment`.
207
216
 
208
217
  ## Example Usage
218
+
209
219
  ### Attach Servers
210
220
 
211
221
  ```python
212
222
  import pulumi
213
223
  import pulumi_hcloud as hcloud
214
224
 
215
- test_server = hcloud.Server("testServer",
216
- server_type="cx11",
225
+ test_server = hcloud.Server("test_server",
226
+ name="test-server",
227
+ server_type="cx22",
217
228
  image="ubuntu-20.04")
218
- basic_firewall = hcloud.Firewall("basicFirewall")
219
- fw_ref = hcloud.FirewallAttachment("fwRef",
229
+ basic_firewall = hcloud.Firewall("basic_firewall", name="basic_firewall")
230
+ fw_ref = hcloud.FirewallAttachment("fw_ref",
220
231
  firewall_id=basic_firewall.id,
221
232
  server_ids=[test_server.id])
222
233
  ```
234
+
223
235
  ### Attach Label Selectors
224
236
 
225
237
  ```python
226
238
  import pulumi
227
239
  import pulumi_hcloud as hcloud
228
240
 
229
- test_server = hcloud.Server("testServer",
230
- server_type="cx11",
241
+ test_server = hcloud.Server("test_server",
242
+ name="test-server",
243
+ server_type="cx22",
231
244
  image="ubuntu-20.04",
232
245
  labels={
233
246
  "firewall-attachment": "test-server",
234
247
  })
235
- basic_firewall = hcloud.Firewall("basicFirewall")
236
- fw_ref = hcloud.FirewallAttachment("fwRef",
248
+ basic_firewall = hcloud.Firewall("basic_firewall", name="basic_firewall")
249
+ fw_ref = hcloud.FirewallAttachment("fw_ref",
237
250
  firewall_id=basic_firewall.id,
238
251
  label_selectors=["firewall-attachment=test-server"])
239
252
  ```
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = ['FloatingIpArgs', 'FloatingIp']
@@ -18,7 +23,7 @@ class FloatingIpArgs:
18
23
  delete_protection: Optional[pulumi.Input[bool]] = None,
19
24
  description: Optional[pulumi.Input[str]] = None,
20
25
  home_location: Optional[pulumi.Input[str]] = None,
21
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
26
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
22
27
  name: Optional[pulumi.Input[str]] = None,
23
28
  server_id: Optional[pulumi.Input[int]] = None):
24
29
  """
@@ -26,10 +31,10 @@ class FloatingIpArgs:
26
31
  :param pulumi.Input[str] type: Type of the Floating IP. `ipv4` `ipv6`
27
32
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
28
33
  :param pulumi.Input[str] description: Description of the Floating IP.
29
- :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if server_id argument is passed.
30
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
34
+ :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if `server_id` argument is passed.
35
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
31
36
  :param pulumi.Input[str] name: Name of the Floating IP.
32
- :param pulumi.Input[int] server_id: Server to assign the Floating IP to.
37
+ :param pulumi.Input[int] server_id: Server to assign the Floating IP to. Optional if `home_location` argument is passed.
33
38
  """
34
39
  pulumi.set(__self__, "type", type)
35
40
  if delete_protection is not None:
@@ -85,7 +90,7 @@ class FloatingIpArgs:
85
90
  @pulumi.getter(name="homeLocation")
86
91
  def home_location(self) -> Optional[pulumi.Input[str]]:
87
92
  """
88
- Name of home location (routing is optimized for that location). Optional if server_id argument is passed.
93
+ Name of home location (routing is optimized for that location). Optional if `server_id` argument is passed.
89
94
  """
90
95
  return pulumi.get(self, "home_location")
91
96
 
@@ -95,14 +100,14 @@ class FloatingIpArgs:
95
100
 
96
101
  @property
97
102
  @pulumi.getter
98
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
103
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
99
104
  """
100
105
  User-defined labels (key-value pairs) should be created with.
101
106
  """
102
107
  return pulumi.get(self, "labels")
103
108
 
104
109
  @labels.setter
105
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
110
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
106
111
  pulumi.set(self, "labels", value)
107
112
 
108
113
  @property
@@ -121,7 +126,7 @@ class FloatingIpArgs:
121
126
  @pulumi.getter(name="serverId")
122
127
  def server_id(self) -> Optional[pulumi.Input[int]]:
123
128
  """
124
- Server to assign the Floating IP to.
129
+ Server to assign the Floating IP to. Optional if `home_location` argument is passed.
125
130
  """
126
131
  return pulumi.get(self, "server_id")
127
132
 
@@ -138,7 +143,7 @@ class _FloatingIpState:
138
143
  home_location: Optional[pulumi.Input[str]] = None,
139
144
  ip_address: Optional[pulumi.Input[str]] = None,
140
145
  ip_network: Optional[pulumi.Input[str]] = None,
141
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
146
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
142
147
  name: Optional[pulumi.Input[str]] = None,
143
148
  server_id: Optional[pulumi.Input[int]] = None,
144
149
  type: Optional[pulumi.Input[str]] = None):
@@ -146,12 +151,12 @@ class _FloatingIpState:
146
151
  Input properties used for looking up and filtering FloatingIp resources.
147
152
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
148
153
  :param pulumi.Input[str] description: Description of the Floating IP.
149
- :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if server_id argument is passed.
154
+ :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if `server_id` argument is passed.
150
155
  :param pulumi.Input[str] ip_address: (string) IP Address of the Floating IP.
151
156
  :param pulumi.Input[str] ip_network: (string) IPv6 subnet. (Only set if `type` is `ipv6`)
152
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
157
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
153
158
  :param pulumi.Input[str] name: Name of the Floating IP.
154
- :param pulumi.Input[int] server_id: Server to assign the Floating IP to.
159
+ :param pulumi.Input[int] server_id: Server to assign the Floating IP to. Optional if `home_location` argument is passed.
155
160
  :param pulumi.Input[str] type: Type of the Floating IP. `ipv4` `ipv6`
156
161
  """
157
162
  if delete_protection is not None:
@@ -201,7 +206,7 @@ class _FloatingIpState:
201
206
  @pulumi.getter(name="homeLocation")
202
207
  def home_location(self) -> Optional[pulumi.Input[str]]:
203
208
  """
204
- Name of home location (routing is optimized for that location). Optional if server_id argument is passed.
209
+ Name of home location (routing is optimized for that location). Optional if `server_id` argument is passed.
205
210
  """
206
211
  return pulumi.get(self, "home_location")
207
212
 
@@ -235,14 +240,14 @@ class _FloatingIpState:
235
240
 
236
241
  @property
237
242
  @pulumi.getter
238
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
243
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
239
244
  """
240
245
  User-defined labels (key-value pairs) should be created with.
241
246
  """
242
247
  return pulumi.get(self, "labels")
243
248
 
244
249
  @labels.setter
245
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
250
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
246
251
  pulumi.set(self, "labels", value)
247
252
 
248
253
  @property
@@ -261,7 +266,7 @@ class _FloatingIpState:
261
266
  @pulumi.getter(name="serverId")
262
267
  def server_id(self) -> Optional[pulumi.Input[int]]:
263
268
  """
264
- Server to assign the Floating IP to.
269
+ Server to assign the Floating IP to. Optional if `home_location` argument is passed.
265
270
  """
266
271
  return pulumi.get(self, "server_id")
267
272
 
@@ -290,7 +295,7 @@ class FloatingIp(pulumi.CustomResource):
290
295
  delete_protection: Optional[pulumi.Input[bool]] = None,
291
296
  description: Optional[pulumi.Input[str]] = None,
292
297
  home_location: Optional[pulumi.Input[str]] = None,
293
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
298
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
294
299
  name: Optional[pulumi.Input[str]] = None,
295
300
  server_id: Optional[pulumi.Input[int]] = None,
296
301
  type: Optional[pulumi.Input[str]] = None,
@@ -305,8 +310,9 @@ class FloatingIp(pulumi.CustomResource):
305
310
  import pulumi_hcloud as hcloud
306
311
 
307
312
  node1 = hcloud.Server("node1",
313
+ name="node1",
308
314
  image="debian-11",
309
- server_type="cx11")
315
+ server_type="cx22")
310
316
  master = hcloud.FloatingIp("master",
311
317
  type="ipv4",
312
318
  server_id=node1.id)
@@ -317,17 +323,17 @@ class FloatingIp(pulumi.CustomResource):
317
323
  Floating IPs can be imported using its `id`:
318
324
 
319
325
  ```sh
320
- $ pulumi import hcloud:index/floatingIp:FloatingIp myip id
326
+ $ pulumi import hcloud:index/floatingIp:FloatingIp example "$FLOATING_IP_ID"
321
327
  ```
322
328
 
323
329
  :param str resource_name: The name of the resource.
324
330
  :param pulumi.ResourceOptions opts: Options for the resource.
325
331
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
326
332
  :param pulumi.Input[str] description: Description of the Floating IP.
327
- :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if server_id argument is passed.
328
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
333
+ :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if `server_id` argument is passed.
334
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
329
335
  :param pulumi.Input[str] name: Name of the Floating IP.
330
- :param pulumi.Input[int] server_id: Server to assign the Floating IP to.
336
+ :param pulumi.Input[int] server_id: Server to assign the Floating IP to. Optional if `home_location` argument is passed.
331
337
  :param pulumi.Input[str] type: Type of the Floating IP. `ipv4` `ipv6`
332
338
  """
333
339
  ...
@@ -346,8 +352,9 @@ class FloatingIp(pulumi.CustomResource):
346
352
  import pulumi_hcloud as hcloud
347
353
 
348
354
  node1 = hcloud.Server("node1",
355
+ name="node1",
349
356
  image="debian-11",
350
- server_type="cx11")
357
+ server_type="cx22")
351
358
  master = hcloud.FloatingIp("master",
352
359
  type="ipv4",
353
360
  server_id=node1.id)
@@ -358,7 +365,7 @@ class FloatingIp(pulumi.CustomResource):
358
365
  Floating IPs can be imported using its `id`:
359
366
 
360
367
  ```sh
361
- $ pulumi import hcloud:index/floatingIp:FloatingIp myip id
368
+ $ pulumi import hcloud:index/floatingIp:FloatingIp example "$FLOATING_IP_ID"
362
369
  ```
363
370
 
364
371
  :param str resource_name: The name of the resource.
@@ -379,7 +386,7 @@ class FloatingIp(pulumi.CustomResource):
379
386
  delete_protection: Optional[pulumi.Input[bool]] = None,
380
387
  description: Optional[pulumi.Input[str]] = None,
381
388
  home_location: Optional[pulumi.Input[str]] = None,
382
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
389
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
383
390
  name: Optional[pulumi.Input[str]] = None,
384
391
  server_id: Optional[pulumi.Input[int]] = None,
385
392
  type: Optional[pulumi.Input[str]] = None,
@@ -418,7 +425,7 @@ class FloatingIp(pulumi.CustomResource):
418
425
  home_location: Optional[pulumi.Input[str]] = None,
419
426
  ip_address: Optional[pulumi.Input[str]] = None,
420
427
  ip_network: Optional[pulumi.Input[str]] = None,
421
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
428
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
422
429
  name: Optional[pulumi.Input[str]] = None,
423
430
  server_id: Optional[pulumi.Input[int]] = None,
424
431
  type: Optional[pulumi.Input[str]] = None) -> 'FloatingIp':
@@ -431,12 +438,12 @@ class FloatingIp(pulumi.CustomResource):
431
438
  :param pulumi.ResourceOptions opts: Options for the resource.
432
439
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
433
440
  :param pulumi.Input[str] description: Description of the Floating IP.
434
- :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if server_id argument is passed.
441
+ :param pulumi.Input[str] home_location: Name of home location (routing is optimized for that location). Optional if `server_id` argument is passed.
435
442
  :param pulumi.Input[str] ip_address: (string) IP Address of the Floating IP.
436
443
  :param pulumi.Input[str] ip_network: (string) IPv6 subnet. (Only set if `type` is `ipv6`)
437
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
444
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
438
445
  :param pulumi.Input[str] name: Name of the Floating IP.
439
- :param pulumi.Input[int] server_id: Server to assign the Floating IP to.
446
+ :param pulumi.Input[int] server_id: Server to assign the Floating IP to. Optional if `home_location` argument is passed.
440
447
  :param pulumi.Input[str] type: Type of the Floating IP. `ipv4` `ipv6`
441
448
  """
442
449
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
@@ -474,7 +481,7 @@ class FloatingIp(pulumi.CustomResource):
474
481
  @pulumi.getter(name="homeLocation")
475
482
  def home_location(self) -> pulumi.Output[str]:
476
483
  """
477
- Name of home location (routing is optimized for that location). Optional if server_id argument is passed.
484
+ Name of home location (routing is optimized for that location). Optional if `server_id` argument is passed.
478
485
  """
479
486
  return pulumi.get(self, "home_location")
480
487
 
@@ -496,7 +503,7 @@ class FloatingIp(pulumi.CustomResource):
496
503
 
497
504
  @property
498
505
  @pulumi.getter
499
- def labels(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
506
+ def labels(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
500
507
  """
501
508
  User-defined labels (key-value pairs) should be created with.
502
509
  """
@@ -514,7 +521,7 @@ class FloatingIp(pulumi.CustomResource):
514
521
  @pulumi.getter(name="serverId")
515
522
  def server_id(self) -> pulumi.Output[int]:
516
523
  """
517
- Server to assign the Floating IP to.
524
+ Server to assign the Floating IP to. Optional if `home_location` argument is passed.
518
525
  """
519
526
  return pulumi.get(self, "server_id")
520
527