I have enable DynamoDB Streaming of my table and two lambda's are associated with it. Both trigger's whenever there is a change in DynamoDB table through dynamo triggers.
Issue: Both Lambda's insert data accordingly into two RDS tables. Like Lambda-one insert into table-one and Lambda-two insert into table-two. Table-one primary key is the foreign key in Table-two.
So whenever both lambda's triggered the lambda-two complete the execution firstly due to which it show's the foreign key constraint error because the lambda-two try to insert the data into table-two but at that time table-one doesn't have the primary key yet.
So my question is that there is any way to order the triggering of lambda through DynamoDB?