2

I am trying to attach a kinesis stream event to lambda function usi cli command but getting exception as :

An error occurred (ValidationException) when calling the CreateEventSourceMapping operation: 1 validation error detected: Value null at 'startingPosition' failed to satisfy constraint: Member must not be null.

My command is :

aws lambda  create-event-source-mapping --event-source-arn arn:aws:kinesis:us-west-2:xxxxxx:stream/lambda-stream --function-name helloworld-divyanayan_lambda --batch-size 100 
2
  • document for reference docs.aws.amazon.com/cli/latest/reference/lambda/… Commented Jan 23, 2019 at 8:00
  • aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:us-west-2:xxxxxx:stream/lambda-stream --function-name helloworld-divyanayan_lambda --batch-size 100 --starting-position Latest. i think it is required field as by default no starting position is set Commented Jan 23, 2019 at 8:10

2 Answers 2

2

If Lambda is your consumer for Kinesis streams where you are continuously processing stream data, you use "LATEST" as the starting position.

TRIM_HORIZON will read the oldest untrimmed record in the shard.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for replying ..but my question was not on diffrence between TRIM_HORIZON and LATEST,rather i was trying to map a kinesis event to lambda function using command line .so after giving --starting-position in command line ,cli command executed successfully.
1

I got this error for a DynamoDB stream mapping to a Lambda in CloudFormation. As other answer/comment suggests, the problem is the starting position on the Kinesis stream.

The CLI docs do indeed have a flag for --starting-position, and the CloudFormation template does as well.

So, in my case, it was fixed by adding this line to my CFN template:

Type: AWS::Lambda::EventSourceMapping
    Properties: 
      ...
      StartingPosition: 'LATEST'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.