This message was deleted.
# general
s
This message was deleted.
f
I'm not a Go person, so I can't speak to the particulars, but I have done this with Python several times. You'll basically end up using a
pulumi.Output.all(...)
call, passing all your variables in, and call
.apply(...)
with a function that takes those variables and your templating solution of choice and spits out the final rendered output.
❤️ 1
f
Thank you @full-artist-27215
Copy code
userDataTpl, err := template.New("bash_script.tpl.sh").
			ParseFiles("./templates/bash_script.tpl.sh")
		if err != nil {
			return err
		}

		userData := internalLoadBalancer.DnsName.ApplyT(
			func(lbDNSName string) (*string, error) {
				buf := new(bytes.Buffer)
				err := userDataFrontendTpl.Execute(buf, map[string]string{"internal_lb_dns_name": lbDNSName})
				userData := base64.StdEncoding.EncodeToString(buf.Bytes())
				return &userData, err
			},
		).(pulumi.StringPtrOutput)
worked like a charm with native go templating engine
f
awesome 😎