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
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,
@@ -848,28 +851,28 @@ class Server(pulumi.CustomResource):
848
851
 
849
852
  ### Basic server creation
850
853
 
851
- <!--Start PulumiCodeChooser -->
852
854
  ```python
853
855
  import pulumi
854
856
  import pulumi_hcloud as hcloud
855
857
 
856
858
  # Create a new server running debian
857
859
  node1 = hcloud.Server("node1",
860
+ name="node1",
858
861
  image="debian-11",
859
- public_nets=[hcloud.ServerPublicNetArgs(
860
- ipv4_enabled=True,
861
- ipv6_enabled=True,
862
- )],
863
- server_type="cx11")
862
+ server_type="cx22",
863
+ public_nets=[{
864
+ "ipv4_enabled": True,
865
+ "ipv6_enabled": True,
866
+ }])
864
867
  ```
865
- <!--End PulumiCodeChooser -->
866
- <!--Start PulumiCodeChooser -->
868
+
867
869
  ```python
868
870
  import pulumi
869
871
  import pulumi_hcloud as hcloud
870
872
 
871
873
  ### Server creation with one linked primary ip (ipv4)
872
- primary_ip1 = hcloud.PrimaryIp("primaryIp1",
874
+ primary_ip1 = hcloud.PrimaryIp("primary_ip_1",
875
+ name="primary_ip_test",
873
876
  datacenter="fsn1-dc14",
874
877
  type="ipv4",
875
878
  assignee_type="server",
@@ -877,116 +880,89 @@ class Server(pulumi.CustomResource):
877
880
  labels={
878
881
  "hallo": "welt",
879
882
  })
880
- server_test = hcloud.Server("serverTest",
883
+ server_test = hcloud.Server("server_test",
884
+ name="test-server",
881
885
  image="ubuntu-20.04",
882
- server_type="cx11",
886
+ server_type="cx22",
883
887
  datacenter="fsn1-dc14",
884
888
  labels={
885
889
  "test": "tessst1",
886
890
  },
887
- public_nets=[hcloud.ServerPublicNetArgs(
888
- ipv4_enabled=True,
889
- ipv4=primary_ip1.id,
890
- ipv6_enabled=False,
891
- )])
891
+ public_nets=[{
892
+ "ipv4_enabled": True,
893
+ "ipv4": primary_ip1.id,
894
+ "ipv6_enabled": False,
895
+ }])
892
896
  ```
893
- <!--End PulumiCodeChooser -->
897
+
894
898
  ### Server creation with network
895
- <!--Start PulumiCodeChooser -->
899
+
896
900
  ```python
897
901
  import pulumi
898
902
  import pulumi_hcloud as hcloud
899
903
 
900
- 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")
901
907
  network_subnet = hcloud.NetworkSubnet("network-subnet",
902
908
  type="cloud",
903
909
  network_id=network.id,
904
910
  network_zone="eu-central",
905
911
  ip_range="10.0.1.0/24")
906
912
  server = hcloud.Server("server",
907
- server_type="cx11",
913
+ name="server",
914
+ server_type="cx22",
908
915
  image="ubuntu-20.04",
909
916
  location="nbg1",
910
- networks=[hcloud.ServerNetworkArgs(
911
- network_id=network.id,
912
- ip="10.0.1.5",
913
- alias_ips=[
917
+ networks=[{
918
+ "network_id": network.id,
919
+ "ip": "10.0.1.5",
920
+ "alias_ips": [
914
921
  "10.0.1.6",
915
922
  "10.0.1.7",
916
923
  ],
917
- )],
918
- opts=pulumi.ResourceOptions(depends_on=[network_subnet]))
924
+ }],
925
+ opts = pulumi.ResourceOptions(depends_on=[network_subnet]))
919
926
  ```
920
- <!--End PulumiCodeChooser -->
921
927
 
922
928
  ### Server creation from snapshot
923
929
 
