Hey, I just got around to trying out Pulumi for th...
# python
m
Hey, I just got around to trying out Pulumi for the first time, and I seem to have some issues with the Hetzner integration. Specifically, when I try to create a server bound to a placement group and a network, I get this:
Copy code
Diagnostics:
  hcloud:index:Server (master-1):
    error: hcloud:index/server:Server resource 'master-1' has a problem: Attribute must be a whole number, got 47074. Examine values at 'Server.PlacementGroupId'.
    error: hcloud:index/server:Server resource 'master-1' has a problem: Attribute must be a whole number, got 1710474. Examine values at 'Server.Networks'.
Seems that the Server object expects IDs to come in as integers, but the objects provide IDs as strings. Here's the relevant parts form the code:
Copy code
import pulumi_hcloud as hcloud

network = hcloud.Network("cluster-net",
  ip_range="10.0.1.0/24",
)
master_group = hcloud.PlacementGroup("masters", type="spread")

for i in range(3):
    node = hcloud.Server(
        f"master-{i+1}",
        backups=False,
        location="hel1",
        server_type="CX21",
        image="ubuntu-20.04",
        networks=[{
            "network_id": network.id,
        }],
        placement_group_id=master_group.id
    )
    hcloud.Rdns(
        f"master-{i+1}",
        server_id=node.id,
        ip_address=node.ipv4_address,
        dns_ptr=f"master-{i+1}.<http://kube.golyalpha.tk|kube.golyalpha.tk>"
    )
The network and placement group gets created just fine beforehand
b
@microscopic-holiday-73461 opening issues for this would be helpful, in the hetzner repo
👍 1
m
Just making sure I'm not doing something obviously wrong. 😄
Looking at the issues there (since 2021), it seems the workaround for now is the
.apply
method