Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.01 KB

File metadata and controls

32 lines (25 loc) · 1.01 KB
psql --host=DB_instance_endpoint --port=port --username=master_user_name --password --dbname=postgres

postgres=> CREATE DATABASE iotdemo;
postgres=> \connect iotdemo;
postgres=> DROP TABLE IF EXISTS device_status;

postgres=> CREATE TABLE device_status (
    deviceid VARCHAR(255) PRIMARY KEY,
    critical integer,
    alertmessage VARCHAR(128),
    alertcount integer,
    eventtime TIMESTAMP
);

postgres=> INSERT INTO device_status (deviceid, critical, alertmessage, alertcount, eventtime) VALUES ('1626712066.457285_6', 3, 'Temperature exceeded INTC', 8, '2021-07-20 00:13:16');

postgres=> select * from device_status limit 5;
postgres=> \q
pip install AWSIoTPythonSDK
# Modify the IoT mqttc.configureEndpoint and mqttc.configureCredentials
python iot_generator.py
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple psycopg2

How do I configure a Lambda function to connect to an RDS instance?