Exploring the Greengrass components on your device – Configuring an AWS Snowcone Device to Be an IOT Gateway

The CloudFormation templates you deployed earlier included a rather complex configuration that was assigned to your EC2 instance the moment it connected to the Greengrass service. Let’s take a look at what this consists of as a jumping-off point for further exploration of what these components can do for you.

In the AWS Management Console, navigate to AWS IoT Core > Manage > Greengrass devices > Core devices and then click on your Snowcone name.

This will take you to an overview page, as shown in the following figure:

Figure 12.40 – Detail of the Snowcone device as a Greengrass Core device

Let’s review what each of the elements highlighted in red represents:

Components – This tab will show you which Greengrass components are installed and running on your device, as well as troubleshooting information if any are failing. In the case of this deployment, we have deployed and configured 19 Greengrass components. To see more details about them and their configuration, navigate to the Deployments tab and click on the Deployment ID link. In the upper right is an Actions dropdown. From that, select Download as JSON. An example of this is shown in the following figure:

Figure 12.41 – Downloading the component configuration as a JSON file

Logs – One of the components we deployed was the Amazon CloudWatch agent. Click this link to see detailed log information coming in from the various components deployed in Greengrass as well as general operating system information about the EC2 instance:

Figure 12.42 – Viewing log groups in Amazon CloudWatch

Systems Manager node – Another component included in the deployment was the Systems Manager agent. Click this link to view configuration information or perform tasks against the EC2 instance the same way you would any other:

Figure 12.43 – Viewing the filesystem inventory from AWS Systems Manager

Client Devices – AWS IoT Greengrass v2 Core devices can be standalone endpoints if you wish. However, most customers use them as gateways for other IoT devices. This is especially true when using Greengrass on an AWS Snowcone device. The Client Devices tab is where you would initiate the cloud discovery procedure. This process will help you connect IoT things into Greengrass via this AWS Snowcone device, instead of them needing direct connectivity into AWS over the internet.

This is facilitated by the MQTT Broker, MQTT Bridge, Client Auth, and IP Discovery components that were included as part of this deployment.

Summary

In this chapter, we ran through a hands-on exercise that deployed a set of Infrastructure As Code (IaC) templates using AWS CloudFormation. This allowed you to deploy a complex and interrelated constellation of infrastructure components in minutes – something that could have taken hours to configure by hand in the AWS Management Console.

Next, we showed you how to install the AWS Snow CLI and configure AWS CLI v2 for use with the endpoints on an AWS Snow Family device. You also learned how to use these tools to unlock the device, create VNIs, and launch EC2 instances. We then covered how to configure the AWS IoT Greengrass v2 agent within an EC2 instance running on the AWS Snow Family device.

Finally, we did a walkthrough of how to connect to the EC2 instance remotely, and how to use the AWS IoT Greengrass v2 Core device as a gateway for sensors and other AWS IoT Core devices.

In the next chapter, you will walk through another hands-on exercise that uses IaC templates written in Terraform to deploy a distributed edge application that spans AWS Local Zones, AWS Wavelength Zones, and an AWS Region.

Leave a comment

Your email address will not be published. Required fields are marked *