pulumi-hcloud 1.18.0a1710156455__py3-none-any.whl → 1.22.0a1736849475__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 -70
  8. pulumi_hcloud/firewall_attachment.py +27 -26
  9. pulumi_hcloud/floating_ip.py +39 -36
  10. pulumi_hcloud/floating_ip_assignment.py +11 -8
  11. pulumi_hcloud/get_certificate.py +25 -10
  12. pulumi_hcloud/get_certificates.py +14 -9
  13. pulumi_hcloud/get_datacenter.py +38 -27
  14. pulumi_hcloud/get_datacenters.py +28 -53
  15. pulumi_hcloud/get_firewall.py +38 -23
  16. pulumi_hcloud/get_firewalls.py +16 -9
  17. pulumi_hcloud/get_floating_ip.py +37 -17
  18. pulumi_hcloud/get_floating_ips.py +14 -9
  19. pulumi_hcloud/get_image.py +37 -13
  20. pulumi_hcloud/get_images.py +22 -9
  21. pulumi_hcloud/get_load_balancer.py +30 -11
  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 -9
  25. pulumi_hcloud/get_location.py +42 -29
  26. pulumi_hcloud/get_locations.py +28 -53
  27. pulumi_hcloud/get_network.py +28 -15
  28. pulumi_hcloud/get_networks.py +14 -9
  29. pulumi_hcloud/get_placement_group.py +31 -17
  30. pulumi_hcloud/get_placement_groups.py +16 -9
  31. pulumi_hcloud/get_primary_ip.py +42 -22
  32. pulumi_hcloud/get_primary_ips.py +14 -9
  33. pulumi_hcloud/get_server.py +43 -15
  34. pulumi_hcloud/get_server_type.py +75 -53
  35. pulumi_hcloud/get_server_types.py +39 -23
  36. pulumi_hcloud/get_servers.py +16 -9
  37. pulumi_hcloud/get_ssh_key.py +58 -36
  38. pulumi_hcloud/get_ssh_keys.py +35 -24
  39. pulumi_hcloud/get_volume.py +33 -16
  40. pulumi_hcloud/get_volumes.py +18 -11
  41. pulumi_hcloud/load_balancer.py +63 -64
  42. pulumi_hcloud/load_balancer_network.py +26 -17
  43. pulumi_hcloud/load_balancer_service.py +57 -54
  44. pulumi_hcloud/load_balancer_target.py +23 -18
  45. pulumi_hcloud/managed_certificate.py +57 -20
  46. pulumi_hcloud/network.py +27 -22
  47. pulumi_hcloud/network_route.py +13 -8
  48. pulumi_hcloud/network_subnet.py +13 -8
  49. pulumi_hcloud/outputs.py +265 -46
  50. pulumi_hcloud/placement_group.py +27 -22
  51. pulumi_hcloud/primary_ip.py +66 -47
  52. pulumi_hcloud/provider.py +5 -0
  53. pulumi_hcloud/pulumi-plugin.json +2 -1
  54. pulumi_hcloud/rdns.py +41 -40
  55. pulumi_hcloud/server.py +123 -176
  56. pulumi_hcloud/server_network.py +24 -17
  57. pulumi_hcloud/snapshot.py +25 -22
  58. pulumi_hcloud/ssh_key.py +52 -51
  59. pulumi_hcloud/uploaded_certificate.py +73 -20
  60. pulumi_hcloud/volume.py +37 -32
  61. pulumi_hcloud/volume_attachment.py +11 -8
  62. {pulumi_hcloud-1.18.0a1710156455.dist-info → pulumi_hcloud-1.22.0a1736849475.dist-info}/METADATA +7 -6
  63. pulumi_hcloud-1.22.0a1736849475.dist-info/RECORD +67 -0
  64. {pulumi_hcloud-1.18.0a1710156455.dist-info → pulumi_hcloud-1.22.0a1736849475.dist-info}/WHEEL +1 -1
  65. pulumi_hcloud-1.18.0a1710156455.dist-info/RECORD +0 -65
  66. {pulumi_hcloud-1.18.0a1710156455.dist-info → pulumi_hcloud-1.22.0a1736849475.dist-info}/top_level.txt +0 -0
