https://pulumi.com logo
#general
Title
# general
r

red-airline-54646

03/09/2023, 3:23 PM
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

quaint-twilight-92541

03/09/2023, 7:07 PM
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

red-airline-54646

03/10/2023, 12:29 AM
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/