I guess this question came up before, but how can ...
# aws
l
I guess this question came up before, but how can I control the retention of lambda logs. Since Pulumi assigns the unique suffix to resource names (which I want to keep), I cannot predict what the log group name for the lambda is going to be so I cannot create it before hand and declare it as a manual dependency. Is there a way to accomplish this atm
l
AWS automatically creates log groups for Lambdas unless you create it yourself. To control the settings, create the log group yourself after the Lambda is deployed. Naming is something like
/aws/lambda/{lambdaName}
.
l
Wouldn't you be in a race condition with AWS or you would have to poll until AWS have created it? I am more in favor of creating it myself but then I would have to override pulumi's auto naming feature
l
You don’t have to override their autonaming, just have to create the log group right after the Lambda and use the name from the newly created resource.
We have a helper function that does it all for us
l
I see what you are saying. I was basically afraid of a situation where I am competing with the lambda itself creating that log group but I guess I can only prevent that from happening by denying it permissions
l
Yeah the log group isn’t created by AWS until the function is actually invoked