AWS IoT Core Configuration
To receive data from the automatic sensor source, we need to configure AWS IoT Core.
Access the AWS IoT Core management console.
- Create Thing
- Select Thing
- Click on Create thing

- In the Number of thing to create section
- Select Create single thing
- Click Next

- When the Specify thing properties section appears
- In the Thing name field, enter InventorySensor
- Click Next

- In the Device certificate section, select Auto-generate a new certificate
- Click Next

- Click create thing
- Download the files in the Download certificates and key table to your device

- Create policies
-
In the Security section, select Policies
-
Choose Create policy

-
In Policy name, enter IoTInventoryPolicy
-
In Policy action:
-
Select iot:Connect
-
Select iot:Publish
-
Select iot:Subscribe
-
Select iot:Receive
-
In Policy resource, enter arn:aws:sns:us-east-1:922456364996:InventoryAlerts

-
Select Certificates
-
Click on the Certificates of the project
-
Choose Action and select Attach policy

- In Policies, select IoTInventoryPolicy
- Choose Attach policies

- Continue by selecting Attach to things

- In Things, select InventorySensor1
- Choose Attach to thing

- Create a rule
- Select Message routing
- Select Rule
- Select Create rule

- In Rule name, enter InventoryRule
- Select Next

- In SQL statement, enter SELECT * FROM ‘inventory/sensor1/data’
- Select Next

- In Action1, select Lambda
- In Lambda function, select ProcessInventoryData
- In Lambda function version, select $LATEST
- Select Next

