Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Monitor the delivery of messages using nRF Cloud's Message Routing Service

License

Notifications You must be signed in to change notification settings

bifravst/nrfcloud-message-routing-service-monitoring

Monitor the delivery of messages using nRF Cloud's Message Routing Service

Setup

npm ci
npx cdk deploy

Configure team ID

aws ssm put-parameter --name /nrfcloud-message-routing-service-monitoring/teamId --type String --value <team ID>

Make sure the webhook returns the team ID

http <receiveFnURL>
# HTTP/1.1 201 Created
# ...
# x-nrfcloud-team-id: ...

Register webhook

http POST https://message-routing.nrfcloud.com/v2/destination "Authorization: Bearer $NRFCLOUD_API_KEY" <<< '{"name":"Monitoring","isEnabled":true,"config":{"type":"http","url":"<receiveFnURL>","verifySsl":true}}'

Create device

Credentials

export DEVICE_ID=`uuidgen`
http POST https://api.nrfcloud.com/v1/devices/$DEVICE_ID/certificates Authorization:"Bearer $NRFCLOUD_API_KEY" Content-Type:text/plain > $DEVICE_ID.json <<< 123456

Connect

npx tsx connect.ts $DEVICE_ID.json
# Connected

Associate device

echo -n 123456 | http PUT https://api.nrfcloud.com/v1/association/$DEVICE_ID Authorization:"Bearer $NRFCLOUD_API_KEY" Content-Type:text/plain
# HTTP/1.1 202 Accepted

Store credentials

aws ssm put-parameter --name /nrfcloud-message-routing-service-monitoring/device/clientId --type String --value "`cat $DEVICE_ID.json | jq -r '.clientId'`"
aws ssm put-parameter --name /nrfcloud-message-routing-service-monitoring/device/caCert --type String --value "`cat $DEVICE_ID.json | jq -r '.caCert'`"
aws ssm put-parameter --name /nrfcloud-message-routing-service-monitoring/device/privateKey --type String --value "`cat $DEVICE_ID.json | jq -r '.privateKey'`"
aws ssm put-parameter --name /nrfcloud-message-routing-service-monitoring/device/clientCert --type String --value "`cat $DEVICE_ID.json | jq -r '.clientCert'`"

About

Monitor the delivery of messages using nRF Cloud's Message Routing Service

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published