@@ -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
 
@@ -79,11 +84,10 @@ def get_volumes(with_selector: Optional[str] = None,
79
84
  with_statuses: Optional[Sequence[str]] = None,
80
85
  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVolumesResult:
81
86
  """
82
- Provides details about multiple Hetzner Cloud volumes.
87
+ Provides details about multiple Hetzner Cloud Volumes.
83
88
 
84
89
  ## Example Usage
85
90
 
86
- <!--Start PulumiCodeChooser -->
87
91
  ```python
88
92
  import pulumi
89
93
  import pulumi_hcloud as hcloud
@@ -91,7 +95,6 @@ def get_volumes(with_selector: Optional[str] = None,
91
95
  volume_ = hcloud.get_volumes()
92
96
  volume3 = hcloud.get_volumes(with_selector="key=value")
93
97
  ```
94
- <!--End PulumiCodeChooser -->
95
98
 
96
99
 
97
100
  :param str with_selector: [Label selector](https://docs.hetzner.cloud/#overview-label-selector)
@@ -108,18 +111,14 @@ def get_volumes(with_selector: Optional[str] = None,
108
111
  volumes=pulumi.get(__ret__, 'volumes'),
109
112
  with_selector=pulumi.get(__ret__, 'with_selector'),
110
113
  with_statuses=pulumi.get(__ret__, 'with_statuses'))
111
-
112
-
113
- @_utilities.lift_output_func(get_volumes)
114
114
  def get_volumes_output(with_selector: Optional[pulumi.Input[Optional[str]]] = None,
115
115
  with_statuses: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
116
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetVolumesResult]:
116
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetVolumesResult]:
117
117
  """
118
- Provides details about multiple Hetzner Cloud volumes.
118
+ Provides details about multiple Hetzner Cloud Volumes.
119
119
 
120
120
  ## Example Usage
121
121
 
122
- <!--Start PulumiCodeChooser -->
123
122
  ```python
124
123
  import pulumi
125
124
  import pulumi_hcloud as hcloud
@@ -127,10 +126,18 @@ def get_volumes_output(with_selector: Optional[pulumi.Input[Optional[str]]] = No
127
126
  volume_ = hcloud.get_volumes()
128
127
  volume3 = hcloud.get_volumes(with_selector="key=value")
129
128
  ```
130
- <!--End PulumiCodeChooser -->
131
129
 
132
130
 
133
131
  :param str with_selector: [Label selector](https://docs.hetzner.cloud/#overview-label-selector)
134
132
  :param Sequence[str] with_statuses: List only volumes with the specified status, could contain `creating` or `available`.
135
133
  """
136
- ...
134
+ __args__ = dict()
135
+ __args__['withSelector'] = with_selector
136
+ __args__['withStatuses'] = with_statuses
137
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
138
+ __ret__ = pulumi.runtime.invoke_output('hcloud:index/getVolumes:getVolumes', __args__, opts=opts, typ=GetVolumesResult)
139
+ return __ret__.apply(lambda __response__: GetVolumesResult(
140
+ id=pulumi.get(__response__, 'id'),
141
+ volumes=pulumi.get(__response__, 'volumes'),
142
+ with_selector=pulumi.get(__response__, 'with_selector'),
143
+ with_statuses=pulumi.get(__response__, 'with_statuses')))
@@ -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 *
@@ -19,7 +24,7 @@ class LoadBalancerArgs:
19
24
  load_balancer_type: pulumi.Input[str],
20
25
  algorithm: Optional[pulumi.Input['LoadBalancerAlgorithmArgs']] = None,
21
26
  delete_protection: Optional[pulumi.Input[bool]] = None,
22
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
27
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
23
28
  location: Optional[pulumi.Input[str]] = None,
24
29
  name: Optional[pulumi.Input[str]] = None,
25
30
  network_zone: Optional[pulumi.Input[str]] = None,
@@ -29,8 +34,8 @@ class LoadBalancerArgs:
29
34
  :param pulumi.Input[str] load_balancer_type: Type of the Load Balancer.
30
35
  :param pulumi.Input['LoadBalancerAlgorithmArgs'] algorithm: Configuration of the algorithm the Load Balancer use.
31
36
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
32
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
33
- :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set.
37
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
38
+ :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
34
39
  :param pulumi.Input[str] name: Name of the Load Balancer.
35
40
  :param pulumi.Input[str] network_zone: The Network Zone of the Load Balancer. Require when no location is set.
36
41
  """
@@ -48,8 +53,8 @@ class LoadBalancerArgs:
48
53
  if network_zone is not None:
49
54
  pulumi.set(__self__, "network_zone", network_zone)
50
55
  if targets is not None:
51
- warnings.warn("""Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""", DeprecationWarning)
52
- pulumi.log.warn("""targets is deprecated: Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""")
56
+ warnings.warn("""Use LoadBalancerTarget resource instead. This allows the full control over the selected targets.""", DeprecationWarning)
57
+ pulumi.log.warn("""targets is deprecated: Use LoadBalancerTarget resource instead. This allows the full control over the selected targets.""")
53
58
  if targets is not None:
54
59
  pulumi.set(__self__, "targets", targets)
55
60
 
@@ -91,21 +96,21 @@ class LoadBalancerArgs:
91
96
 
92
97
  @property
93
98
  @pulumi.getter
94
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
99
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
95
100
  """
96
101
  User-defined labels (key-value pairs) should be created with.
97
102
  """
98
103
  return pulumi.get(self, "labels")
99
104
 
100
105
  @labels.setter
101
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
106
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
102
107
  pulumi.set(self, "labels", value)
103
108
 
104
109
  @property
105
110
  @pulumi.getter
106
111
  def location(self) -> Optional[pulumi.Input[str]]:
107
112
  """
108
- The location name of the Load Balancer. Require when no network_zone is set.
113
+ The location name of the Load Balancer. Require when no network_zone is set. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
109
114
  """
110
115
  return pulumi.get(self, "location")
111
116
 
@@ -139,10 +144,8 @@ class LoadBalancerArgs:
139
144
 
140
145
  @property
141
146
  @pulumi.getter
147
+ @_utilities.deprecated("""Use LoadBalancerTarget resource instead. This allows the full control over the selected targets.""")
142
148
  def targets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['LoadBalancerTargetArgs']]]]:
