astonishing-nightfall-90291
08/27/2023, 3:58 AMpiholeToken := c.RequireSecret("piholeToken")
to use it with my pihole code, but the problem is that the APIToken
field expects a string and RequireSecret
returns a pulumi.StringOutput
I've tried the ApplyT
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
piToken := c.RequireSecret("piholeToken").ApplyT(func(s string) string { return s }).(pulumi.StringOutput)
fmt.Println(piToken)
pc := pihole.New(pihole.Config{
BaseURL: "<http://pi.hole>,",
APIToken: piToken,
HttpClient: nil,
Headers: nil,
})
err = utils.NewPiHoleRecord(ctx, pc, "A", name, cArgs.IPv4)
salmon-account-74572
08/28/2023, 2:49 PMApplyT
and instead set APIToken: pulumi.String(piToken)
and see if that works.