Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)
I am working with API Gateway that has lambda function and when I'm calling API Gateway using AWS generated SDK from the API gateway, Here on my API Gateway Dashboard I get this error, "AWS/apiGateway 5XXError". How can I debug it?

1 Answer

0 votes
by (12.4k points)
edited by

First, create an IAM role with the following policy attached to allow API Gateway to push the logs.

{

    "Version": "2012-10-17",

    "Statement": [

        {

            "Effect": "Allow",

            "Action": [

                "logs:CreateLogGroup",

                "logs:CreateLogStream",

                "logs:DescribeLogGroups",

                "logs:DescribeLogStreams",

                "logs:PutLogEvents",

                "logs:GetLogEvents",

                "logs:FilterLogEvents"

            ],

            "Resource": "*"

        }

    ]

}

Now On the API gateway console Enter the ARN of the API Gateway-CloudWatch logging role and save it. Once done go to CloudWatch setting and enable Cloudwatch Logs, Set Log Level to INFO and Select Log full request/response data.

Once done redeploy your API to the stage and then make a request and check for the logs.

And then give the caller's IAM role access. 

Credentials: 'arn:aws:iam::*:user/*'

Want to Become an AWS Expert? Come & Join: AWS Course

Related questions

0 votes
1 answer
asked Apr 5, 2020 in AWS by Amenda (1.4k points)
Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...