143
- warnings.warn("""Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""", DeprecationWarning)
144
- pulumi.log.warn("""targets is deprecated: Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""")
145
-
146
149
  return pulumi.get(self, "targets")
147
150
 
148
151
  @targets.setter
@@ -157,7 +160,7 @@ class _LoadBalancerState:
157
160
  delete_protection: Optional[pulumi.Input[bool]] = None,
158
161
  ipv4: Optional[pulumi.Input[str]] = None,
159
162
  ipv6: Optional[pulumi.Input[str]] = None,
160
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
163
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
161
164
  load_balancer_type: Optional[pulumi.Input[str]] = None,
162
165
  location: Optional[pulumi.Input[str]] = None,
163
166
  name: Optional[pulumi.Input[str]] = None,
@@ -171,9 +174,9 @@ class _LoadBalancerState:
171
174
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
172
175
  :param pulumi.Input[str] ipv4: (string) IPv4 Address of the Load Balancer.
173
176
  :param pulumi.Input[str] ipv6: (string) IPv6 Address of the Load Balancer.
174
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
177
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
175
178
  :param pulumi.Input[str] load_balancer_type: Type of the Load Balancer.
176
- :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set.
179
+ :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
177
180
  :param pulumi.Input[str] name: Name of the Load Balancer.
178
181
  :param pulumi.Input[int] network_id: (int) ID of the first private network that this Load Balancer is connected to.
179
182
  :param pulumi.Input[str] network_ip: (string) IP of the Load Balancer in the first private network that it is connected to.
@@ -202,8 +205,8 @@ class _LoadBalancerState:
202
205
  if network_zone is not None:
203
206
  pulumi.set(__self__, "network_zone", network_zone)
204
207
  if targets is not None:
205
- warnings.warn("""Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""", DeprecationWarning)
206
- pulumi.log.warn("""targets is deprecated: Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""")
208
+ warnings.warn("""Use LoadBalancerTarget resource instead. This allows the full control over the selected targets.""", DeprecationWarning)
209
+ pulumi.log.warn("""targets is deprecated: Use LoadBalancerTarget resource instead. This allows the full control over the selected targets.""")
207
210
  if targets is not None:
