How can I compose a tag key from an output?. I tri...
# golang
f
How can I compose a tag key from an output?. I tried:
Copy code
Tags: pulumi.StringMap{
					string(exampleResource.ApplyT(func(tagKey string) string {
						return "chained-name-" + tagKey
					}).(pulumi.StringOutput))[:]:                    pulumi.String("test"),
}
all the iterations I have done with ApplyT to convert an output to a tag key are giving errors. When I do the same for the key value, as it expect a strInput it works but not for tag keys (expecting plain string): Does not work on tag key
Copy code
Tags: pulumi.StringMap{
					exampleResource.ApplyT(func(tagKey string) string {
						return "chained-name-" + tagKey
					}).(pulumi.StringOutput):                    pulumi.String("test"),
}
Ok for tag value:
Copy code
Tags: pulumi.StringMap{
					"Example": exampleResource.ApplyT(func(tagKey string) string {
						return "chained-name-" + tagKey
					}).(pulumi.StringOutput),
}
Running out of ideas.
b
you need to do the
ApplyT
on the outside of your build, so for example (untested`
Copy code
Tags: exampleResource.ApplyT( // do the rest here
you can’t do an
ApplyT
inside a
StringMap
f
Interesting. I'm curious then why it can be done on the tag values inside the StringMap ?.