https://pulumi.com logo
Title
s

shy-architect-77550

06/09/2021, 11:11 PM
Hi - I followed the example for creating a linode nodebalancer per the docs (literally cut and paste the example) and pulumi returns an error. The example is this snippet from https://www.pulumi.com/docs/reference/pkg/linode/nodebalancerconfig/:
foobar = linode.NodeBalancer("foobar",
    label="mynodebalancer",
    region="us-east",
    client_conn_throttle=20)
foofig = linode.NodeBalancerConfig("foofig",
    nodebalancer_id=foobar.id,
    port=8088,
    protocol="http",
    check="http",
    check_path="/foo",
    check_attempts=3,
    check_timeout=30,
    stickiness="http_cookie",
    algorithm="source")
The error is:
error: linode:index/nodeBalancerConfig:NodeBalancerConfig resource 'foofig' has a problem: Attribute must be a whole number, got 143111. Examine values at 'NodeBalancerConfig.NodebalancerId'.
🐞 1
1
r

red-match-15116

06/09/2021, 11:26 PM
It looks like the output from
foobar.id
is a string, but
nodebalancer_id
expects an
int
as the input. You’ll have to do something like:
foobar = linode.NodeBalancer("foobar",
    label="mynodebalancer",
    region="us-east",
    client_conn_throttle=20)
foofig = linode.NodeBalancerConfig("foofig",
    nodebalancer_id=foobar.id.apply(lambda x: int(x)),
    port=8088,
    protocol="http",
    check="http",
    check_path="/foo",
    check_attempts=3,
    check_timeout=30,
    stickiness="http_cookie",
    algorithm="source")
s

shy-architect-77550

06/09/2021, 11:30 PM
thanks I was just trying a similar solution!
confirmed there are several type issues with the entire linode library. Makes the code a bit messy to work with. I'll try to open an issue on github tomorrow