208
211
  pulumi.set(__self__, "targets", targets)
209
212
 
@@ -257,14 +260,14 @@ class _LoadBalancerState:
257
260
 
258
261
  @property
259
262
  @pulumi.getter
260
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
263
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
261
264
  """
262
265
  User-defined labels (key-value pairs) should be created with.
263
266
  """
264
267
  return pulumi.get(self, "labels")
265
268
 
266
269
  @labels.setter
267
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
270
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
268
271
  pulumi.set(self, "labels", value)
269
272
 
270
273
  @property
@@ -283,7 +286,7 @@ class _LoadBalancerState:
283
286
  @pulumi.getter
284
287
  def location(self) -> Optional[pulumi.Input[str]]:
285
288
  """
286
- The location name of the Load Balancer. Require when no network_zone is set.
289
+ The location name of the Load Balancer. Require when no network_zone is set. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
287
290
  """
288
291
  return pulumi.get(self, "location")
289
292
 
@@ -341,10 +344,8 @@ class _LoadBalancerState:
341
344
 
342
345
  @property
343
346
  @pulumi.getter
347
+ @_utilities.deprecated("""Use LoadBalancerTarget resource instead. This allows the full control over the selected targets.""")
344
348
  def targets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['LoadBalancerTargetArgs']]]]:
345
- warnings.warn("""Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""", DeprecationWarning)
346
- pulumi.log.warn("""targets is deprecated: Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""")
347
-
348
349
  return pulumi.get(self, "targets")
349
350
 
350
351
  @targets.setter
@@ -357,53 +358,53 @@ class LoadBalancer(pulumi.CustomResource):
357
358
  def __init__(__self__,
358
359
  resource_name: str,
359
360
  opts: Optional[pulumi.ResourceOptions] = None,
360
- algorithm: Optional[pulumi.Input[pulumi.InputType['LoadBalancerAlgorithmArgs']]] = None,
361
+ algorithm: Optional[pulumi.Input[Union['LoadBalancerAlgorithmArgs', 'LoadBalancerAlgorithmArgsDict']]] = None,
361
362
  delete_protection: Optional[pulumi.Input[bool]] = None,
362
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
363
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
363
364
  load_balancer_type: Optional[pulumi.Input[str]] = None,
364
365
  location: Optional[pulumi.Input[str]] = None,
365
366
  name: Optional[pulumi.Input[str]] = None,
366
367
  network_zone: Optional[pulumi.Input[str]] = None,
367
- targets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerTargetArgs']]]]] = None,
368
+ targets: Optional[pulumi.Input[Sequence[pulumi.Input[Union['LoadBalancerTargetArgs', 'LoadBalancerTargetArgsDict']]]]] = None,
368
369
  __props__=None):
369
370
  """
370
371
  Provides a Hetzner Cloud Load Balancer to represent a Load Balancer in the Hetzner Cloud.
371
372
 
372
373
  ## Example Usage
373
374
 
374
- <!--Start PulumiCodeChooser -->
375
375
  ```python
376
376
  import pulumi
377
377
  import pulumi_hcloud as hcloud
378
378
 
379
- myserver = hcloud.Server("myserver",
380
- server_type="cx11",
379
+ my_server = hcloud.Server("my_server",
380
+ name="server-%d",
381
+ server_type="cx22",
381
382
  image="ubuntu-18.04")
382
- load_balancer = hcloud.LoadBalancer("loadBalancer",
383
+ load_balancer = hcloud.LoadBalancer("load_balancer",
384
+ name="my-load-balancer",
383
385
  load_balancer_type="lb11",
384
- location="nbg1",
385
- targets=[hcloud.LoadBalancerTargetArgs(
386
- type="server",
387
- server_id=myserver.id,
388
- )])
386
+ location="nbg1")
387
+ load_balancer_target = hcloud.LoadBalancerTarget("load_balancer_target",
388
+ type="server",
389
+ load_balancer_id=load_balancer.id,
390
+ server_id=my_server.id)
389
391
  ```
390
- <!--End PulumiCodeChooser -->
391
392
 
392
393
  ## Import
393
394
 
394
395
  Load Balancers can be imported using its `id`:
395
396
 
396
397
  ```sh
397
- $ pulumi import hcloud:index/loadBalancer:LoadBalancer my_load_balancer id
398
+ $ pulumi import hcloud:index/loadBalancer:LoadBalancer example "$LOAD_BALANCER_ID"
398
399
  ```
399
400
 
400
401
  :param str resource_name: The name of the resource.
401
402
  :param pulumi.ResourceOptions opts: Options for the resource.
402
- :param pulumi.Input[pulumi.InputType['LoadBalancerAlgorithmArgs']] algorithm: Configuration of the algorithm the Load Balancer use.
403
+ :param pulumi.Input[Union['LoadBalancerAlgorithmArgs', 'LoadBalancerAlgorithmArgsDict']] algorithm: Configuration of the algorithm the Load Balancer use.
403
404
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
404
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
405
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
405
406
  :param pulumi.Input[str] load_balancer_type: Type of the Load Balancer.
406
- :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set.
407
+ :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
407
408
  :param pulumi.Input[str] name: Name of the Load Balancer.
408
409
  :param pulumi.Input[str] network_zone: The Network Zone of the Load Balancer. Require when no location is set.
409
410
  """
