Configuring gateway dependencies on Amazon Elastic Compute Cloud - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Configuring gateway dependencies on Amazon Elastic Compute Cloud

You can configure a gateway that runs on Amazon EC2. The gateway runs in the Amazon Cloud and ingests data from your industrial data sources to Amazon IoT SiteWise. For more information, see What is Amazon EC2? in the Amazon EC2 User Guide for Linux Instances.

Amazon IoT SiteWise provides an Amazon CloudFormation template that you can use to easily create gateway dependencies on an Amazon EC2 instance. When you create a stack from the template, Amazon CloudFormation creates the required Amazon resources for you to run a gateway. Then, you can create a gateway that uses the Amazon IoT Greengrass Core running on the Amazon EC2 instance.

The Amazon CloudFormation template creates the following resources:

  • An Amazon EC2 instance with Amazon IoT Greengrass Core software

  • An Amazon IoT Greengrass group with info-level logging for CloudWatch Logs and the local file system

  • An Amazon Virtual Private Cloud

  • Amazon Identity and Access Management (IAM) roles

Important

You will be charged for the resources that this Amazon CloudFormation template creates and uses. These charges include an Amazon IoT Greengrass device and compute capacity and data transfer for Amazon EC2.

Prerequisites

To create gateway dependencies on Amazon EC2 from this stack template, you need the following:

  • The Amazon IoT SiteWise service-linked role in your Amazon account. This role creates automatically when you use the Amazon IoT SiteWise console. For more information, see Using service-linked roles for Amazon IoT SiteWise.

  • An Amazon IoT Greengrass service role attached to your Amazon account in the Region where you create this stack. For more information, see Amazon IoT Greengrass service role in the Amazon IoT Greengrass Version 1 Developer Guide.

Creating the Amazon CloudFormation stack

You can create a stack in Amazon CloudFormation to create an Amazon EC2 instance with Amazon IoT Greengrass gateway dependencies.

To create gateway dependencies on Amazon EC2

  1. Open the Amazon CloudFormation template and sign in to the Amazon Web Services Management Console.

  2. On the Create stack page, choose Next at the bottom of the page.

  3. On the Specify stack details page, enter a GroupName for the Amazon IoT Greengrass group that this template creates for the gateway.

  4. (Optional) Change any of the template's other parameters:

    • InstanceType – The Amazon EC2 instance type. For more information, see Instance types in the Amazon EC2 User Guide for Linux Instances.

    • SecurityAccessCIDR – The CIDR block for the virtual private cloud (VPC). For more information, see VPCs and subnets in the Amazon VPC User Guide.

  5. Choose Next.

  6. On the Configure stack options page, choose Next.

  7. At the bottom of the page, choose the check boxes that acknowledge that Amazon CloudFormation requires access capabilities.

  8. Choose Create stack.

    The stack takes around 5 minutes to create. If the stack fails to create, your account might have insufficient permissions, or you might not have the prerequisite IAM roles. Follow these steps to delete the stack and try again:

    1. Choose Delete in the upper-right corner.

      The stack takes a few minutes to delete.

    2. If the stack fails to delete, choose Delete again.

    3. If the stack fails to delete again, follow the steps in the Amazon CloudFormation console to skip the resources that failed to delete, and try again.

  9. After the stack creates successfully, you can create a gateway with the Amazon IoT Greengrass group that deploys to the Amazon EC2 instance. For more information, see Adding the gateway to Amazon IoT SiteWise.

Important

After you create the stack, you can see the new resources in your Amazon account. Your gateway might stop working correctly if you delete or modify these resources. We recommend that you don't modify these resources unless you want to change settings on your gateway's Amazon IoT Greengrass group.