This message was deleted.
# aws
s
This message was deleted.
w
This example may help: https://github.com/pulumi/examples/blob/master/aws-go-webserver/main.go#L42 You may need to augment that with
.apply
or
.all
to resolve those values to build the string as per: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/#all
❤️ 1
f
Thanks @witty-candle-66007 , I came out with a solution
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
👍 2