@@ -418,30 +419,30 @@ class LoadBalancer(pulumi.CustomResource):
418
419
 
419
420
  ## Example Usage
420
421
 
421
- <!--Start PulumiCodeChooser -->
422
422
  ```python
423
423
  import pulumi
424
424
  import pulumi_hcloud as hcloud
425
425
 
426
- myserver = hcloud.Server("myserver",
427
- server_type="cx11",
426
+ my_server = hcloud.Server("my_server",
427
+ name="server-%d",
428
+ server_type="cx22",
428
429
  image="ubuntu-18.04")
429
- load_balancer = hcloud.LoadBalancer("loadBalancer",
430
+ load_balancer = hcloud.LoadBalancer("load_balancer",
431
+ name="my-load-balancer",
430
432
  load_balancer_type="lb11",
431
- location="nbg1",
432
- targets=[hcloud.LoadBalancerTargetArgs(
433
- type="server",
434
- server_id=myserver.id,
435
- )])
433
+ location="nbg1")
434
+ load_balancer_target = hcloud.LoadBalancerTarget("load_balancer_target",
435
+ type="server",
436
+ load_balancer_id=load_balancer.id,
437
+ server_id=my_server.id)
436
438
  ```
437
- <!--End PulumiCodeChooser -->
438
439
 
439
440
  ## Import
440
441
 
441
442
  Load Balancers can be imported using its `id`:
442
443
 
443
444
  ```sh
444
- $ pulumi import hcloud:index/loadBalancer:LoadBalancer my_load_balancer id
445
+ $ pulumi import hcloud:index/loadBalancer:LoadBalancer example "$LOAD_BALANCER_ID"
445
446
  ```
446
447
 
447
448
  :param str resource_name: The name of the resource.
@@ -459,14 +460,14 @@ class LoadBalancer(pulumi.CustomResource):
459
460
  def _internal_init(__self__,
460
461
  resource_name: str,
461
462
  opts: Optional[pulumi.ResourceOptions] = None,
462
- algorithm: Optional[pulumi.Input[pulumi.InputType['LoadBalancerAlgorithmArgs']]] = None,
463
+ algorithm: Optional[pulumi.Input[Union['LoadBalancerAlgorithmArgs', 'LoadBalancerAlgorithmArgsDict']]] = None,
463
464
  delete_protection: Optional[pulumi.Input[bool]] = None,
464
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
465
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
465
466
  load_balancer_type: Optional[pulumi.Input[str]] = None,
466
467
  location: Optional[pulumi.Input[str]] = None,
467
468
  name: Optional[pulumi.Input[str]] = None,
468
469
  network_zone: Optional[pulumi.Input[str]] = None,
469
- targets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerTargetArgs']]]]] = None,
470
+ targets: Optional[pulumi.Input[Sequence[pulumi.Input[Union['LoadBalancerTargetArgs', 'LoadBalancerTargetArgsDict']]]]] = None,
470
471
  __props__=None):
