I have an AWS Lambda function in Java that uses APIGatewayProxyRequestEvent (LAMBDA_PROXY) to get input from API gateway. For API calls through the API Gateway, I can get and print the input body without a problem.
Now I want an EventBridge scheduled event that triggers the Lambda function every 5 minutes. However, I can NOT get the event payload as it shows null when I print it in the codes below.
Lambda function:
@Override
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent input,
Context context) {
logger.info("RawBody: {}", input.getBody());
// RawBody: null
EventBridge event payload:
{"key": "value"}
Any idea how I can get the event payload from EventBridge in my Lambda function?