There are a couple of things you can do to dig deeper into what is going on.
The issue could be either when getting the credentials from the Lambda environment or when trying to call DynamoDb. The easiest way to determine this is to change your logging level to debug. If credentials are successfully being obtained from the Lambda environment, you should see this log line-
If this is happening then it is likely the issue is when trying to call DynamoDB. For this we will need to try and get a descriptive error message.
In general, debug logging should provide more information which might give this to us.
Alternatively, the error may be being send back as the result of the Lambda. Are you running the Lambda in the AWS console? If so, do you see a result?
Hi @tachyonics, thanks for the feedback. This issue is when using deploy.sh to manually deploy the lambda function. If I use sam-deploy.sh, everything works as expected.
Not sure which piece of the configuration I'm missing. Where should these environment variables be configured?
private struct EnvironmentVariables {
static let dynamoEndpointHostName = "DYNAMO_ENDPOINT_HOST_NAME"
static let dynamoTableName = "DYNAMO_TABLE_NAME"
static let region = "AWS_REGION"
}
This is something I overlooked for the deploy.sh script.
@tomerd For the deploy.sh it looks like an AWS CLI call to update function configuration[1] is needed to set environment variables. Do you have any preference to how the variables are specified as input?