471
472
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
472
473
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -500,18 +501,18 @@ class LoadBalancer(pulumi.CustomResource):
500
501
  def get(resource_name: str,
501
502
  id: pulumi.Input[str],
502
503
  opts: Optional[pulumi.ResourceOptions] = None,
503
- algorithm: Optional[pulumi.Input[pulumi.InputType['LoadBalancerAlgorithmArgs']]] = None,
504
+ algorithm: Optional[pulumi.Input[Union['LoadBalancerAlgorithmArgs', 'LoadBalancerAlgorithmArgsDict']]] = None,
504
505
  delete_protection: Optional[pulumi.Input[bool]] = None,
505
506
  ipv4: Optional[pulumi.Input[str]] = None,
506
507
  ipv6: Optional[pulumi.Input[str]] = None,
507
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
508
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
508
509
  load_balancer_type: Optional[pulumi.Input[str]] = None,
509
510
  location: Optional[pulumi.Input[str]] = None,
510
511
  name: Optional[pulumi.Input[str]] = None,
511
512
  network_id: Optional[pulumi.Input[int]] = None,
512
513
  network_ip: Optional[pulumi.Input[str]] = None,
513
514
  network_zone: Optional[pulumi.Input[str]] = None,
514
- targets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerTargetArgs']]]]] = None) -> 'LoadBalancer':
515
+ targets: Optional[pulumi.Input[Sequence[pulumi.Input[Union['LoadBalancerTargetArgs', 'LoadBalancerTargetArgsDict']]]]] = None) -> 'LoadBalancer':
515
516
  """
516
517
  Get an existing LoadBalancer resource's state with the given name, id, and optional extra
517
518
  properties used to qualify the lookup.
@@ -519,13 +520,13 @@ class LoadBalancer(pulumi.CustomResource):
519
520
  :param str resource_name: The unique name of the resulting resource.
520
521
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
521
522
  :param pulumi.ResourceOptions opts: Options for the resource.
522
- :param pulumi.Input[pulumi.InputType['LoadBalancerAlgorithmArgs']] algorithm: Configuration of the algorithm the Load Balancer use.
523
+ :param pulumi.Input[Union['LoadBalancerAlgorithmArgs', 'LoadBalancerAlgorithmArgsDict']] algorithm: Configuration of the algorithm the Load Balancer use.
523
524
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
524
525
  :param pulumi.Input[str] ipv4: (string) IPv4 Address of the Load Balancer.
525
526
  :param pulumi.Input[str] ipv6: (string) IPv6 Address of the Load Balancer.
526
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
527
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
527
528
  :param pulumi.Input[str] load_balancer_type: Type of the Load Balancer.
528
- :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set.
529
+ :param pulumi.Input[str] location: The location name of the Load Balancer. Require when no network_zone is set. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
529
530
  :param pulumi.Input[str] name: Name of the Load Balancer.
530
531
  :param pulumi.Input[int] network_id: (int) ID of the first private network that this Load Balancer is connected to.
531
532
  :param pulumi.Input[str] network_ip: (string) IP of the Load Balancer in the first private network that it is connected to.
@@ -583,7 +584,7 @@ class LoadBalancer(pulumi.CustomResource):
583
584
 
584
585
  @property
585
586
  @pulumi.getter
586
- def labels(self) -> pulumi.Output[Mapping[str, Any]]:
587
+ def labels(self) -> pulumi.Output[Mapping[str, str]]:
587
588
  """
588
589
  User-defined labels (key-value pairs) should be created with.
589
590
  """
@@ -601,7 +602,7 @@ class LoadBalancer(pulumi.CustomResource):
601
602
  @pulumi.getter
602
603
  def location(self) -> pulumi.Output[str]:
603
604
  """
