sparse-intern-71089
06/21/2022, 6:06 AMmagnificent-helicopter-3467
06/21/2022, 6:09 AMechoing-dinner-19531
06/21/2022, 10:19 AMfmt.Println("ENV:", os.Getenv("PULUMI_CONFIG"))
to check the program config looks right. Should be a JSON object with all your values in it.magnificent-helicopter-3467
06/21/2022, 3:59 PMechoing-dinner-19531
06/21/2022, 4:24 PMmagnificent-helicopter-3467
06/21/2022, 7:58 PMconfig:
gcp-go-gke:data:
cluster:
name: my-cluster
gcp:project: my-proj
gcp:zone: us-west1-a
`main.go`:
type Data struct {
cluster Cluster
}
type Cluster struct {
name string
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
var d Data
cfg := config.New(ctx, "")
cfg.RequireObject("data", &d)
fmt.Println("Cluster name is:", d.cluster.name)
return nil
})
}
And d.cluster.name
here is ""
magnificent-helicopter-3467
06/21/2022, 7:59 PMmagnificent-helicopter-3467
06/21/2022, 8:36 PMRequireObject
can properly populate the passed in struct.echoing-dinner-19531
06/22/2022, 9:32 AM