clean-advantage-13612
09/03/2023, 10:29 PMpulumi.MapOutput
object? Something similar to pprint
from Python would be ideal, but I’ll take anything.
Context: I’m trying to do this in Go.alert-nightfall-64120
09/03/2023, 11:13 PMtest := pulumi.Map{
"hello": pulumi.String("world"),
}
test.ToMapOutput().ApplyT(func(m map[string]interface{}) {
b, err := json.MarshalIndent(m, "", " ")
if err != nil {
return
}
<http://ctx.Log.Info|ctx.Log.Info>(string(b), &pulumi.LogArgs{Resource: component})
})
clean-advantage-13612
09/03/2023, 11:34 PMalert-nightfall-64120
09/03/2023, 11:41 PMbillowy-army-68599
ctx.Export
italert-nightfall-64120
09/03/2023, 11:47 PMtest := pulumi.Map{
"hello": pulumi.String("world"),
}
test.ToMapOutput().ApplyT(func(m map[string]interface{}) error {
b, err := json.MarshalIndent(m, "", " ")
if err != nil {
return err
}
<http://ctx.Log.Info|ctx.Log.Info>(string(b), &pulumi.LogArgs{Resource: component})
return nil
})
Just had to return a value from ApplyT{
"hello": "world"
}
clean-advantage-13612
09/04/2023, 12:34 AMgenerally the easiest way is toThis ended up giving me exactly what I needed - definitely the easiest way to do it imoitctx.Export