title: How can I subscribe to a MQTT topic in a Amazon AWS Lambda function?
body: <p>I am using python, I am able to publish a message to AWS IoT using the code below:</p>
  
  <pre><code>import boto3
  import json
  
  client = boto3.client('iot-data', region_name='us-east-1')
  
  # Change topic, qos and payload
  response = client.publish(
          topic='$aws/things/pi/shadow/update',
          qos=1,
          payload=json.dumps({"foo":"bar"})
      )
  </code></pre>
  
  <p>but there is no method like </p>
  
  <blockquote>
    <p>client.subscribe();</p>
  </blockquote>