Projects News & Events

Easier IoT with AWS Greengrass and Ansible

VMware helps its customers build and release new IoT products and solutions. In most situations, it’s a challenge to automate the configuration and rollout of IoT solutions, simply due to the scale and variety of systems involved. The AWS Greengrass service from Amazon supports management of IoT devices and provides a UI for interacting with devices. With the recent release of Greengrass on vSphere, Greengrass becomes a practical solution for running IoT devices in an on-premise data center.

However, Greengrass requires many operations to successfully deploy and organize devices, and it’s not always easy for users to perform the required steps correctly and in the right order.

Enter automation. With the recent release of a new open source project, ansible-aws-greengrass from VMware, you can now automate these operations. This new project provides a set of Ansible roles to configure AWS Greengrass with the required service-side components, generate security tokens, deploy code and perform the various steps required to rapidly and continuously deploy AWS Greengrass and related IoT components.

The initial release includes support for the following activities:

  • Creating roles and policies necessary to run Greengrass and interact with devices
  • Establishing Greengrass Groups and Cores identities at AWS
  • Generating automatic devices and associated certificates necessary for communication
  • Deploying Lambda functions and associating them with Greengrass Groups
  • Installing and configuring Greengrass Cores at the target runtime location
  • Deploying configuration versions to Greengrass Cores to start and upgrade their operation

To get started, you’ll need to clone a copy of the repo and install Ansible (if you haven’t already). You will also need some credentials for AWS. The initial credentials will require permissions to create users, roles and policies (AWS IAM), along with permissions to write to AWS Greengrass and AWS IoT naturally. You’ll also need to create and deploy code permissions for AWS Lambda if you have any Lambda functions that should be run in order to gather or manipulate IoT data.

Much of the automation is calling AWS APIs and making changes to services, but you will need a machine to be the automation host (this could be a local development box or a VM) and some machines or VMs that will run the AWS Greengrass code (they’re called Greengrass Cores in the AWS Greengrass documentation).

Follow the steps in the README to target and set up the automation host (which will be the target of the “awscli” role), and then to run the automation to create your Greengrass artifacts and deploy the Greengrass Cores to the appropriate machines. Please feel free to take this repo for a test drive and see if it can accelerate your deployments of Greengrass. Let us know if you have any feedback or additional use cases you’d like to see as well.

You can get started with Ansible AWS Greengrass by visiting: https://github.com/vmware/ansible-aws-greengrass. Stay tuned to the Open Source Blog for more new around VMware projects, and be sure to follow us on Twitter (@vmwopensource).