https://pulumi.com logo
Title
m

microscopic-holiday-73461

06/04/2022, 5:20 AM
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:
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:
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

billowy-army-68599

06/04/2022, 8:01 AM
@microscopic-holiday-73461 opening issues for this would be helpful, in the hetzner repo
👍 1
m

microscopic-holiday-73461

06/04/2022, 8:02 AM
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