924
- <!--Start PulumiCodeChooser -->
925
930
  ```python
926
931
  import pulumi
927
932
  import pulumi_hcloud as hcloud
928
933
 
934
+ # Get image infos because we need the ID
929
935
  packer_snapshot = hcloud.get_image(with_selector="app=foobar",
930
936
  most_recent=True)
931
937
  # Create a new server from the snapshot
932
- from_snapshot = hcloud.Server("fromSnapshot",
938
+ from_snapshot = hcloud.Server("from_snapshot",
939
+ name="from-snapshot",
933
940
  image=packer_snapshot.id,
934
- server_type="cx11",
935
- public_nets=[hcloud.ServerPublicNetArgs(
936
- ipv4_enabled=True,
937
- ipv6_enabled=True,
938
- )])
941
+ server_type="cx22",
942
+ public_nets=[{
943
+ "ipv4_enabled": True,
944
+ "ipv6_enabled": True,
945
+ }])
939
946
  ```
940
- <!--End PulumiCodeChooser -->
941
947
 
942
948
  ## Primary IPs
943
949
 
944
950
  When creating a server without linking at least one ´primary_ip´, it automatically creates & assigns two (ipv4 & ipv6).
945
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.
946
952
 
947
- ### Examples
948
-
949
- <!--Start PulumiCodeChooser -->
950
- ```python
951
- import pulumi
952
- import pulumi_hcloud as hcloud
953
-
954
- # Assign existing ipv4 only
955
- server_test_server = hcloud.Server("serverTestServer", public_nets=[hcloud.ServerPublicNetArgs(
956
- ipv4_enabled=True,
957
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
958
- ipv6_enabled=False,
959
- )])
960
- #...
961
- # Link a managed ipv4 but autogenerate ipv6
962
- server_test_index_server_server = hcloud.Server("serverTestIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
963
- ipv4_enabled=True,
964
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
965
- ipv6_enabled=True,
966
- )])
967
- #...
968
- # Assign & create auto-generated ipv4 & ipv6
969
- server_test_hcloud_index_server_server = hcloud.Server("serverTestHcloudIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
970
- ipv4_enabled=True,
971
- ipv6_enabled=True,
972
- )])
973
- #...
974
- ```
975
- <!--End PulumiCodeChooser -->
976
-
977
953
  ## Import
978
954
 
979
955
  Servers can be imported using the server `id`:
980
956
 
981
957
  ```sh
982
- $ pulumi import hcloud:index/server:Server myserver id
958
+ $ pulumi import hcloud:index/server:Server example "$SERVER_ID"
983
959
  ```
984
960
 
985
961
  :param str resource_name: The name of the resource.
986
962
  :param pulumi.ResourceOptions opts: Options for the resource.
987
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.
988
964
  :param pulumi.Input[bool] backups: Enable or disable backups.
989
- :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.
990
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.
991
967
  :param pulumi.Input[Sequence[pulumi.Input[int]]] firewall_ids: Firewall IDs the server should be attached to on creation.
992
968
  :param pulumi.Input[bool] ignore_remote_firewall_ids: Ignores any updates
@@ -996,12 +972,12 @@ class Server(pulumi.CustomResource):
996
972
  argument.
997
973
  :param pulumi.Input[str] iso: ID or Name of an ISO image to mount.
998
974
  :param pulumi.Input[bool] keep_disk: If true, do not upgrade the disk. This allows downgrading the server type later.
999
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
1000
- :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.
1001
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).
1002
- :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)
1003
979
  :param pulumi.Input[int] placement_group_id: Placement Group ID the server added to on creation.
1004
- :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).
1005
981
  If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
1006
982
  :param pulumi.Input[bool] rebuild_protection: Enable or disable rebuild protection (Needs to be the same as `delete_protection`).
1007
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`
@@ -1023,28 +999,28 @@ class Server(pulumi.CustomResource):
1023
999
 
1024
1000
  ### Basic server creation
1025
1001
 
1026
- <!--Start PulumiCodeChooser -->
1027
1002
  ```python
1028
1003
  import pulumi
1029
1004
  import pulumi_hcloud as hcloud
1030
1005
 
1031
1006
  # Create a new server running debian
