How to make AWS Lambda wait for a shadow updated topic

355 Views Asked by At

My desired flow is:

  1. ask my iot device to do something using AVS sdk
  2. aws lambda triggered and update the device shadow
  3. iot device triggered based on the shadow topic: delta and do something locally. Publish the status to shadow when done doing something

  4. aws lambda sends voice feedback to my iot device to tell users the reported status

I am stuck in point 4 since I dont know how to trigger AVS(ASK)'s speech response only after the topic is updated "within the same lambda triggered by AVS (as mentioned in point 1 and 2).

1

There are 1 best solutions below

0
AudioBubble On

You don't want lambda to wait. I heard from a wise man onetime, A long lived Lambda = EC2 Instance

Either create an iot rule to trigger a lambda on specific topics, or, create an api endpoint to update the topic and trigger it from the client.