I manage an actually not very big website, but Lambda is used extensively, invoked many times per site visit, resulting in hundreds of thousands of calls per month.
I noticed a spike in CloudTrail costs. Digging further I found that the biggest offender is calls to CreateLogStream
made by the Lambda infrastructure, i.e. it is AWS's code doing this, not mine. My CloudTrail costs due to CreateLogStream are 100x the Lambda costs (Lambda's Free Tier distorts this ratio somewhat).
Short of completely deactivating CloudTrail
, is there any way to stop incurring these charges?
It looks like you can use Advanced Event Selectors on the trail config to exclude/include specific sources, lambdas, etc. for data events.
Update: I've tested this myself. I can create a trail to monitor all Lambda (data) events, with a filter for a specific one. I can then invert the filter to exclude that one. But I'm not sure if it's going to exclude the actual
createLogStream
calls, as that might be on a different object.