1032
1007
  node1 = hcloud.Server("node1",
1008
+ name="node1",
1033
1009
  image="debian-11",
1034
- public_nets=[hcloud.ServerPublicNetArgs(
1035
- ipv4_enabled=True,
1036
- ipv6_enabled=True,
1037
- )],
1038
- server_type="cx11")
1010
+ server_type="cx22",
1011
+ public_nets=[{
1012
+ "ipv4_enabled": True,
1013
+ "ipv6_enabled": True,
1014
+ }])
1039
1015
  ```
1040
- <!--End PulumiCodeChooser -->
1041
- <!--Start PulumiCodeChooser -->
1016
+
1042
1017
  ```python
1043
1018
  import pulumi
1044
1019
  import pulumi_hcloud as hcloud
1045
1020
 
1046
1021
  ### Server creation with one linked primary ip (ipv4)
1047
- primary_ip1 = hcloud.PrimaryIp("primaryIp1",
1022
+ primary_ip1 = hcloud.PrimaryIp("primary_ip_1",
1023
+ name="primary_ip_test",
1048
1024
  datacenter="fsn1-dc14",
1049
1025
  type="ipv4",
1050
1026
  assignee_type="server",
@@ -1052,109 +1028,82 @@ class Server(pulumi.CustomResource):
1052
1028
  labels={
1053
1029
  "hallo": "welt",
1054
1030
  })
1055
- server_test = hcloud.Server("serverTest",
1031
+ server_test = hcloud.Server("server_test",
1032
+ name="test-server",
1056
1033
  image="ubuntu-20.04",
1057
- server_type="cx11",
1034
+ server_type="cx22",
1058
1035
  datacenter="fsn1-dc14",
1059
1036
  labels={
1060
1037
  "test": "tessst1",
1061
1038
  },
1062
- public_nets=[hcloud.ServerPublicNetArgs(
1063
- ipv4_enabled=True,
1064
- ipv4=primary_ip1.id,
1065
- ipv6_enabled=False,
1066
- )])
1039
+ public_nets=[{
1040
+ "ipv4_enabled": True,
1041
+ "ipv4": primary_ip1.id,
1042
+ "ipv6_enabled": False,
1043
+ }])
1067
1044
  ```
1068
- <!--End PulumiCodeChooser -->
1045
+
1069
1046
  ### Server creation with network
1070
- <!--Start PulumiCodeChooser -->
1047
+
1071
1048
  ```python
1072
1049
  import pulumi
1073
1050
  import pulumi_hcloud as hcloud
1074
1051
 
1075
- 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")
1076
1055
  network_subnet = hcloud.NetworkSubnet("network-subnet",
1077
1056
  type="cloud",
1078
1057
  network_id=network.id,
1079
1058
  network_zone="eu-central",
1080
1059
  ip_range="10.0.1.0/24")
1081
1060
  server = hcloud.Server("server",
1082
- server_type="cx11",
1061
+ name="server",
1062
+ server_type="cx22",
1083
1063
  image="ubuntu-20.04",
1084
1064
  location="nbg1",
1085
- networks=[hcloud.ServerNetworkArgs(
1086
- network_id=network.id,
1087
- ip="10.0.1.5",
1088
- alias_ips=[
1065
+ networks=[{
1066
+ "network_id": network.id,
1067
+ "ip": "10.0.1.5",
1068
+ "alias_ips": [
1089
1069
  "10.0.1.6",
1090
1070
  "10.0.1.7",
1091
1071
  ],
1092
- )],
1093
- opts=pulumi.ResourceOptions(depends_on=[network_subnet]))
1072
+ }],
1073
+ opts = pulumi.ResourceOptions(depends_on=[network_subnet]))
1094
1074
  ```
1095
- <!--End PulumiCodeChooser -->
1096
1075
 
1097
1076
  ### Server creation from snapshot
1098
1077
 
1099
- <!--Start PulumiCodeChooser -->
1100
1078
  ```python
1101
1079
  import pulumi
1102
1080
  import pulumi_hcloud as hcloud
1103
1081
 
1082
+ # Get image infos because we need the ID
1104
1083
  packer_snapshot = hcloud.get_image(with_selector="app=foobar",
1105
1084
  most_recent=True)
1106
1085
  # Create a new server from the snapshot
1107
- from_snapshot = hcloud.Server("fromSnapshot",
1086
+ from_snapshot = hcloud.Server("from_snapshot",
1087
+ name="from-snapshot",
1108
1088
  image=packer_snapshot.id,
1109
- server_type="cx11",
1110
- public_nets=[hcloud.ServerPublicNetArgs(
1111
- ipv4_enabled=True,
1112
- ipv6_enabled=True,
1113
- )])
1089
+ server_type="cx22",
1090
+ public_nets=[{
1091
+ "ipv4_enabled": True,
1092
+ "ipv6_enabled": True,
1093
+ }])
1114
1094
  ```
1115
- <!--End PulumiCodeChooser -->
1116
1095
 
1117
1096
  ## Primary IPs
1118
1097
 
1119
1098
  When creating a server without linking at least one ´primary_ip´, it automatically creates & assigns two (ipv4 & ipv6).
1120
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.
1121
1100
 
1122
- ### Examples
1123
-
1124
- <!--Start PulumiCodeChooser -->
1125
- ```python
1126
- import pulumi
1127
- import pulumi_hcloud as hcloud
1128
-
1129
- # Assign existing ipv4 only
1130
- server_test_server = hcloud.Server("serverTestServer", public_nets=[hcloud.ServerPublicNetArgs(
1131
- ipv4_enabled=True,
1132
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
1133
- ipv6_enabled=False,
1134
- )])
1135
- #...
1136
- # Link a managed ipv4 but autogenerate ipv6
1137
- server_test_index_server_server = hcloud.Server("serverTestIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
1138
- ipv4_enabled=True,
1139
- ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
1140
- ipv6_enabled=True,
1141
- )])
1142
- #...
1143
- # Assign & create auto-generated ipv4 & ipv6
1144
- server_test_hcloud_index_server_server = hcloud.Server("serverTestHcloudIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
1145
- ipv4_enabled=True,
1146
- ipv6_enabled=True,
1147
- )])
1148
- #...
1149
- ```
1150
- <!--End PulumiCodeChooser -->
1151
-
1152
1101
  ## Import
1153
1102
 
1154
1103
  Servers can be imported using the server `id`:
1155
1104
 
1156
1105
  ```sh
