0

Create AWS authorizer lambda in java to do token validation and create iam policy based on permission. Working as expected when we run using aws jar in aws env. When i converted to native image using graalvm getting error message as below with 500 internal status

{ "message": null }

Removed all validation logic and created hardcoded json policy using JSONObject still no luck, getting same issue. Below is the policy which is generated by lambda

{
    "policyDocument": {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Action": "execute-api:Invoke",
                "Resource": "arn:aws:execute-api:region:accountid:apiid/stage/GET/*",
                "Effect": "Allow"
            }
        ]
    },
    "context": {
        "sub": "Sample"
    },
    "principalId": null
}

Same policy works fine for normal jar and deployed using java runtime env.

With help of API gateway logs found out the authorizer response is sent as APIGatewayProxyResponseEvent where I am sending Iampolicy pojo, where API gateway is throwing exception saying Execution failed due to configuration error: Invalid JSON in response: Unrecognized field "isBase64Encoded" , not marked as ignorable.

Please some input/suggestion will be helpful.

shiva789
  • 11
  • 2

0 Answers0