This message was deleted.
# golang
s
This message was deleted.
t
b
@tall-librarian-49374 Yes, that is actually on what my code snipped above is based on. Unfortunately, that does not work for
aws-native
.
t
that does not work for
aws-native
.
Could you highlight the difference between two providers that makes it impossible for me?
b
Just check out all the occurrences of
???
in my example code snipped above.
Copy code
var tagList ???
				if !tags.IsZero() {
					tagList = tags.Interface().(???)
				} else {
					tagList = ???{}
				}
				for k, v := range t.tags {
					tagList = append(tagList, ???{ Key: pulumi.String(k), Value: pulumi.String(v)})
				}
There is no common (Go struct) type for Tags in the (generated)
aws-native
Go SDK. For each AWS Service (e.g.
ec2
, …), service specific (struct) types are created for Tags. For example: • for https://www.pulumi.com/registry/packages/aws-native/api-docs/kms/key/ there is
KeyTagArray
and
KeyTagArgs
• for https://www.pulumi.com/registry/packages/aws-native/api-docs/ecr/repository/there is
PublicRepositoryTagArray
and
PublicRepositoryTagArgs
Having no common type (struct or interface) for tagging resources for all AWS services and resource types, it is impossible to write generic code to tag them.
t
I see now - thank you. Sorry for being slow in parsing the question.