When I try to deploy my application, I get the following error: An error occurred: SubmitDashmoduleLogGroup - /aws/lambda/DEV-get-course already exists in stack
The delete command gives me: An error occurred (ResourceNotFoundException) when calling the DeleteLogGroup operation: The specified log group does not exist.
I double check the AWS console and no CloudWatch logs exist
Rerun serverless deploy
I still get the above error. What’s happening?
As a side note, every other resource defined in my serverless.yml is created successfully in the stack, except for the log groups (I also get this error a couple times).
I figured out the problem. As often as it occurs, it was a simple, annoying, frustrating, typo. Hopefully, this will at least help someone else uncover the source of the problem.
In my serverless.yml, I had three functions defined. While trying to solve a different problem, I renamed my functions like so: {stage}-{functionName}. However, after renaming the first one, I just copied and pasted to the second and third, then updated the function name, but I never updated the second function name. So, the first function’s logs conflicted with the second.
Basically, I had this: {stage}-{functionA} {stage}-{functionA} {stage}-{functionC}
But should have had this, {stage}-{functionA} {stage}-{functionB} {stage}-{functionC}
Once I made this change, my stack was created successfully without error.