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/server.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 *
@@ -26,7 +31,7 @@ class ServerArgs:
26
31
  image: Optional[pulumi.Input[str]] = None,
27
32
  iso: Optional[pulumi.Input[str]] = None,
28
33
  keep_disk: Optional[pulumi.Input[bool]] = None,
29
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
34
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
30
35
  location: Optional[pulumi.Input[str]] = None,
31
36
  name: Optional[pulumi.Input[str]] = None,
32
37
  networks: Optional[pulumi.Input[Sequence[pulumi.Input['ServerNetworkArgs']]]] = None,
@@ -42,7 +47,7 @@ class ServerArgs:
42
47
  :param pulumi.Input[str] server_type: Name of the server type this server should be created with.
43
48
  :param pulumi.Input[bool] allow_deprecated_images: Enable the use of deprecated images (default: false). **Note** Deprecated images will be removed after three months. Using them is then no longer possible.
44
49
  :param pulumi.Input[bool] backups: Enable or disable backups.
45
- :param pulumi.Input[str] datacenter: The datacenter name to create the server in. `nbg1-dc3`, `fsn1-dc14`, `hel1-dc2`, `ash-dc1` or `hil-dc1`
50
+ :param pulumi.Input[str] datacenter: The datacenter name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
46
51
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection (Needs to be the same as `rebuild_protection`). See "Delete Protection" in the Provider Docs for details.
47
52
  :param pulumi.Input[Sequence[pulumi.Input[int]]] firewall_ids: Firewall IDs the server should be attached to on creation.
48
53
  :param pulumi.Input[bool] ignore_remote_firewall_ids: Ignores any updates
@@ -52,8 +57,8 @@ class ServerArgs:
52
57
  argument.
53
58
  :param pulumi.Input[str] iso: ID or Name of an ISO image to mount.
54
59
  :param pulumi.Input[bool] keep_disk: If true, do not upgrade the disk. This allows downgrading the server type later.
55
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
56
- :param pulumi.Input[str] location: The location name to create the server in. `nbg1`, `fsn1`, `hel1`, `ash` or `hil`
60
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
61
+ :param pulumi.Input[str] location: The location name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
57
62
  :param pulumi.Input[str] name: Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
58
63
  :param pulumi.Input[Sequence[pulumi.Input['ServerNetworkArgs']]] networks: Network the server should be attached to on creation. (Can be specified multiple times)
59
64
  :param pulumi.Input[int] placement_group_id: Placement Group ID the server added to on creation.
@@ -147,7 +152,7 @@ class ServerArgs:
147
152
  @pulumi.getter
148
153
  def datacenter(self) -> Optional[pulumi.Input[str]]:
149
154
  """
150
- The datacenter name to create the server in. `nbg1-dc3`, `fsn1-dc14`, `hel1-dc2`, `ash-dc1` or `hil-dc1`
155
+ The datacenter name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
151
156
  """
152
157
  return pulumi.get(self, "datacenter")
153
158
 
@@ -230,21 +235,21 @@ class ServerArgs:
230
235
 
231
236
  @property
232
237
  @pulumi.getter
233
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
238
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
234
239
  """
235
240
  User-defined labels (key-value pairs) should be created with.
236
241
  """
237
242
  return pulumi.get(self, "labels")
238
243
 
239
244
  @labels.setter
240
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
245
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
241
246
  pulumi.set(self, "labels", value)
242
247
 
243
248
  @property
244
249
  @pulumi.getter
245
250
  def location(self) -> Optional[pulumi.Input[str]]:
246
251
  """
247
- The location name to create the server in. `nbg1`, `fsn1`, `hel1`, `ash` or `hil`
252
+ The location name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
248
253
  """
249
254
  return pulumi.get(self, "location")
250
255
 
@@ -378,7 +383,7 @@ class _ServerState:
378
383
  ipv6_network: Optional[pulumi.Input[str]] = None,
379
384
  iso: Optional[pulumi.Input[str]] = None,
