Action: auto-tag-user requires Lambda? #8752
-
So I'm trying to execute this kind of policy that "finds" users that have spun up an EC2 instance in AWS and didn't bother attaching an
But I get the exception:
I don't want to have this type of action be performed by a Lambda function, I want the CLI to perform the tagging action. Creating a Lambda function to perform the simple tagging action feels very heavy handed. I tried this sort of Policy:
But I get this error:
Which makes sense b/c you need a cloudtrail event to source the CreatorId value.
[1] I'm not putting down this functionality, but managing Lambda functions done at my place of work is through other frameworks (Terraform), and I'd rather not deviate from that pattern. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Something to elect is here: https://cloudcustodian.io/docs/aws/examples/tagcompliance.html the block:
Doesn't specify a role - trying something similar like:
I get the same |
Beta Was this translation helpful? Give feedback.
-
Thanks for opening the discussion, you're right about the example policy in the docs - we should specify a role there 👍 . As for the larger discussion around tagging resources with creator info, there are two high-level options:
The most common path is to set up As for "why not just search cloudtrail from a pull mode policy?" there are a couple reasons for that:
|
Beta Was this translation helpful? Give feedback.
Thanks for opening the discussion, you're right about the example policy in the docs - we should specify a role there 👍 .
As for the larger discussion around tagging resources with creator info, there are two high-level options:
auto-tag-user
action. As you've noticed here, those policies need to run in Lambda mode. They run in response to creation events, and suck information out of those creation events to tag resources. In pull mode we don't have that event context, so we don't know who the creator is.The most common path is to set up
auto-tag-user
policies …