Hi all, I was running into a problem with type mis...
# golang
s
Hi all, I was running into a problem with type mismatches that was fixed by a recent commit (see https://pulumi-community.slack.com/archives/CCWP5TJ5U/p1593124071219300 and the resulting thread). However, it now appears that the use of
Pulumi.Map
to create maps for assigning AWS tags is broken. Sample code is threaded below.
I was using the following code pattern to assign AWS tags to various objects:
Copy code
Tags: pulumi.Map{
 	"Name": pulumi.String(fmt.Sprintf("%s-priv-rt", baseName)),
 	k8sTag: pulumi.String("shared"),
},
This worked with version 2.4.0 of the Pulumi SDK, but using the latest commit causes this error to appear when running `pulumi up`:
Copy code
./main.go:139:4: cannot use pulumi.Map literal (type pulumi.Map) as type pulumi.StringMapInput in field value:
    	pulumi.Map does not implement pulumi.StringMapInput (missing ToStringMapOutput method)
Is this a bug with the SDK, or am I doing something wrong? (I'd be inclined to think it was the latter if it hadn't worked earlier.)
l
There was a change that restricted maps to only having string values: https://github.com/pulumi/pulumi-aws/blob/master/CHANGELOG.md#2100-2020-06-23 you'll need to use
pulumi.StringMap
Sorry for the inconvenience.
s
OK, that seems to fix it. VS Code still thinks it's an error (I guess it's the Go language server reporting an issue), but
pulumi up
works.
l
Great, glad to hear it's working!
s
BTW: making sure
$GOPATH/bin
was included in
$PATH
fixed the "errors" in VS Code