380
385
  keep_disk: Optional[pulumi.Input[bool]] = None,
381
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
386
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
382
387
  location: Optional[pulumi.Input[str]] = None,
383
388
  name: Optional[pulumi.Input[str]] = None,
384
389
  networks: Optional[pulumi.Input[Sequence[pulumi.Input['ServerNetworkArgs']]]] = None,
@@ -397,7 +402,7 @@ class _ServerState:
397
402
  :param pulumi.Input[bool] allow_deprecated_images: Enable the use of deprecated images (default: false). **Note** Deprecated images will be removed after three months. Using them is then no longer possible.
398
403
  :param pulumi.Input[str] backup_window: (string) The backup window of the server, if enabled.
399
404
  :param pulumi.Input[bool] backups: Enable or disable backups.
400
- :param pulumi.Input[str] datacenter: The datacenter name to create the server in. `nbg1-dc3`, `fsn1-dc14`, `hel1-dc2`, `ash-dc1` or `hil-dc1`
405
+ :param pulumi.Input[str] datacenter: The datacenter name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
401
406
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection (Needs to be the same as `rebuild_protection`). See "Delete Protection" in the Provider Docs for details.
402
407
  :param pulumi.Input[Sequence[pulumi.Input[int]]] firewall_ids: Firewall IDs the server should be attached to on creation.
403
408
  :param pulumi.Input[bool] ignore_remote_firewall_ids: Ignores any updates
@@ -410,8 +415,8 @@ class _ServerState:
410
415
  :param pulumi.Input[str] ipv6_network: (string) The IPv6 network.
411
416
  :param pulumi.Input[str] iso: ID or Name of an ISO image to mount.
412
417
  :param pulumi.Input[bool] keep_disk: If true, do not upgrade the disk. This allows downgrading the server type later.
413
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
414
- :param pulumi.Input[str] location: The location name to create the server in. `nbg1`, `fsn1`, `hel1`, `ash` or `hil`
418
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
419
+ :param pulumi.Input[str] location: The location name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
415
420
  :param pulumi.Input[str] name: Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
416
421
  :param pulumi.Input[Sequence[pulumi.Input['ServerNetworkArgs']]] networks: Network the server should be attached to on creation. (Can be specified multiple times)
417
422
  :param pulumi.Input[int] placement_group_id: Placement Group ID the server added to on creation.
@@ -498,13 +503,11 @@ class _ServerState:
498
503
 
499
504
  @property
500
505
  @pulumi.getter(name="backupWindow")
506
+ @_utilities.deprecated("""You should remove this property from your terraform configuration.""")
501
507
  def backup_window(self) -> Optional[pulumi.Input[str]]:
502
508
  """
503
509
  (string) The backup window of the server, if enabled.
504
510
  """
505
- warnings.warn("""You should remove this property from your terraform configuration.""", DeprecationWarning)
506
- pulumi.log.warn("""backup_window is deprecated: You should remove this property from your terraform configuration.""")
507
-
508
511
  return pulumi.get(self, "backup_window")
509
512
 
510
513
  @backup_window.setter
@@ -527,7 +530,7 @@ class _ServerState:
527
530
  @pulumi.getter
528
531
  def datacenter(self) -> Optional[pulumi.Input[str]]:
529
532
  """
530
- The datacenter name to create the server in. `nbg1-dc3`, `fsn1-dc14`, `hel1-dc2`, `ash-dc1` or `hil-dc1`
533
+ The datacenter name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
531
534
  """
532
535
  return pulumi.get(self, "datacenter")
533
536
 
@@ -646,21 +649,21 @@ class _ServerState:
646
649
 
647
650
  @property
648
651
  @pulumi.getter
