Adding tags to the underling lambda of a SingletonFunction #1079
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
There's no direct or simple way of constructing a
SingletonFunction
and providing tags to the underlying lambda. In some organisations it's a requirement to tag any resources that handle or store sensitive data, such as PII.The normal workaround would be to use
findChild("Resource")
to get the CFN-level resource object, and override the tags property. However as the underlying lambda of a singleton function is a sibling, not a descendant, that does not work.Instead you have to access the children of the current stack and findChild() using the ID given to the lambda, based upon the
lambdaPurpose
anduuid
props:(There's some formatting applied to both of those props to strip out invalid characters)
The text was updated successfully, but these errors were encountered: