https://pulumi.com logo
#golang
Title
# golang
m

miniature-library-50162

01/04/2024, 11:12 PM
Am I getting dump or is https://www.pulumi.com/registry/packages/hcloud/api-docs/primaryip/#example-usage not up to date anymore? When I want to assign the ip address to a server like in this example I get this:
Copy code
[00] pkg/stack/program.go:85:19: cannot use ipv4.ID() (value of type pulumi.IDOutput) as pulumi.IntPtrInput value in struct literal: pulumi.IDOutput does not implement pulumi.IntPtrInput (missing method ToIntPtrOutput)
[00] pkg/stack/program.go:87:19: cannot use ipv6.ID() (value of type pulumi.IDOutput) as pulumi.IntPtrInput value in struct literal: pulumi.IDOutput does not implement pulumi.IntPtrInput (missing method ToIntPtrOutput)
c

colossal-tailor-72573

01/05/2024, 3:23 AM
sometimes the docs are slightly off. check out this https://www.pulumi.com/registry/packages/hcloud/api-docs/server/ and see if you can figure out what should be done. If that doesn't get you anywhere, the way I find out is by looking through pulumi source files.
m

miniature-library-50162

01/05/2024, 12:24 PM
Found a way that works:
ipv4.ID().ApplyT(strconv.Atoi).(pulumi.IntOutput)