Alexa IoT Topic Definition in a Lambda Function

0

I not not sure how to define the IoT topic definition in the Lambda function for an Alexa controlled IoT device across multiple AWS accounts.

Let's say my company is called CoolCompany and I want to develop an Alexa controlled simple light switch to sell.

  1. It has a microcontroller, and I need to install the TLS certificates and the IoT topic definition for MQTT subscription prior to shipping.
  2. I create a Thing device in AWS IoT for customer #1 called cust1_thing,
  3. I create another Thing device is AWS IoT for customer #2 called cust2_thing.
  4. I define the topic for device #1 microcontroller as cust1_thing/topic.
  5. I define the topic for device #2 microcontroller as cust2_thing/topic.
  6. Each customer installs the switch and loads the CoolCompany Alexa skill.
  7. That skill is linked to my account and triggers a common Lambda function.
  8. At this point, customer #1device is connected to AWS and connected to my backend MQTT broker and subscribed to cust1_thing/topic. Customer #2 device is connected to AWS and connected to my backend MQTT broker and subscribed to cust2_thing/topic

How do I define the IoT topic definition in a common Lambda function such that it it writes to cust1_thing/topic for customer #1 and cust2_thing/topic for customer #2?

RS
asked 4 months ago288 views
1 Answer
0

Hello, are you using IoT core? You can define the topic to differentiate from different source/device: https://docs.aws.amazon.com/iot/latest/developerguide/topics.html#:~:text=AWS%20IoT%20uses%20topics%20to,described%20in%20the%20following%20sections.

Zen
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions