Giter VIP home page Giter VIP logo

iot-resources's Introduction

iot-resources

The purpose of this solution is to deploy resources necessary for an IoT Solution

PreRequisites

Requires the use of direnv.

Requires the use of Azure CLI.

Requires the use of OpenSSL.

Related Repositories

Provision the Azure Resources

This script will generate the following resources in Azure.

  1. Key Vault

  2. Storage Account

  3. IoT Hub

  4. Device Provisioning Service

  5. Log Analytics

  6. Application Insights

  7. Stream Analytics

  8. Time Series Insights

# Provision the ARM Resources
./provision.sh

The script creates an .envrc file to set environment variables used in creating the x509 certs.

# Azure Resources
export VAULT="<key_vault>"
export HUB="<iot_hub>"
export DPS="<iot_dps>"
export DPS_GROUP="<resource_group>"

# Certificate Authority
export ORGANIZATION="<organization>"
export ROOT_CA_PASSWORD="<password>"
export INT_CA_PASSWORD="<password>"

The default ORGANIZATION name is testonly. These files have the reference to the organization.

  • .envrc
  • root_ca.dnf
  • intermediate_ca.dnf

Create and Upload the Root CA and Intermediate Certificates

This script initializes a Root and Intermediate CA for use.

  1. Creates x509 Certificates and Authorities in ./src/pki

  2. Upload the Certificates, Keys, and Passwords used to the KeyVault.

  3. Uploads and Validates the Root and Intermediate CA certificates to the IoT Hub.

  4. Uploads and Validates the Root and Intermediate CA certificates to the IoT DPS.

# Initializes a Root and Intermediate CA for use.
./init-ca.sh

Creating and Storing Device Certificates

This script creates device certificates for use.

  1. Creates an iot hub identity using a self signed certificate.

  2. Creates device certificates signed by the Intermediate CA

  3. Creates edge certificates signed by the Intermediate CA

  4. Creates leaf certificates signed by the Intermediate CA

# Usage            <type>  <name>
./device-cert.sh   self    self-signed-device
./device-cert.sh   device  device  deploy (optional)
./device-cert.sh   edge    edge
EDGE_GATEWAY="edge" ./device-cert.sh   leaf    leaf

Spin up Multiple Containers

Devices

COUNT=1
until [ $COUNT -gt 10 ]; do
./device-cert.sh device device$COUNT deploy
let COUNT+=1
done

Downstream Devices

COUNT=1
until [ $COUNT -gt 10 ]; do
EDGE_GATEWAY="edge" ./device-cert.sh leaf leaf$COUNT deploy
let COUNT+=1
done

iot-resources's People

Contributors

danielscholl avatar saikovvuri avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.