16

I used this CloudFormation template to create a stack: https://fwd.aws/mDMrd

One of the steps failed, and the status reason given is:

Failed to create resource. See the details in CloudWatch Log Stream: 2019/07/01/[$LATEST]fa6e...

My problem is that I can't locate this log stream. I can't find what log group this is going under.

A.R.
  • 1,888
  • 2
  • 14
  • 22
  • 12
    It's a problem that the Log Group is not mentioned and that the console does not allow searching by Log Stream from outside the group. It makes the status reason message nearly useless. – psaxton Apr 10 '20 at 17:53

3 Answers3

6

It turns out CloudFormation created a Log Group named /aws/lambda/Git-to-Amazon-S3-CopyZipsFunction-1K1JCQVK2QDF2 where I can see the log stream, the reason I could not find it was because it took over 5 minutes for the Log Group to show up on the list.

A.R.
  • 1,888
  • 2
  • 14
  • 22
3

For other people having a similar problem with not being able to find the appropriate log in CloudWatch, there's an alternate place to look for the error.

CloudTrail logs the AWS API calls, and you may be able to find the failing API call there, with a better error message. I don't know if anything has to be done to enable this, or if it's always on or on by default.

This will be easiest if there haven't been many other AWS API calls made since the failure.

Go to CloudTrail and then Event History.

In my case, I scanned down past all of the API calls that were from CloudFormation tearing the resources back down, and the very next call was the one I needed to see.

Russell Reed
  • 424
  • 2
  • 8
  • 1
    Should be the accepted answer. I'm shocked at how unhelpful it is to have a message that says to look at a log stream without also specifying the log group. This is an excellent workaround though – James Wilson Nov 30 '22 at 21:42
-3

It seems like you are creating cloudwatch log resources and that's what's failing. Can you progamattically display the output error so that you have the full path of the cloudwatch log stream.

Btw you can try cloudkast which is an online aws cloudformation template generator. It's gonna make easier dealing with cloudformation templates.

krunal shimpi
  • 58
  • 1
  • 2