Open t3hmrman opened 1 year ago
Thanks for reporting this, @t3hmrman! It's an odd one since in the official docs of the latest version of Hetzner's own Terraform provider, load balancer ids are still ints. Same for the load_balancer_id
parameter of hcloud_load_balancer_target
, whereas the same load_balancer_id
of hcloud_load_balancer_service
is a string.
We'll be looking into this. We are a bit behind the upstream provider, so it might make sense for Pulumi to upgrade first (#159, cc @guineveresaenger).
Hey @thomas11 thanks for taking a look -- I was really perplexed by this when it was coming up as an error (especially since the code had been working in a previous project) -- my first instinct was that something someone thought could be a "big int" ended up being much better as a string (and maybe eventually a UUID?) probably at the source :)
I wasn't able to find a work around (I could have either manually attached since the number of connections wasn't too huge, or used a different API from code, etc) but I'm sure someone motivated enough can either change the code or find a workaround.
Hi @t3hmrman would it be possible to check if this is still an issue on the newly released v1.10.2? Thomas thought it might be fixed by the upstream provider upgrade.
Hey @t0yv0 absolutely! Sorry I haven't been able to get around to this yet -- I changed the infrastructure a little bit.
Should be able to get to this by the end of the week.
Finally got around to upgrading to v1.10.2 and the error is still there:
VALUE: 1034544-2407574
hcloud:index:LoadBalancerTarget (eu-central-0-ctrl-lb-tgt-0):
error: hcloud:index/loadBalancerTarget:LoadBalancerTarget resource 'eu-central-0-ctrl-lb-tgt-0' has a problem: cannot parse '' as int: strconv.ParseInt: parsing "1034544-2407574": invalid syntax. Examine values at 'LoadBalancerTarget.LoadBalancerId'.
Checked upstream again.
https://github.com/hetznercloud/terraform-provider-hcloud/blob/main/internal/loadbalancer/resource_target.go#L52 still an int
https://github.com/hetznercloud/terraform-provider-hcloud/blob/main/internal/loadbalancer/resource_service.go#L38 is a string here now
I believe the most straightforward way to fix this would be to submit a PR upstream to https://github.com/hetznercloud/terraform-provider-hcloud and have them do a patch release, then go through another round of upgrades here.
Seems the upstream provider doesn't feel this pain because they internally use a string (even through they declare it as an int in TF schema?) (see https://github.com/hetznercloud/terraform-provider-hcloud/issues/862)
What happened?
It seems like the Hetzner API has shifted over the years -- IDs for load balancers are no longer numbers, but instead numeric strings sometimes separated by dashes like the following:
nnnnnnn-nnnnnnn
Steps to reproduce
LoadBalancer
LoadBalancerService
orLoadBalancerTarget
Expected Behavior
Creating a
LoadBalancer
with aLoadBalancerTarget
andLoadBalancerService
s should have succeeded when applied.Actual Behavior
An error is produced:
Output of
pulumi about
CLI
Version 3.51.0
Go Version go1.19.4
Go Compiler gc
Plugins
NAME VERSION
aws 2.13.1
aws 2.13.1
hcloud 1.10.1
hcloud 1.10.1
nodejs unknown
Host
OS arch
Version "rolling"
Arch x86_64
Additional context
There is a work around which only works for
LoadBalancerService
andLoadBalancerNetwork
:This works on the Typescript side and the resource is applied. I suspect this works since the
load_balancer_id
is astr
inload_balancer_service.py
. This trick does not work on theLoadBalancerTarget
.Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).