## Serverless Framework

# [IoT](/content/framework/docs/providers/aws/events/iot#iot/index.html)

## [Simple event definition](/content/framework/docs/providers/aws/events/iot#simple-event-definition/index.html)

This will enable your Lambda function to be called by an AWS IoT rule.

```yml
functions:
  myIoT:
    handler: myIoT.handler
    events:
      - iot:
          sql: "SELECT * FROM 'some_topic'"
```

## [Enabling / Disabling](/content/framework/docs/providers/aws/events/iot#enabling--disabling/index.html)

**Note:**`iot` events are enabled by default.

This will create and attach a disabled `iot` event for the `myIoT` function.

```yml
functions:
  myIoT:
    handler: myIoT.handler
    events:
      - iot:
          sql: "SELECT * FROM 'some_topic'"
          enabled: false
```

## [Specify Name and Description](/content/framework/docs/providers/aws/events/iot#specify-name-and-description/index.html)

Name and Description can be specified with the help of the `name` and `description` properties.

```yml
functions:
  myIoT:
    handler: myIoT.handler
    events:
      - iot:
          name: 'myIotEvent'
          sql: "SELECT * FROM 'some_topic'"
          description: 'My IoT Event Description'
```

## [Specify SQL Versions](/content/framework/docs/providers/aws/events/iot#specify-sql-versions/index.html)

[SQL Versions](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rule-sql-version.html) can be specified for an `iot` event. However the `sqlVersion` is not a required property.

```yml
functions:
  myIoT:
    handler: myIoT.handler
    events:
      - iot:
          sql: "SELECT * FROM 'some_topic'"
          sqlVersion: 'beta'
```
