-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Getting error when trying to attach dynamodb to lambda as an event source:
2023-01-19T15:20:52.121 ERROR --- [functhread28] l.s.a.e.stream_event_sourc : 'StartingPosition'
Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/awslambda/event_source_listeners/stream_event_source_listener.py", line 345, in _monitor_stream_event_sources
source["StartingPosition"],
KeyError: 'StartingPosition'
This worked fine on localstack:0.14.5
Expected Behavior
No response
How are you starting LocalStack?
With a docker run command
Steps To Reproduce
- Run localstack:
docker run --rm -d -v /Users/ayeganyan/workspace/sandbox/lambda-nodejs/artifacts:/artifacts -p 4566 -e PROVIDER_OVERRIDE_LAMBDA=asf -v "/var/run/docker.sock:/var/run/docker.sock:rw" localstack/localstack
-
ssh to running localstack
-
Executes the following commands, which basically creates lambda (provide anything as code and runtime), and dynamodb
awslocal dynamodb create-table --table-name dx-ref-java-quarkus-im-lambda-ddb --attribute-definitions AttributeName=key,AttributeType=S --key-schema AttributeName=key,KeyType=HASH --billing-mode PAY_PER_REQUEST --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
export DYNAMO_DX_REF_JAVA_QUARKUS_IM_LAMBDA_DDB_STREAM_ARN=$(awslocal dynamodb describe-table --table-name dx-ref-java-quarkus-im-lambda-ddb --query 'Table.LatestStreamArn' --output text)
awslocal lambda create-function --function-name ddblambda --role arn:aws:iam::000000000000:role/DummyRole --runtime python3.8 --handler python.main.handle --zip-file fileb:///artifacts/python.zip --memory-size 1024 --timeout 20 --environment '{"Variables": {"OUT_QUEUE_NAME": "dx-ref-java-quarkus-im-lambda-ddb-out"}}'
- Add event source:
awslocal lambda create-event-source-mapping --function-name "ddblambda" --event-source-arn "$DYNAMO_DX_REF_JAVA_QUARKUS_IM_LAMBDA_DDB_STREAM_ARN"
Then you will see the following error (continuously):
2023-01-19T15:20:52.121 ERROR --- [functhread28] l.s.a.e.stream_event_sourc : 'StartingPosition'
Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/awslambda/event_source_listeners/stream_event_source_listener.py", line 345, in _monitor_stream_event_sources
source["StartingPosition"],
KeyError: 'StartingPosition'
Environment
- OS: MacOS Ventura 13.1
- LocalStack: latestAnything else?
No response