Giter Club home page Giter Club logo

aws_mqtt_mutualauth_demo_local's Introduction

AWS coreMQTT Mutual Authentication Demo

This demo application connects to AWS MQTT broker using TLS with mutual authentication between the client and the server. It demonstrates the subscribe-publish workflow of MQTT.

Visit coreMQTT mutual authentication demo for further information.

Please note, that properly configured thing is required to successfully run the demo application.

Targets:

Configure

Configure AWS IoT Thing:

  • Modify the following definitions in aws_clientcredential.h:
    • clientcredentialMQTT_BROKER_ENDPOINT: Remote Host Address (AWS IoT->Settings in AWS IoT console)
    • clientcredentialIOT_THING_NAME: Thing Name (AWS IoT->Manage->Things->Name in AWS IoT console)
  • Modify the following definitions in aws_clientcredential_keys.h:
    • keyCLIENT_CERTIFICATE_PEM: Client Certificate
    • keyCLIENT_PRIVATE_KEY_PEM: Client Private Key

Configure WiFi Access Point (when connecting via WiFi):

  • Modify the following definitions in socket_startup.c:
    • SSID: WiFi Access Point SSID
    • PASSWORD: WiFi Access Point Password
    • SECURITY_TYPE: WiFi Access Point Security

Build

  1. Prerequisites:
  2. Create .cprj project using csolution:
    csolution convert -s Demo.csolution.yml -c Demo.<build-type>+<target-type>
    • <build-type>: Debug | Release
    • <target-type>: IP-Stack | WiFi | AVH
  3. Build .cprj project using cbuild:
    cbuild Demo.<build-type>+<target-type>.cprj

Run

  • Connect and configure the debugger.
  • Run the application and view messages in a debug printf or terminal window.

Note: click on Target links above for target specific information.

MQTT messages can be viewed in the AWS IoT console.

CI Testing

To build and run this application with a CI workflow on GitHub the following steps are required. For details refer to Run AMI with GitHub Actions.

  1. Amazon Web Service (AWS) account with:

    • Amazon EC2 (elastic cloud) access
    • Amazon S3 (storage) access
    • Registration to access AVH Amazon Machine Image AVH AMI
    • User role setup for scripted API access
  2. GitHub:

    • Fork this repository with at least Write access rights
    • Store the AWS account configuration (obtained in step 1) as GitHub Secrets - AWS Access values in the forked repository
  3. AWS IoT Thing:

    • Use the AWS IoT console to create a thing, download its certificates, create a policy, and attach the policy to the thing
    • Store this configuration as GitHub Secrets - IoT Cloud Access values in the forked repository

GitHub Secrets - Values

The following (secret) configuration values need to be added to the repositories Secret store:

Secret Name Description
AWS Access Settings and credentials to access AWS services for running Arm Virtual Hardware
AWS_IAM_PROFILE The IAM Instance Profile associated with the AVH EC2 instance granting it access to required AWS resources.
AWS_ASSUME_ROLE The AWS access role to be assumed for AWS access.
AWS_S3_BUCKET_NAME The name of the S3 storage bucket to be used for temporary data storage by Arm Virtual Hardware.
AWS_DEFAULT_REGION The data center region for running new AVH AMI. For example eu-west-1.
AWS_SECURITY_GROUP_ID The id of the VPC security group to add the EC2 instance to. Shall have format sg-xxxxxxxx.
AWS_SUBNET_ID The id of the VPC subnet to connect the EC2 instance to. Shall have format subnet-xxxxxxxx.
IoT Cloud Access Settings and credentials required to connect an AWS IoT Thing
CLIENT_CERTIFICATE_PEM Client (device) certificate
CLIENT_PRIVATE_KEY_PEM Client (device) private key
IOT_THING_NAME Client (device) name
MQTT_BROKER_ENDPOINT MQTT broker host name

aws_mqtt_mutualauth_demo_local's People

Contributors

robertrostohar avatar keilchris 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.