:thinking_face: aws-native - trying to apply trans...
# aws
l
🤔 aws-native - trying to apply transform (auto-tagging) on aws-native resources Hi ! I'm currently playing with our Puluim stacks to apply tags on every AWS resources. The thing is, we both use AWS Native and AWS Classic side-by-side (as recommended by documentation). The auto-tagging works like a charm for AWS Classic resources, however I'm not able to apply tranforms to AWS Native resources. When I try to access the "tags" properties it keeps throwing this error:
Copy code
Traceback (most recent call last):
  File "/home/vscode/.pulumi/bin/pulumi-language-python-exec", line 191, in <module>
    loop.run_until_complete(coro)
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/pulumi/runtime/stack.py", line 142, in run_in_stack
    await run_pulumi_func(run)
  File "/home/vscode/.local/lib/python3.11/site-packages/pulumi/runtime/stack.py", line 56, in run_pulumi_func
    await wait_for_rpcs()
  File "/home/vscode/.local/lib/python3.11/site-packages/pulumi/runtime/stack.py", line 89, in wait_for_rpcs
    raise exn from cause
  File "/home/vscode/.local/lib/python3.11/site-packages/pulumi/runtime/stack.py", line 81, in wait_for_rpcs
    await rpc_manager.rpcs.pop()
Exception: Unexpected <class 'KeyError'>: 'tags'
I guess it means that aws-native resources doesn't have
args.props["tags"]
property, probably written in another way (Tags ?), but even with the debugger I'm not able to get the content of
args.props
when the resource is from AWS Native. Any help on this ? Is transformations/transforms supported by AWS Native ? Many thanks beforehand ! 🙏
c
They do have tags, but if you didn't set any tag in your code, then there is no such item in the dictionary. Then you need to check whether resource is taggable or not (I used this example: https://github.com/joeduffy/aws-tags-example) . Then there is an exception - ASG (if you use it) - it requires
propagateAtLaunch
property in tags, in addition to key and value).