Skip to content

Instantly share code, notes, and snippets.

@sebastianrothbucher
Last active May 10, 2024 13:27
Show Gist options
  • Save sebastianrothbucher/002a724e8340dbb3da39af42a83b508d to your computer and use it in GitHub Desktop.
Save sebastianrothbucher/002a724e8340dbb3da39af42a83b508d to your computer and use it in GitHub Desktop.
IoTcore simple policy and node-red flow
[
{
"id": "426169ba36026cef",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "667e31258947c5a5",
"type": "mqtt out",
"z": "426169ba36026cef",
"d": true,
"name": "",
"topic": "test1",
"qos": "0",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "4c98c9faf0d2c5cc",
"x": 510,
"y": 100,
"wires": []
},
{
"id": "0ea43f2046318427",
"type": "inject",
"z": "426169ba36026cef",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "whatever",
"payload": "{\t \"deviceId\": \"0815\",\t \"ts\": $toMillis($now()),\t \"heat\": 100.0*$random()\t}",
"payloadType": "jsonata",
"x": 110,
"y": 100,
"wires": [
[
"667e31258947c5a5",
"57998534d0ca3d80"
]
]
},
{
"id": "44b9e02a0dfa8c44",
"type": "debug",
"z": "426169ba36026cef",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 520,
"y": 240,
"wires": []
},
{
"id": "b8a7111d1565fbe2",
"type": "mqtt in",
"z": "426169ba36026cef",
"d": true,
"name": "",
"topic": "test1",
"qos": "2",
"datatype": "auto-detect",
"broker": "4c98c9faf0d2c5cc",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 110,
"y": 220,
"wires": [
[
"44b9e02a0dfa8c44"
]
]
},
{
"id": "a652fd65381f40ac",
"type": "mqtt in",
"z": "426169ba36026cef",
"name": "",
"topic": "test/one",
"qos": "0",
"datatype": "auto-detect",
"broker": "aac991e8d61de49a",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 120,
"y": 300,
"wires": [
[
"44b9e02a0dfa8c44"
]
]
},
{
"id": "57998534d0ca3d80",
"type": "mqtt out",
"z": "426169ba36026cef",
"name": "",
"topic": "test/one",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "aac991e8d61de49a",
"x": 520,
"y": 160,
"wires": []
},
{
"id": "4c98c9faf0d2c5cc",
"type": "mqtt-broker",
"name": "",
"broker": "localhost",
"port": "1883",
"clientid": "nodered1",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "aac991e8d61de49a",
"type": "mqtt-broker",
"name": "",
"broker": "a21mq687wwyf8l-ats.iot.eu-central-1.amazonaws.com",
"port": "8883",
"tls": "b0b22f022f6359d5",
"clientid": "test",
"autoConnect": true,
"usetls": true,
"protocolVersion": "5",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "b0b22f022f6359d5",
"type": "tls-config",
"name": "",
"cert": "/Users/sebastianrothbucher/Downloads/f0aa72369dcd131aede19e79624b56a3be94f04f32ab4d0e3c11bb81f3b6f21e-certificate.pem.crt",
"key": "/Users/sebastianrothbucher/Downloads/f0aa72369dcd131aede19e79624b56a3be94f04f32ab4d0e3c11bb81f3b6f21e-private.pem.key",
"ca": "/Users/sebastianrothbucher/Downloads/AmazonRootCA1.pem",
"certname": "f0aa72369dcd131aede19e79624b56a3be94f04f32ab4d0e3c11bb81f3b6f21e-public.pem.key",
"keyname": "f0aa72369dcd131aede19e79624b56a3be94f04f32ab4d0e3c11bb81f3b6f21e-private.pem.key",
"caname": "AmazonRootCA1.pem",
"servername": "",
"verifyservercert": true,
"alpnprotocol": ""
}
]
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iot:Publish",
"iot:Receive",
"iot:RetainPublish"
],
"Resource": "arn:aws:iot:eu-central-1:525869301127:topic/test/one"
},
{
"Effect": "Allow",
"Action": "iot:Subscribe",
"Resource": "arn:aws:iot:eu-central-1:525869301127:topicfilter/test/one"
},
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": [
"arn:aws:iot:eu-central-1:525869301127:client/test",
"arn:aws:iot:eu-central-1:525869301127:client/testcli"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment