i’m trying to do `aws.cloudwatch.LogGroup.get(name...
# general
d
i’m trying to do
aws.cloudwatch.LogGroup.get(name, logGroupName)
where
logGroupName
is a computed value like
/aws/lambda/${lambda.name}
- this works, but if there were no log messages written by the lambda yet (ie on an initial deploy) subsequent resource creations that reference the log group fail with
The specified log group does not exist
- any recommendations on how to solve this chicken and egg problem?
in particularly, i’m trying to create a
aws.cloudwatch.LogSubscriptionFilter
w
Yeah - this is a somewhat unfortunate thing with Lambda - it lazily creates the LogGroup using a well known name when there are first logs. I believe I’ve had success in the past creating the loggroup with the same name explicitly prior to the lambda - which will then reuse that loggroup. You can the refer to it from other resources.