Hi All, i'm starting to work with pulumi and golan...
# golang
Hi All, i'm starting to work with pulumi and golang as a way to train myself with the language as I'm not that experienced. I'm building a homelab stack for myself with Proxmox and some other stuff alongside with PiHole for DNS I'm trying to use the go-pihole for creating a DNS, outside of pulumi provider as it's not supported yet (maybe in a future I can see myself implementing one) But the problem I have now is that I'm requiring a secret, with
piholeToken := c.RequireSecret("piholeToken")
to use it with my pihole code, but the problem is that the
field expects a string and
returns a
I've tried the
approach but didn't have any success. because both the IDE and the
pulumi up
complains that it's not the same type. even after using as per docs. Maybe it's just my lack of knowledge in Golang, but I can't make it work... Can someone shed a light on what am I missing? Here's the piece of code
Copy code
piToken := c.RequireSecret("piholeToken").ApplyT(func(s string) string { return s }).(pulumi.StringOutput)

	pc := pihole.New(pihole.Config{
		BaseURL:    "<http://pi.hole>,",
		APIToken:   piToken,
		HttpClient: nil,
		Headers:    nil,
	err = utils.NewPiHoleRecord(ctx, pc, "A", name, cArgs.IPv4)
Try getting rid of the
and instead set
APIToken: pulumi.String(piToken)
and see if that works.
I had to go out for a bit and forgot to answer, Sorry sad panda. But that doesn't work 😕 because the
doesn't support
as a type. That's why I tried the
Here's a screenshot from the IDE