amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Lambda trigger creation error

Open mnikolic10 opened this issue 3 years ago • 3 comments

Amplify CLI Version

8.3.0

Question

I'm attempting to create a new Lambda trigger for my DynamoDB model. I had one created previously that was working fine, which I disabled and enabled again manually in the DynamoDB interface. I have been unable to create a new function since and get the below errors:

Resource Name: LambdaEventSourceMappingRestaurant (AWS::Lambda::EventSourceMapping) Event Type: create Reason: Resource handler returned message: "Invalid request provided: Stream not found: arn:aws:dynamodb:ap-southeast-2:....:table/{STREAM_TABLE_NAME} (Service: Lambda, Status Code: 400, Request ID: e89088c7-ab4c-469d-9ee1-84447fb588d0)" (RequestToken: 09cfa484-5827-2108-842a-228a043f2fbc, HandlerErrorCode: InvalidRequest)

Not sure if I have made some mistake by manually deleting rather than using the CLI. Please let me know if you need more detail.

NOTE: I can see in my DynamoDB interface that streams is enabled:

mnikolic10 avatar Dec 19 '22 04:12 mnikolic10

Hey @mnikolic10 :wave: thanks for raising this! When working with Amplify it is typically not recommended to make changes to the Amplify-managed resources in the AWS Console. Can you try re-enabling this trigger using the Amplify CLI? You may need to remove the trigger and re-add the trigger with the CLI

josefaidt avatar Dec 19 '22 17:12 josefaidt

Hey @mnikolic10 👋 thanks for raising this! When working with Amplify it is typically not recommended to make changes to the Amplify-managed resources in the AWS Console. Can you try re-enabling this trigger using the Amplify CLI? You may need to remove the trigger and re-add the trigger with the CLI

I have done this and had no luck, seems like when i re-enabled manually the stream ARN was updated and no longer matches the one being referenced during creation. Not sure if there is a particular CloudFormation template I can update to reference the new one?

mnikolic10 avatar Dec 19 '22 20:12 mnikolic10

Note on above, I was able to resolve by upgrading to latest Amplify CLI. Lambda trigger was created successfully. Will close.

mnikolic10 avatar Dec 19 '22 22:12 mnikolic10