tlinhart / pulumi-aws-tags

Pulumi package that helps manage tags for AWS resources
MIT License
8 stars 2 forks source link

Add support for AWS Native #25

Open tlinhart opened 2 weeks ago

tlinhart commented 2 weeks ago

Add support for tagging resources from AWS Native package.

druskus20 commented 4 days ago

This would just be updating the list of allowed resources, how did you generate/make the list?
EDIT: I would also benefit from this - I am writing my own resource transform

tlinhart commented 4 days ago

@druskus20 the Python package uses some inner details of the Pulumi provider packages to get a list of all resources and the corresponding classes, and introspection to determine if the resource is taggable (supports the tag constructor parameter). The Node.js package then uses the list generated by the Python package (updated via GHA workflow).

Support of AWS Native is twofold:

I’ll delve into it deeper soon.

druskus20 commented 4 days ago

I've implemented something like this in Typescript. It is a draft and note that neither my knowledge of typescript, or pulumi is great, so excuse the code quality. I distinguish between what I call "Object Tags" and "ArrayTags":

//  A: ArrayTags
//
//    [{
//      key: "key",
//      value: "value",
//    }]
//
//  B: ObjectTags
//
//    { key: "value" }
//

I link it here in case it is of any help: https://gist.github.com/druskus20/e3a6cfee05e4c6654b0f70b2cd6989bf

tlinhart commented 4 days ago

@druskus20 cool, thanks for the link, I'll have a look. I already experimented a bit with the Pulumi AWS Native package but in the end wasn't sure if it really makes sense to integrate it in this library. But I'll definitely take another stab into it.

tlinhart commented 2 days ago

I digged deeper again and remember where the main problem was – the tests. The library uses transforms for tagging the resources which do not support unit tests using Pulumi mocks. I thus switched to integration tests using LocalStack (which IMHO is better for tests anyway). However, LocalStack doesn't seem to support Cloud Control API which Pulumi AWS Native uses. I'm very reluctant to release anything without a proper test coverage so we'll have to wait I guess.

druskus20 commented 2 days ago

@tlinhart Sounds sensible. Good to know too.