649
- def labels(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
652
+ def labels(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
650
653
  """
651
654
  User-defined labels (key-value pairs) should be created with.
652
655
  """
653
656
  return pulumi.get(self, "labels")
654
657
 
655
658
  @labels.setter
656
- def labels(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
659
+ def labels(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
657
660
  pulumi.set(self, "labels", value)
658
661
 
659
662
  @property
660
663
  @pulumi.getter
661
664
  def location(self) -> Optional[pulumi.Input[str]]:
662
665
  """
663
- The location name to create the server in. `nbg1`, `fsn1`, `hel1`, `ash` or `hil`
666
+ The location name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
664
667
  """
665
668
  return pulumi.get(self, "location")
666
669
 
@@ -828,12 +831,12 @@ class Server(pulumi.CustomResource):
828
831
  image: Optional[pulumi.Input[str]] = None,
829
832
  iso: Optional[pulumi.Input[str]] = None,
830
833
  keep_disk: Optional[pulumi.Input[bool]] = None,
831
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
834
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
832
835
  location: Optional[pulumi.Input[str]] = None,
833
836
  name: Optional[pulumi.Input[str]] = None,
834
- networks: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerNetworkArgs']]]]] = None,
837
+ networks: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerNetworkArgs', 'ServerNetworkArgsDict']]]]] = None,
835
838
  placement_group_id: Optional[pulumi.Input[int]] = None,
836
- public_nets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerPublicNetArgs']]]]] = None,
839
+ public_nets: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerPublicNetArgs', 'ServerPublicNetArgsDict']]]]] = None,
837
840
  rebuild_protection: Optional[pulumi.Input[bool]] = None,
838
841
  rescue: Optional[pulumi.Input[str]] = None,
839
842
  server_type: Optional[pulumi.Input[str]] = None,
@@ -845,94 +848,121 @@ class Server(pulumi.CustomResource):
845
848
  Provides an Hetzner Cloud server resource. This can be used to create, modify, and delete servers. Servers also support provisioning.
846
849
 
847
850
  ## Example Usage
851
+
852
+ ### Basic server creation
853
+
854
+ ```python
855
+ import pulumi
856
+ import pulumi_hcloud as hcloud
857
+
858
+ # Create a new server running debian
859
+ node1 = hcloud.Server("node1",
860
+ name="node1",
861
+ image="debian-11",
862
+ server_type="cx22",
863
+ public_nets=[{
864
+ "ipv4_enabled": True,
865
+ "ipv6_enabled": True,
866
+ }])
867
+ ```
868
+
869
+ ```python
870
+ import pulumi
871
+ import pulumi_hcloud as hcloud
872
+
873
+ ### Server creation with one linked primary ip (ipv4)
874
+ primary_ip1 = hcloud.PrimaryIp("primary_ip_1",
875
+ name="primary_ip_test",
876
+ datacenter="fsn1-dc14",
877
+ type="ipv4",
878
+ assignee_type="server",
879
+ auto_delete=True,
880
+ labels={
881
+ "hallo": "welt",
882
+ })
883
+ server_test = hcloud.Server("server_test",
884
+ name="test-server",
885
+ image="ubuntu-20.04",
886
+ server_type="cx22",
887
+ datacenter="fsn1-dc14",
888
+ labels={
889
+ "test": "tessst1",
890
+ },
891
+ public_nets=[{
892
+ "ipv4_enabled": True,
893
+ "ipv4": primary_ip1.id,
894
+ "ipv6_enabled": False,
895
+ }])
896
+ ```
897
+
848
898
  ### Server creation with network
899
+
849
900
  ```python
850
901
  import pulumi
851
902
  import pulumi_hcloud as hcloud
852
903
 
853
- network = hcloud.Network("network", ip_range="10.0.0.0/16")
904
+ network = hcloud.Network("network",
905
+ name="network",
906
+ ip_range="10.0.0.0/16")
854
907
  network_subnet = hcloud.NetworkSubnet("network-subnet",
855
908
  type="cloud",
856
909
  network_id=network.id,
857
910
  network_zone="eu-central",
858
911
  ip_range="10.0.1.0/24")
859
912
  server = hcloud.Server("server",
860
- server_type="cx11",
913
+ name="server",
914
+ server_type="cx22",
861
915
  image="ubuntu-20.04",
862
916
  location="nbg1",
863
- networks=[hcloud.ServerNetworkArgs(
864
- network_id=network.id,
865
- ip="10.0.1.5",
866
- alias_ips=[
917
+ networks=[{
918
+ "network_id": network.id,
919
+ "ip": "10.0.1.5",
920
+ "alias_ips": [
867
921
  "10.0.1.6",
868
922
  "10.0.1.7",
869
923
  ],
870
- )],
871
- opts=pulumi.ResourceOptions(depends_on=[network_subnet]))
924
+ }],
925
+ opts = pulumi.ResourceOptions(depends_on=[network_subnet]))
872
926
  ```
927
+
873
928
  ### Server creation from snapshot
874
929
 
875
930
  ```python
876
931
  import pulumi
877
932
  import pulumi_hcloud as hcloud
878
933
 
934
+ # Get image infos because we need the ID
879
935
  packer_snapshot = hcloud.get_image(with_selector="app=foobar",
880
936
  most_recent=True)
881
937
  # Create a new server from the snapshot
882
- from_snapshot = hcloud.Server("fromSnapshot",
938
+ from_snapshot = hcloud.Server("from_snapshot",
939
+ name="from-snapshot",
883
940
  image=packer_snapshot.id,
884
- server_type="cx11",
885
- public_nets=[hcloud.ServerPublicNetArgs(
886
- ipv4_enabled=True,
887
- ipv6_enabled=True,
888
- )])
941
+ server_type="cx22",
942
+ public_nets=[{
943
+ "ipv4_enabled": True,
944
+ "ipv6_enabled": True,
945
+ }])
889
946
  ```
947
+
890
948
  ## Primary IPs
891
949
 
892
950
  When creating a server without linking at least one ´primary_ip´, it automatically creates & assigns two (ipv4 & ipv6).
893
951
  With the public_net block, you can enable or link primary ips. If you don't define this block, two primary ips (ipv4, ipv6) will be created and assigned to the server automatically.
894
952
 
895
- ### Examples
896
-
897
- ```python
898
- import pulumi
899
- import pulumi_hcloud as hcloud
900
-
901
- # Assign existing ipv4 only
902
- server_test_server = hcloud.Server("serverTestServer", public_nets=[hcloud.ServerPublicNetArgs(
903
- ipv4_enabled=True,
904
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
905
- ipv6_enabled=False,
906
- )])
907
- #...
908
- # Link a managed ipv4 but autogenerate ipv6
909
- server_test_index_server_server = hcloud.Server("serverTestIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
910
- ipv4_enabled=True,
911
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
912
- ipv6_enabled=True,
913
- )])
914
- #...
915
- # Assign & create auto-generated ipv4 & ipv6
916
- server_test_hcloud_index_server_server = hcloud.Server("serverTestHcloudIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
917
- ipv4_enabled=True,
918
- ipv6_enabled=True,
919
- )])
920
- #...
921
- ```
922
-
923
953
  ## Import
924
954
 
925
955
  Servers can be imported using the server `id`:
926
956
 
927
957
  ```sh
928
- $ pulumi import hcloud:index/server:Server myserver id
958
+ $ pulumi import hcloud:index/server:Server example "$SERVER_ID"
929
959
  ```
930
960
 
931
961
  :param str resource_name: The name of the resource.
932
962
  :param pulumi.ResourceOptions opts: Options for the resource.
933
963
  :param pulumi.Input[bool] allow_deprecated_images: Enable the use of deprecated images (default: false). **Note** Deprecated images will be removed after three months. Using them is then no longer possible.
934
964
  :param pulumi.Input[bool] backups: Enable or disable backups.
935
- :param pulumi.Input[str] datacenter: The datacenter name to create the server in. `nbg1-dc3`, `fsn1-dc14`, `hel1-dc2`, `ash-dc1` or `hil-dc1`
965
+ :param pulumi.Input[str] datacenter: The datacenter name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
936
966
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection (Needs to be the same as `rebuild_protection`). See "Delete Protection" in the Provider Docs for details.
937
967
  :param pulumi.Input[Sequence[pulumi.Input[int]]] firewall_ids: Firewall IDs the server should be attached to on creation.
938
968
  :param pulumi.Input[bool] ignore_remote_firewall_ids: Ignores any updates
@@ -942,12 +972,12 @@ class Server(pulumi.CustomResource):
942
972
  argument.
943
973
  :param pulumi.Input[str] iso: ID or Name of an ISO image to mount.
944
974
  :param pulumi.Input[bool] keep_disk: If true, do not upgrade the disk. This allows downgrading the server type later.
945
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
946
- :param pulumi.Input[str] location: The location name to create the server in. `nbg1`, `fsn1`, `hel1`, `ash` or `hil`
975
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
976
+ :param pulumi.Input[str] location: The location name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
947
977
  :param pulumi.Input[str] name: Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
948
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerNetworkArgs']]]] networks: Network the server should be attached to on creation. (Can be specified multiple times)
978
+ :param pulumi.Input[Sequence[pulumi.Input[Union['ServerNetworkArgs', 'ServerNetworkArgsDict']]]] networks: Network the server should be attached to on creation. (Can be specified multiple times)
949
979
  :param pulumi.Input[int] placement_group_id: Placement Group ID the server added to on creation.
950
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerPublicNetArgs']]]] public_nets: In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples).
980
+ :param pulumi.Input[Sequence[pulumi.Input[Union['ServerPublicNetArgs', 'ServerPublicNetArgsDict']]]] public_nets: In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples).
951
981
  If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
952
982
  :param pulumi.Input[bool] rebuild_protection: Enable or disable rebuild protection (Needs to be the same as `delete_protection`).
953
983
  :param pulumi.Input[str] rescue: Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems. `linux64` or `linux32`
@@ -966,87 +996,114 @@ class Server(pulumi.CustomResource):
966
996
  Provides an Hetzner Cloud server resource. This can be used to create, modify, and delete servers. Servers also support provisioning.
967
997
 
968
998
  ## Example Usage
999
+
1000
+ ### Basic server creation
1001
+
1002
+ ```python
1003
+ import pulumi
1004
+ import pulumi_hcloud as hcloud
1005
+
1006
+ # Create a new server running debian
1007
+ node1 = hcloud.Server("node1",
1008
+ name="node1",
1009
+ image="debian-11",
1010
+ server_type="cx22",
1011
+ public_nets=[{
1012
+ "ipv4_enabled": True,
1013
+ "ipv6_enabled": True,
1014
+ }])
1015
+ ```
1016
+
1017
+ ```python
1018
+ import pulumi
1019
+ import pulumi_hcloud as hcloud
1020
+
1021
+ ### Server creation with one linked primary ip (ipv4)
1022
+ primary_ip1 = hcloud.PrimaryIp("primary_ip_1",
1023
+ name="primary_ip_test",
1024
+ datacenter="fsn1-dc14",
1025
+ type="ipv4",
1026
+ assignee_type="server",
1027
+ auto_delete=True,
1028
+ labels={
1029
+ "hallo": "welt",
1030
+ })
1031
+ server_test = hcloud.Server("server_test",
1032
+ name="test-server",
1033
+ image="ubuntu-20.04",
1034
+ server_type="cx22",
1035
+ datacenter="fsn1-dc14",
1036
+ labels={
1037
+ "test": "tessst1",
1038
+ },
1039
+ public_nets=[{
1040
+ "ipv4_enabled": True,
1041
+ "ipv4": primary_ip1.id,
1042
+ "ipv6_enabled": False,
1043
+ }])
1044
+ ```
1045
+
969
1046
  ### Server creation with network
1047
+
970
1048
  ```python
971
1049
  import pulumi
972
1050
  import pulumi_hcloud as hcloud
973
1051
 
974
- network = hcloud.Network("network", ip_range="10.0.0.0/16")
1052
+ network = hcloud.Network("network",
1053
+ name="network",
1054
+ ip_range="10.0.0.0/16")
975
1055
  network_subnet = hcloud.NetworkSubnet("network-subnet",
976
1056
  type="cloud",
977
1057
  network_id=network.id,
978
1058
  network_zone="eu-central",
979
1059
  ip_range="10.0.1.0/24")
980
1060
  server = hcloud.Server("server",
981
- server_type="cx11",
1061
+ name="server",
1062
+ server_type="cx22",
982
1063
  image="ubuntu-20.04",
983
1064
  location="nbg1",
984
- networks=[hcloud.ServerNetworkArgs(
985
- network_id=network.id,
986
- ip="10.0.1.5",
987
- alias_ips=[
1065
+ networks=[{
1066
+ "network_id": network.id,
1067
+ "ip": "10.0.1.5",
1068
+ "alias_ips": [
988
1069
  "10.0.1.6",
989
1070
  "10.0.1.7",
990
1071
  ],
991
- )],
992
- opts=pulumi.ResourceOptions(depends_on=[network_subnet]))
1072
+ }],
1073
+ opts = pulumi.ResourceOptions(depends_on=[network_subnet]))
993
1074
  ```
1075
+
994
1076
  ### Server creation from snapshot
995
1077
 
996
1078
  ```python
997
1079
  import pulumi
998
1080
  import pulumi_hcloud as hcloud
999
1081
 
1082
+ # Get image infos because we need the ID
1000
1083
  packer_snapshot = hcloud.get_image(with_selector="app=foobar",
1001
1084
  most_recent=True)
1002
1085
  # Create a new server from the snapshot
1003
- from_snapshot = hcloud.Server("fromSnapshot",
1086
+ from_snapshot = hcloud.Server("from_snapshot",
1087
+ name="from-snapshot",
1004
1088
  image=packer_snapshot.id,
1005
- server_type="cx11",
1006
- public_nets=[hcloud.ServerPublicNetArgs(
1007
- ipv4_enabled=True,
1008
- ipv6_enabled=True,
1009
- )])
1089
+ server_type="cx22",
1090
+ public_nets=[{
1091
+ "ipv4_enabled": True,
1092
+ "ipv6_enabled": True,
1093
+ }])
1010
1094
  ```
1095
+
1011
1096
  ## Primary IPs
1012
1097
 
1013
1098
  When creating a server without linking at least one ´primary_ip´, it automatically creates & assigns two (ipv4 & ipv6).
1014
1099
  With the public_net block, you can enable or link primary ips. If you don't define this block, two primary ips (ipv4, ipv6) will be created and assigned to the server automatically.
1015
1100
 
1016
- ### Examples
1017
-
1018
- ```python
1019
- import pulumi
1020
- import pulumi_hcloud as hcloud
1021
-
1022
- # Assign existing ipv4 only
1023
- server_test_server = hcloud.Server("serverTestServer", public_nets=[hcloud.ServerPublicNetArgs(
1024
- ipv4_enabled=True,
1025
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
1026
- ipv6_enabled=False,
1027
- )])
1028
- #...
1029
- # Link a managed ipv4 but autogenerate ipv6
1030
- server_test_index_server_server = hcloud.Server("serverTestIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
1031
- ipv4_enabled=True,
1032
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
1033
- ipv6_enabled=True,
1034
- )])
1035
- #...
1036
- # Assign & create auto-generated ipv4 & ipv6
1037
- server_test_hcloud_index_server_server = hcloud.Server("serverTestHcloudIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
1038
- ipv4_enabled=True,
1039
- ipv6_enabled=True,
1040
- )])
1041
- #...
1042
- ```
1043
-
1044
1101
  ## Import
1045
1102
 
1046
1103
  Servers can be imported using the server `id`:
1047
1104
 
1048
1105
  ```sh
1049
- $ pulumi import hcloud:index/server:Server myserver id
1106
+ $ pulumi import hcloud:index/server:Server example "$SERVER_ID"
1050
1107
  ```
1051
1108
 
1052
1109
  :param str resource_name: The name of the resource.
@@ -1073,12 +1130,12 @@ class Server(pulumi.CustomResource):
1073
1130
  image: Optional[pulumi.Input[str]] = None,
1074
1131
  iso: Optional[pulumi.Input[str]] = None,
1075
1132
  keep_disk: Optional[pulumi.Input[bool]] = None,
1076
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
1133
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
1077
1134
  location: Optional[pulumi.Input[str]] = None,
1078
1135
  name: Optional[pulumi.Input[str]] = None,
1079
- networks: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerNetworkArgs']]]]] = None,
1136
+ networks: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerNetworkArgs', 'ServerNetworkArgsDict']]]]] = None,
1080
1137
  placement_group_id: Optional[pulumi.Input[int]] = None,
1081
- public_nets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerPublicNetArgs']]]]] = None,
1138
+ public_nets: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerPublicNetArgs', 'ServerPublicNetArgsDict']]]]] = None,
1082
1139
  rebuild_protection: Optional[pulumi.Input[bool]] = None,
1083
1140
  rescue: Optional[pulumi.Input[str]] = None,
1084
1141
  server_type: Optional[pulumi.Input[str]] = None,
@@ -1146,13 +1203,13 @@ class Server(pulumi.CustomResource):
1146
1203
  ipv6_network: Optional[pulumi.Input[str]] = None,
1147
1204
  iso: Optional[pulumi.Input[str]] = None,
1148
1205
  keep_disk: Optional[pulumi.Input[bool]] = None,
1149
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
1206
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
1150
1207
  location: Optional[pulumi.Input[str]] = None,
1151
1208
  name: Optional[pulumi.Input[str]] = None,
1152
- networks: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerNetworkArgs']]]]] = None,
1209
+ networks: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerNetworkArgs', 'ServerNetworkArgsDict']]]]] = None,
1153
1210
  placement_group_id: Optional[pulumi.Input[int]] = None,
1154
1211
  primary_disk_size: Optional[pulumi.Input[int]] = None,
1155
- public_nets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerPublicNetArgs']]]]] = None,
1212
+ public_nets: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerPublicNetArgs', 'ServerPublicNetArgsDict']]]]] = None,
1156
1213
  rebuild_protection: Optional[pulumi.Input[bool]] = None,
1157
1214
  rescue: Optional[pulumi.Input[str]] = None,
1158
1215
  server_type: Optional[pulumi.Input[str]] = None,
@@ -1170,7 +1227,7 @@ class Server(pulumi.CustomResource):
1170
1227
  :param pulumi.Input[bool] allow_deprecated_images: Enable the use of deprecated images (default: false). **Note** Deprecated images will be removed after three months. Using them is then no longer possible.
1171
1228
  :param pulumi.Input[str] backup_window: (string) The backup window of the server, if enabled.
1172
1229
  :param pulumi.Input[bool] backups: Enable or disable backups.
1173
- :param pulumi.Input[str] datacenter: The datacenter name to create the server in. `nbg1-dc3`, `fsn1-dc14`, `hel1-dc2`, `ash-dc1` or `hil-dc1`
1230
+ :param pulumi.Input[str] datacenter: The datacenter name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
1174
1231
  :param pulumi.Input[bool] delete_protection: Enable or disable delete protection (Needs to be the same as `rebuild_protection`). See "Delete Protection" in the Provider Docs for details.
1175
1232
  :param pulumi.Input[Sequence[pulumi.Input[int]]] firewall_ids: Firewall IDs the server should be attached to on creation.
1176
1233
  :param pulumi.Input[bool] ignore_remote_firewall_ids: Ignores any updates
@@ -1183,13 +1240,13 @@ class Server(pulumi.CustomResource):
1183
1240
  :param pulumi.Input[str] ipv6_network: (string) The IPv6 network.
1184
1241
  :param pulumi.Input[str] iso: ID or Name of an ISO image to mount.
1185
1242
  :param pulumi.Input[bool] keep_disk: If true, do not upgrade the disk. This allows downgrading the server type later.
1186
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
1187
- :param pulumi.Input[str] location: The location name to create the server in. `nbg1`, `fsn1`, `hel1`, `ash` or `hil`
1243
+ :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: User-defined labels (key-value pairs) should be created with.
1244
+ :param pulumi.Input[str] location: The location name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
1188
1245
  :param pulumi.Input[str] name: Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
1189
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerNetworkArgs']]]] networks: Network the server should be attached to on creation. (Can be specified multiple times)
1246
+ :param pulumi.Input[Sequence[pulumi.Input[Union['ServerNetworkArgs', 'ServerNetworkArgsDict']]]] networks: Network the server should be attached to on creation. (Can be specified multiple times)
1190
1247
  :param pulumi.Input[int] placement_group_id: Placement Group ID the server added to on creation.
1191
1248
  :param pulumi.Input[int] primary_disk_size: (int) The size of the primary disk in GB.
1192
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerPublicNetArgs']]]] public_nets: In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples).
1249
+ :param pulumi.Input[Sequence[pulumi.Input[Union['ServerPublicNetArgs', 'ServerPublicNetArgsDict']]]] public_nets: In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples).
1193
1250
  If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
1194
1251
  :param pulumi.Input[bool] rebuild_protection: Enable or disable rebuild protection (Needs to be the same as `delete_protection`).
1195
1252
  :param pulumi.Input[str] rescue: Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems. `linux64` or `linux32`
@@ -1242,13 +1299,11 @@ class Server(pulumi.CustomResource):
1242
1299
 
1243
1300
  @property
1244
1301
  @pulumi.getter(name="backupWindow")
1302
+ @_utilities.deprecated("""You should remove this property from your terraform configuration.""")
1245
1303
  def backup_window(self) -> pulumi.Output[str]:
1246
1304
  """
1247
1305
  (string) The backup window of the server, if enabled.
1248
1306
  """
1249
- warnings.warn("""You should remove this property from your terraform configuration.""", DeprecationWarning)
1250
- pulumi.log.warn("""backup_window is deprecated: You should remove this property from your terraform configuration.""")
1251
-
1252
1307
  return pulumi.get(self, "backup_window")
1253
1308
 
1254
1309
  @property
@@ -1263,7 +1318,7 @@ class Server(pulumi.CustomResource):
1263
1318
  @pulumi.getter
1264
1319
  def datacenter(self) -> pulumi.Output[str]:
1265
1320
  """
1266
- The datacenter name to create the server in. `nbg1-dc3`, `fsn1-dc14`, `hel1-dc2`, `ash-dc1` or `hil-dc1`
1321
+ The datacenter name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
1267
1322
  """
1268
1323
  return pulumi.get(self, "datacenter")
1269
1324
 
@@ -1342,7 +1397,7 @@ class Server(pulumi.CustomResource):
1342
1397
 
1343
1398
  @property
1344
1399
  @pulumi.getter
1345
- def labels(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
1400
+ def labels(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
1346
1401
  """
1347
1402
  User-defined labels (key-value pairs) should be created with.
1348
1403
  """
@@ -1352,7 +1407,7 @@ class Server(pulumi.CustomResource):
1352
1407
  @pulumi.getter
1353
1408
  def location(self) -> pulumi.Output[str]:
1354
1409
  """
1355
- The location name to create the server in. `nbg1`, `fsn1`, `hel1`, `ash` or `hil`
1410
+ The location name to create the server in. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
1356
1411
  """
1357
1412
  return pulumi.get(self, "location")
1358
1413