How to fix AWS get method errors?

I provided an API for a simple get method and the test with AWS APIGateWay was successful.
However, when requesting with Postman, I get an “Internal server error” error.

index.py

import json

def handler(event, context):
    print('lambda start!!!')

    return {
        'statusCode': 200,
        'body': json.dumps('Hello, world!')
    }

other informations

・Execution role has “AWSLambdaBasicExecutionRole”
 (Checked from resource “aws_iam_role” “main”)

・Method request Authorization: NONE

・nothing appears in the Lambda log, the API Gate way log looks like this

  1. (d3d3140c-c3bc-4da5-891c-b686d39bf441) HTTP Method: GET, Resource Path: /test
  2. (d3d3140c-c3bc-4da5-891c-b686d39bf441) Execution failed due to configuration error: Invalid permissions on Lambda function

These are gate way test result.

Latency : 47
Status : 200
Response body : "Hello, world!"
Response headers
{
  "X-Amzn-Trace-Id": "Root=1-65cffacb-bc8319c29a991e0162f40399;Sampled=1;lineage=34df7d2c:0"
}

Leave a Comment