ConnectSense Smart Power Cord on the AWS Cloud

Quick Start Reference Deployment

QS

January 2022
Gary Marrs and Paco Rodríguez, Grid Connect
Carlos Lemus and Justin Courtright, Trek10
Irshad Buchh, AWS SI Partner Management team

Visit our GitHub repository to view source files, report bugs, submit feature ideas, or post other feedback on this Quick Start. To comment on the documentation, see Feedback on this guide.

This Quick Start was created by Grid Connect and Trek10 in collaboration with Amazon Web Services (AWS). Quick Starts are automated reference deployments that use AWS CloudFormation templates to deploy key technologies on AWS, following AWS best practices.

Overview

This guide provides instructions for deploying the ConnectSense Smart Power Cord (SPC) Quick Start reference architecture on the AWS Cloud. If you are unfamiliar with AWS Quick Starts we recommend that you read the AWS Quick Start General Content Guide.

This deployment guide covers the steps necessary to deploy the Quick Start. For more advanced information on the product, troubleshooting, or additional functionality, see the Operational guide.

This Quick Start creates a serverless Internet of Things (IoT) backend for developers who want to build applications for the SPC on AWS. There is also an option to deploy AWS IoT SiteWise resources and a machine learning pipeline for anomaly detection.

Costs and licenses

There are no additional licenses required to use this Quick Start.

There is no cost to use this Quick Start, however you will be billed for the resources deployed. For more information see the AWS Quick Start General Content Guide.

Architecture

Deploying this Quick Start with default parameters builds the following SPC serverless IoT environment in the AWS Cloud.

Architecture
Figure 1. Architecture for the ConnectSense Smart Power Cord Quick Start on AWS

As shown in Figure 1, the Quick Start sets up the following:

  • Amazon API Gateway for ConnectSense devices to self-provision.

  • AWS Lambda: one function to provision devices and one to generate alerts to send to the Amazon Simple Notification Service (Amazon SNS) topic. The Lambda functions require AWS Identity and Access Management (IAM) roles created by the Quick Start.

  • An Amazon SNS topic for publishing alerts.

  • AWS IoT Core to publish the device metrics.

  • AWS IoT Analytics to provide a pipeline, channel, data store, and dataset for processing the device metrics.

  • Amazon QuickSight to provide a dashboard for data visualization.

  • AWS SageMaker for a machine learning model.

  • AWS IoT SiteWise for an asset model.

Deployment options

This Quick Start provides one deployment option:

  • Deploy SPC. This option builds a new Amazon API Gateway and provisions AWS IoT Analytics in your account, with the option to deploy AWS IoT SiteWise.

Predeployment steps

Prepare for the deployment

To provision the SPC, you need the following:

  • A load or test device, such as a fan or light bulb, plugged into the SPC.

  • An AWS account. If you don’t have an AWS account, you can create one at https://aws.amazon.com.

  • A user with permission to launch AWS CloudFormation stacks that create IAM roles.

Deployment steps

After clicking the Deploy link on the Quick Start landing page, you will be brought to the CloudFormation console, with the template URL pre-populated. Ensure you are in the correct Region and click Next to enter parameter values.

Unless you are customizing the Quick Start templates for your own deployment projects, keep the default settings for the parameters Quick Start S3 bucket name, Quick Start S3 bucket Region, and Quick Start S3 key prefix. Changing these settings automatically updates code references to point to a new Quick Start location. For more information, see the AWS Quick Start Contributor’s Guide.
  1. On the Configure stack options page, you can specify tags (key-value pairs) for resources in your stack and set advanced options. When you finish, choose Next.

  2. On the Review page, review and confirm the template settings. Under Capabilities, select the two check boxes to acknowledge that the template creates IAM resources and might require the ability to automatically expand macros.

  3. Choose Create stack to deploy the stack.

  4. Monitor the status of the stack. When the status is CREATE_COMPLETE, the ConnectSense Smart Power Cord deployment is ready.

  5. To view the created resources, see the values displayed in the Outputs tab for the stack.

Postdeployment steps

Retrieve the API Gateway URL and API key

  1. Open the AWS CloudFormation console, and choose your deployed stack.

  2. Retrieve the API Gateway URL.

    1. Choose the Outputs tab.

    2. Copy the value of the ApiGatewayURL key, and save the value for use in configuring your SPC.

  3. Retrieve the API key’s physical ID.

    1. Choose the Resources tab.

    2. In the Logical ID column, find ApiKey, and choose its Physical ID link. For example, see the circled link in Figure 2.

      CloudFormation Stack
      Figure 2. AWS CloudFormation stack showing the link to the API key’s physical ID
    3. Next to API key, choose Show, as shown in Figure 3. This reveals the ID value required for registering your physical device. Save this value for use in configuring your SPC.

      CloudFormation API key
      Figure 3. API Gateway, API key

Configure the SPC with your new IoT endpoint

To configure your SPC, you need the Python script that’s maintained and hosted by ConnectSense in their GitHub repository.

  1. Download the ConnectSense Device Connection repository, and retrieve the script.

  2. Follow the configuration steps in the repository. You need the API Gateway URL and the API key that you retrieved earlier. (See Retrieve the API Gateway URL and API key, previously in this guide.)

Operational

For help with operational tasks such as creating a QuickSight dashboard, see the Operational guide.

Troubleshooting

For troubleshooting common Quick Start issues visit the AWS Quick Start General Content Guide or the Troubleshooting CloudFormation page in the AWS documentation.

After you successfully deploy a Quick Start, confirm that your resources and services are updated and configured — including any required patches — to meet your security and other needs. For more information, see the AWS Shared Responsibility Model.

Feedback on this guide

To comment on this guide, open a GitHub issue as follows:

Notices

This document is provided for informational purposes only. It represents AWS’s current product offerings and practices as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS’s products or services, each of which is provided “as is” without warranty of any kind, whether expressed or implied. This document does not create any warranties, representations, contractual commitments, conditions, or assurances from AWS, its affiliates, suppliers, or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers.

The software included with this paper is licensed under the Apache License, version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the accompanying "license" file. This code is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied. See the License for specific language governing permissions and limitations.