Skip to content

AWS IoT Analytics の各リソースを CloudFormation で構築するサンプル

Notifications You must be signed in to change notification settings

iam326/aws-iot-analytics-sample-cfn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-iot-analytics-sample-cfn

AWS IoT Analytics の各リソースを CloudFormation で構築するサンプルです

Environment

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.6
BuildVersion:   19G2021

$ aws --version
aws-cli/2.0.28 Python/3.7.4 Darwin/19.6.0 botocore/2.0.0dev32

$ python3 --version
Python 3.8.5

$ pip3 --version
pip 20.1.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

Usage

Deploy

// 環境変数の設定 - AWS IoT Core で作った 1-Click 証明書を使用します
$ export AWS_IOT_CERTIFICATE_NAME="<証明書の名前>"

$ ./deploy.sh

Publish messages

$ export AWS_IOT_ENDPOINT="<カスタムエンドポイント>"
$ export AWS_IOT_CLIENT_ID="<モノの名前>"

// メッセージ送信
$ pip3 install -r requirements.txt
$ python3 publish_message.py

Connecting to hogehoge.iot.ap-northeast-1.amazonaws.com with client ID aws_iot_analytics_sample_iot_thing...
Connected!
Published: {"device": {"id": "device-1", "name": "hoge"}, "datetime": "2020-10-24 01:19:54", "temperature": 21} to the topic: iot/topic
Published: {"device": {"id": "device-1", "name": "hoge"}, "datetime": "2020-10-24 01:20:04", "temperature": 39} to the topic: iot/topic

...

Disconnected!

About

AWS IoT Analytics の各リソースを CloudFormation で構築するサンプル

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published