Hello, can somebody help me translate this into a ...
# general
r
Hello, can somebody help me translate this into a pulumi code? ingressRouteSpec := map[string]interface{}{ "spec": map[string]interface{}{ - is this pulumi.StringMapArray? "routes": []interface{}{ - what is this in pulumi? map[string]interface{}{ "kind": "Rule",
q
I'm still beginning with pulumi/go but I'll give it a shot. It looks like you're building something that will eventually be serialized as yaml or json, to be fed to a resource constructor, e.g. metadata on an ec2/gce instance. In which case, you should marshal it to a
string
, then wrap in
pulumi.String()
to use. But to answer your questions: 1.
map[string]interface{}
(a map with string keys and arbitrary values) would translate to
pulumi.StringMap
2.
[]interface{}
(a slice of arbitrary values) would not translate, AFAIK.
[]string
would be a
pulumi.StringArray
.
r
I'm building a custom resource for kubernetes. I'm trying to build the
OtherFields
input. https://www.pulumi.com/registry/packages/kubernetes/api-docs/apiextensions/customresource/