604
- The location name of the Load Balancer. Require when no network_zone is set.
605
+ The location name of the Load Balancer. Require when no network_zone is set. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
605
606
  """
606
607
  return pulumi.get(self, "location")
607
608
 
@@ -639,9 +640,7 @@ class LoadBalancer(pulumi.CustomResource):
639
640
 
640
641
  @property
641
642
  @pulumi.getter
643
+ @_utilities.deprecated("""Use LoadBalancerTarget resource instead. This allows the full control over the selected targets.""")
642
644
  def targets(self) -> pulumi.Output[Sequence['outputs.LoadBalancerTarget']]:
643
- warnings.warn("""Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""", DeprecationWarning)
644
- pulumi.log.warn("""targets is deprecated: Use hcloud_load_balancer_target resource instead. This allows the full control over the selected targets.""")
645
-
646
645
  return pulumi.get(self, "targets")
647
646
 
@@ -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__ = ['LoadBalancerNetworkArgs', 'LoadBalancerNetwork']
@@ -37,7 +42,7 @@ class LoadBalancerNetworkArgs:
37
42
  `LoadBalancerNetwork` and the existence of a subnet.
38
43
  :param pulumi.Input[str] subnet_id: ID of the sub-network which should be
39
44
  added to the Load Balancer. Required if `network_id` is not set.
40
- *Note*: if the `ip` property is missing, the Load Balancer is
45
+ _Note_: if the `ip` property is missing, the Load Balancer is
41
46
  currently added to the last created subnet.
42
47
  """
43
48
  pulumi.set(__self__, "load_balancer_id", load_balancer_id)
@@ -114,7 +119,7 @@ class LoadBalancerNetworkArgs:
114
119
  """
115
120
  ID of the sub-network which should be
116
121
  added to the Load Balancer. Required if `network_id` is not set.
117
- *Note*: if the `ip` property is missing, the Load Balancer is
122
+ _Note_: if the `ip` property is missing, the Load Balancer is
118
123
  currently added to the last created subnet.
119
124
  """
120
125
  return pulumi.get(self, "subnet_id")
@@ -150,7 +155,7 @@ class _LoadBalancerNetworkState:
150
155
  `LoadBalancerNetwork` and the existence of a subnet.
151
156
  :param pulumi.Input[str] subnet_id: ID of the sub-network which should be
152
157
  added to the Load Balancer. Required if `network_id` is not set.
153
- *Note*: if the `ip` property is missing, the Load Balancer is
158
+ _Note_: if the `ip` property is missing, the Load Balancer is
154
159
  currently added to the last created subnet.
155
160
  """
156
161
  if enable_public_interface is not None:
@@ -228,7 +233,7 @@ class _LoadBalancerNetworkState:
228
233
  """
229
234
  ID of the sub-network which should be
230
235
  added to the Load Balancer. Required if `network_id` is not set.
231
- *Note*: if the `ip` property is missing, the Load Balancer is
236
+ _Note_: if the `ip` property is missing, the Load Balancer is
232
237
  currently added to the last created subnet.
233
238
  """
234
239
  return pulumi.get(self, "subnet_id")
@@ -254,15 +259,17 @@ class LoadBalancerNetwork(pulumi.CustomResource):
254
259
 
255
260
  ## Example Usage
256
261
 
257
- <!--Start PulumiCodeChooser -->
258
262
  ```python
259
263
  import pulumi
260
264
  import pulumi_hcloud as hcloud
261
265
 
262
266
  lb1 = hcloud.LoadBalancer("lb1",
267
+ name="lb1",
263
268
  load_balancer_type="lb11",
264
269
  network_zone="eu-central")
265
- mynet = hcloud.Network("mynet", ip_range="10.0.0.0/8")
270
+ mynet = hcloud.Network("mynet",
271
+ name="my-net",
272
+ ip_range="10.0.0.0/8")
266
273
  foonet = hcloud.NetworkSubnet("foonet",
267
274
  network_id=mynet.id,
268
275
  type="cloud",
@@ -271,9 +278,9 @@ class LoadBalancerNetwork(pulumi.CustomResource):
271
278
  srvnetwork = hcloud.LoadBalancerNetwork("srvnetwork",
272
279
  load_balancer_id=lb1.id,
273
280
  network_id=mynet.id,
274
- ip="10.0.1.5")
281
+ ip="10.0.1.5",
282
+ opts = pulumi.ResourceOptions(depends_on=[srvnetwork_hcloud_network_subnet]))
275
283
  ```
276
- <!--End PulumiCodeChooser -->
277
284
 
278
285
  ## Import
279
286
 
@@ -282,7 +289,7 @@ class LoadBalancerNetwork(pulumi.CustomResource):
282
289
  `<load-balancer-id>-<network-id>`
283
290
 
284
291
  ```sh
285
- $ pulumi import hcloud:index/loadBalancerNetwork:LoadBalancerNetwork myloadbalancernetwork 123-654
292
+ $ pulumi import hcloud:index/loadBalancerNetwork:LoadBalancerNetwork example "$LOAD_BALANCER_ID-$NETWORK_ID"
286
293
  ```
287
294
 
288
295
  :param str resource_name: The name of the resource.
@@ -303,7 +310,7 @@ class LoadBalancerNetwork(pulumi.CustomResource):
303
310
  `LoadBalancerNetwork` and the existence of a subnet.
304
311
  :param pulumi.Input[str] subnet_id: ID of the sub-network which should be
305
312
  added to the Load Balancer. Required if `network_id` is not set.
306
- *Note*: if the `ip` property is missing, the Load Balancer is
313
+ _Note_: if the `ip` property is missing, the Load Balancer is
307
314
  currently added to the last created subnet.
308
315
  """