1157
- $ pulumi import hcloud:index/server:Server myserver id
1106
+ $ pulumi import hcloud:index/server:Server example "$SERVER_ID"
1158
1107
  ```
1159
1108
 
1160
1109
  :param str resource_name: The name of the resource.
@@ -1181,12 +1130,12 @@ class Server(pulumi.CustomResource):
1181
1130
  image: Optional[pulumi.Input[str]] = None,
1182
1131
  iso: Optional[pulumi.Input[str]] = None,
1183
1132
  keep_disk: Optional[pulumi.Input[bool]] = None,
1184
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
1133
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
1185
1134
  location: Optional[pulumi.Input[str]] = None,
1186
1135
  name: Optional[pulumi.Input[str]] = None,
1187
- networks: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerNetworkArgs']]]]] = None,
1136
+ networks: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerNetworkArgs', 'ServerNetworkArgsDict']]]]] = None,
1188
1137
  placement_group_id: Optional[pulumi.Input[int]] = None,
1189
- 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,
1190
1139
  rebuild_protection: Optional[pulumi.Input[bool]] = None,
1191
1140
  rescue: Optional[pulumi.Input[str]] = None,
1192
1141
  server_type: Optional[pulumi.Input[str]] = None,
@@ -1254,13 +1203,13 @@ class Server(pulumi.CustomResource):
1254
1203
  ipv6_network: Optional[pulumi.Input[str]] = None,
1255
1204
  iso: Optional[pulumi.Input[str]] = None,
1256
1205
  keep_disk: Optional[pulumi.Input[bool]] = None,
1257
- labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
1206
+ labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
1258
1207
  location: Optional[pulumi.Input[str]] = None,
1259
1208
  name: Optional[pulumi.Input[str]] = None,
1260
- networks: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerNetworkArgs']]]]] = None,
1209
+ networks: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ServerNetworkArgs', 'ServerNetworkArgsDict']]]]] = None,
1261
1210
  placement_group_id: Optional[pulumi.Input[int]] = None,
1262
1211
  primary_disk_size: Optional[pulumi.Input[int]] = None,
1263
- 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,
1264
1213
  rebuild_protection: Optional[pulumi.Input[bool]] = None,
1265
1214
  rescue: Optional[pulumi.Input[str]] = None,
1266
1215
  server_type: Optional[pulumi.Input[str]] = None,
@@ -1278,7 +1227,7 @@ class Server(pulumi.CustomResource):
1278
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.
1279
1228
  :param pulumi.Input[str] backup_window: (string) The backup window of the server, if enabled.
1280
1229
  :param pulumi.Input[bool] backups: Enable or disable backups.
1281
- :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.
1282
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.
1283
1232
  :param pulumi.Input[Sequence[pulumi.Input[int]]] firewall_ids: Firewall IDs the server should be attached to on creation.
1284
1233
  :param pulumi.Input[bool] ignore_remote_firewall_ids: Ignores any updates
@@ -1291,13 +1240,13 @@ class Server(pulumi.CustomResource):
1291
1240
  :param pulumi.Input[str] ipv6_network: (string) The IPv6 network.
1292
1241
  :param pulumi.Input[str] iso: ID or Name of an ISO image to mount.
1293
1242
  :param pulumi.Input[bool] keep_disk: If true, do not upgrade the disk. This allows downgrading the server type later.
1294
- :param pulumi.Input[Mapping[str, Any]] labels: User-defined labels (key-value pairs) should be created with.
1295
- :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.
1296
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).
1297
- :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)
1298
1247
  :param pulumi.Input[int] placement_group_id: Placement Group ID the server added to on creation.
1299
1248
  :param pulumi.Input[int] primary_disk_size: (int) The size of the primary disk in GB.
1300
- :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).
1301
1250
  If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
1302
1251
  :param pulumi.Input[bool] rebuild_protection: Enable or disable rebuild protection (Needs to be the same as `delete_protection`).
1303
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`
@@ -1350,13 +1299,11 @@ class Server(pulumi.CustomResource):
1350
1299
 
