3. Why AWS IoT?
● It’s Easy to Start With AWS IoT
● High IoT Security Standards
● AWS Cherishes Its Startup Community and
Cultivates Startup Culture
● Serverless Architecture is the Right Choice for
Startups
● Powerful AWS IoT Analytics Paired With AI and
Machine Learning
● AWS Has a Strong Partner Network of IoT
Device Manufacturers
● Integration Across a Sheer Number of AWS
Products and Services
4. What Is AWS IoT?
https://docs.aws.amazon.com/iot/latest/developerguid
e/what-is-aws-iot.html
AWS IoT provides secure, bi-directional communication
between Internet-connected devices such as sensors,
actuators, embedded microcontrollers, or smart
appliances and the AWS Cloud. This enables you to
collect telemetry data from multiple devices, and store
and analyze the data. You can also create applications
that enable your users to control these devices from
their phones or tablets.
10. Create and Activate a Device Certificate
When working with a device you will need to copy the private
key and rootCA certificate onto your device
11. X.509 certificates are used to authenticate your
device with AWS IoT. AWS IoT policies are
used to authorize your device to perform AWS
IoT operations, such as subscribing or
publishing to MQTT topics. Your device
presents its certificate when sending messages
to AWS IoT. To allow your device to perform
AWS IoT operations, you must create an AWS
IoT policy and attach it to your device
certificate.
Create an AWS IoT Policy
12. Create an AWS IoT Policy
"Statement": [
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "*"
},
{
"Effect": "",
"Action": "iot:Subscribe",
"Resource": "arn:aws:iot:eu-west-1:338573839418:topicfilter/MyTopic"
}
You can restrict which clients (devices) are able to connect by specifying a client ARN as the
resource. The client ARNs follow this format:
arn:aws:iot:your-region:your-aws-account:client/<my-client-id>
Select the Add Statement button to add another policy statement. In the Action field, type
iot:Publish. In the Resource ARN field, type the ARN of the topic to which your device will publish.
arn:aws:iot:your-region:your-aws-account:topic/<your/topic>
14. Pros and cons AWS DynamoDB
Pros:
● Fast, single millisecond latency
● Schemaless DB, ideal for IoT, Mobile, Gaming
● Integrated with most AWS Services such as IAM, CloudWatch,
CloudTrail so monitoring and auditing is easy
● Autoscales, elastic in nature
● Virtually infinite storage
Cons
● Very (very) limited querying.
● Scanning is painful
● pre-defined throughput, which means sudden increase beyond
the set throughput will be throttled.
● throughput is partitioned as table is sharded internally. (which
means if you had a throughput for 1000 and its partitioned in two
and if you are reading only the latest data(from one part) then
your throughput of reading is 500 only)
● No joins, Limited indexing allowed (basically 2).
● No views, triggers, scripts or stored procedure.
16. Creating an Amazon DynamoDB Rule
SELECT * FROM 'my/office
("SELECT *" specifies that you want to send the entire MQTT message that triggered the
rule. "FROM 'my/office'" tells the rules engine to trigger this rule when an MQTT
message is received whose topic matches this topic filter. Choose Add action.
21. Creating an Amazon DynamoDB Rule
Topics
You can use the AWS IoT MQTT client to better understand the
MQTT messages sent by a device. The AWS IoT message
broker uses topics to route messages from publishing clients to
subscribing clients. The forward slash (/) is used to separate
topics into a hierarchy.
Devices publish MQTT messages on topics. You can use the
AWS IoT MQTT client to subscribe to these topics to see the
content of these messages. You can subscribe to multiple topics
using a topic filter and wildcard characters.
22. Creating an Amazon SNS Rule
In the Rule query statement editor, enter the following
SELECT *, topic(3) as thing FROM '$aws/things/+/shadow/update/accepted'
24. Test an Amazon SNS Rule
To test the rule, add a subscription to the SNS topic you created, and
update the shadow of any AWS IoT thing.
You can use the AWS IoT console to find a thing, open its detail page,
and change the device's shadow. When the Device Shadow service is
notified of the change, it publishes a message on
$aws/things/MySNSThing/shadow/update/accepted. Your rule
is triggered and all subscribers to your SNS topic receive a message
that contains your thing's name.
29. Greengrass
What Is AWS IoT Greengrass?
AWS IoT Greengrass is software that extends cloud capabilities to local devices.
This enables devices to collect and analyze data closer to the source of
information, react autonomously to local events, and communicate securely with
each other on local networks. AWS IoT Greengrass developers can use AWS
Lambda functions and prebuilt connectors to create serverless applications that
are deployed to devices for local execution.