I deployed a lambda (java 8) a few weeks ago.
Last week I deployed a new version of that lambda with very minor code changes and the same yml configuration and my POST methods started to die with:
java.lang.NullPointerException at com.amazonaws.serverless.proxy.internal.servlet.AwsProxyHttpServletRequest.getRemoteAddr(AwsProxyHttpServletRequest.java
It took me while to try and add a random query param /mymethod?xyz=123
which made my requests work as they used to.
Is anybody aware of any change on AWS side? I have serverless v1.27.3 but this hasn’t changed between deployments.
yml:
`service: mylambda
provider:
timeout: 30
memorySize: 2048
name: aws
runtime: java8
environment:
DYNAMODB_TABLE: {self:service}-{opt:stage, self:provider.stage}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: “arn:aws:dynamodb:{opt:region, self:provider.region}:*:table/{self:provider.environment.DYNAMODB_TABLE}”
region: eu-west-1
package:
artifact: target/mylambda-1.0.0-SNAPSHOT.jar
functions:
post-transaction:
handler: com.mylambda.lambda.LambdaHandler
events:
- http:
path: /{proxy+}
method: post`
The springboot controller hasn’t changed between deployments and doesn’t ask for a query param.