title: Can an aws lambda function handle multiple aws iot objects?
body: <p>I have a lambda function where the endpoint of the object, its region and its name are indicated:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var config = {};
  config.IOT_BROKER_ENDPOINT = "axxxxxxxxxxxxxxx.iot.us-east-1.amazonaws.com".toLowerCase();
  config.IOT_BROKER_REGION = "us-east-1";
  config.IOT_THING_NAME = "nameObject";</code></pre>
  </div>
  </div>
  </p>
  <p>This lambda function is linked to an alexa skill.</p>
  <p>From Alexa skill, I can send voice instructions and through the lambda function the shadow state of the object is changed.</p>
  <p>Now, if I want to create several objects, obviously each one will have its own endpoint and its own name.</p>
  <p>If I want to use the same skill and the same lambda function, the skill must send an ID to identify the object (the ID can be its name) and in the lambda function with that ID, it could select which endpoint and name to use.</p>
  <p>Using Alexa it could be very easy to say, for example &quot;Alexa, activate the output of object 234&quot; and in that way the lambda function would understand which object it refers to.</p>
  <p>But if I want each user of the skill not to have to say the ID, just a generic name, for example &quot;Alexa, activate the output&quot;, behind the scenes, the skill sends the unique ID for a particular object.</p>
  <p>This implies that when the user downloaded the skill, somewhere he entered the object ID for a single time and from then on he forgets that number and the skill is configured to send that ID behind the scenes.</p>
  <p>Is there a way to do that?</p>
  <p>Any comment is welcomed.</p>