309
316
  ...
@@ -317,15 +324,17 @@ class LoadBalancerNetwork(pulumi.CustomResource):
317
324
 
318
325
  ## Example Usage
319
326
 
320
- <!--Start PulumiCodeChooser -->
321
327
  ```python
322
328
  import pulumi
323
329
  import pulumi_hcloud as hcloud
324
330
 
325
331
  lb1 = hcloud.LoadBalancer("lb1",
332
+ name="lb1",
326
333
  load_balancer_type="lb11",
327
334
  network_zone="eu-central")
328
- mynet = hcloud.Network("mynet", ip_range="10.0.0.0/8")
335
+ mynet = hcloud.Network("mynet",
336
+ name="my-net",
337
+ ip_range="10.0.0.0/8")
329
338
  foonet = hcloud.NetworkSubnet("foonet",
330
339
  network_id=mynet.id,
331
340
  type="cloud",
@@ -334,9 +343,9 @@ class LoadBalancerNetwork(pulumi.CustomResource):
334
343
  srvnetwork = hcloud.LoadBalancerNetwork("srvnetwork",
335
344
  load_balancer_id=lb1.id,
336
345
  network_id=mynet.id,
337
- ip="10.0.1.5")
346
+ ip="10.0.1.5",
347
+ opts = pulumi.ResourceOptions(depends_on=[srvnetwork_hcloud_network_subnet]))
338
348
  ```
339
- <!--End PulumiCodeChooser -->
340
349
 
341
350
  ## Import
342
351
 
@@ -345,7 +354,7 @@ class LoadBalancerNetwork(pulumi.CustomResource):
345
354
  `<load-balancer-id>-<network-id>`
346
355
 
347
356
  ```sh
348
- $ pulumi import hcloud:index/loadBalancerNetwork:LoadBalancerNetwork myloadbalancernetwork 123-654
357
+ $ pulumi import hcloud:index/loadBalancerNetwork:LoadBalancerNetwork example "$LOAD_BALANCER_ID-$NETWORK_ID"
349
358
  ```
350
359
 
351
360
  :param str resource_name: The name of the resource.
@@ -422,7 +431,7 @@ class LoadBalancerNetwork(pulumi.CustomResource):
422
431
  `LoadBalancerNetwork` and the existence of a subnet.
423
432
  :param pulumi.Input[str] subnet_id: ID of the sub-network which should be
424
433
  added to the Load Balancer. Required if `network_id` is not set.
425
- *Note*: if the `ip` property is missing, the Load Balancer is
434
+ _Note_: if the `ip` property is missing, the Load Balancer is
426
435
  currently added to the last created subnet.
427
436
  """
428
437
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
@@ -484,7 +493,7 @@ class LoadBalancerNetwork(pulumi.CustomResource):
484
493
  """
485
494
  ID of the sub-network which should be
486
495
  added to the Load Balancer. Required if `network_id` is not set.
487
- *Note*: if the `ip` property is missing, the Load Balancer is
496
+ _Note_: if the `ip` property is missing, the Load Balancer is
488
497
  currently added to the last created subnet.
489
498
  """
490
499
  return pulumi.get(self, "subnet_id")