Hi - I followed the example for creating a linode ...
# general
s
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/:
Copy code
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
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:
Copy code
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
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