1351
1300
  @property
1352
1301
  @pulumi.getter(name="backupWindow")
1302
+ @_utilities.deprecated("""You should remove this property from your terraform configuration.""")
1353
1303
  def backup_window(self) -> pulumi.Output[str]:
1354
1304
  """
1355
1305
  (string) The backup window of the server, if enabled.
1356
1306
  """
1357
- warnings.warn("""You should remove this property from your terraform configuration.""", DeprecationWarning)
1358
- pulumi.log.warn("""backup_window is deprecated: You should remove this property from your terraform configuration.""")
1359
-
1360
1307
  return pulumi.get(self, "backup_window")
1361
1308
 
1362
1309
  @property
@@ -1371,7 +1318,7 @@ class Server(pulumi.CustomResource):
1371
1318
  @pulumi.getter
1372
1319
  def datacenter(self) -> pulumi.Output[str]:
1373
1320
  """
1374
- 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.
1375
1322
  """
1376
1323
  return pulumi.get(self, "datacenter")
1377
1324
 
@@ -1450,7 +1397,7 @@ class Server(pulumi.CustomResource):
1450
1397
 
1451
1398
  @property
1452
1399
  @pulumi.getter
1453
- def labels(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
1400
+ def labels(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
1454
1401
  """
1455
1402
  User-defined labels (key-value pairs) should be created with.
1456
1403
  """
@@ -1460,7 +1407,7 @@ class Server(pulumi.CustomResource):
1460
1407
  @pulumi.getter
1461
1408
  def location(self) -> pulumi.Output[str]:
1462
1409
  """
1463
- 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.
1464
1411
  """
1465
1412
  return pulumi.get(self, "location")
1466
1413