Differences between Amazon IoT Greengrass V1 and Amazon IoT Greengrass V2 - Amazon IoT Greengrass
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 (PDF).

Differences between Amazon IoT Greengrass V1 and Amazon IoT Greengrass V2

Amazon IoT Greengrass V2 introduces new fundamental concepts for devices, fleets, and deployable software. This section describes the V1 concepts that are different in V2.

Greengrass concepts and terminology
Concept Amazon IoT Greengrass V1 Amazon IoT Greengrass V2

Application code

In Amazon IoT Greengrass V1, Lambda functions define the software that runs on core devices. In each Greengrass group, you define subscriptions and local resources that the function uses. For Lambda functions that the Amazon IoT Greengrass Core software runs in a containerized Lambda runtime environment, you define container parameters, such as memory limits.

In Amazon IoT Greengrass V2, components are the software modules that run on core devices.

  • Each component has a recipe that defines the component's metadata, parameters, dependencies, and scripts to run at each step in the component lifecycle.

  • The recipe also defines the component's artifacts, which are binary files, such as scripts, compiled code, and static resources.

  • When you deploy a component to a core device, the core device downloads the component recipe and artifacts to run the component.

You can import your V1 Lambda functions as components that run in a Lambda runtime environment in Amazon IoT Greengrass V2. When you import the Lambda function, you specify the subscriptions, local resources, and container parameters for the function. For more information, see Step 2: Create and deploy Amazon IoT Greengrass V2 components to migrate Amazon IoT Greengrass V1 applications.

For more information about how to create custom components, see Develop Amazon IoT Greengrass components.

Amazon IoT Greengrass groups and deployments

In Amazon IoT Greengrass V1, a group defines the core device, the settings and software for that core device, and the list of Amazon IoT things that can connect to that core device. You create a deployment to send a group's configuration to a core device.

In Amazon IoT Greengrass V2, you use deployments to define the software components and configurations that run on core devices.

  • Each deployment targets a single core device (which is an Amazon IoT thing) or an Amazon IoT thing group that can contain multiple core devices.

  • Deployments to thing groups are continuous, so when you add a core device to a thing group, it receives the software configuration for that group.

For more information, see Deploy Amazon IoT Greengrass components to devices.

In Amazon IoT Greengrass V2, you can also create local deployments using the Greengrass CLI to test custom software components on the device where you develop them. For more information, see Create Amazon IoT Greengrass components.

Amazon IoT Greengrass Core software

In Amazon IoT Greengrass V1, the Amazon IoT Greengrass Core software is a single package that contains the software and all of its features. The edge device on which you install the Amazon IoT Greengrass Core software is called a Greengrass core.

In Amazon IoT Greengrass V2, the Amazon IoT Greengrass Core software is modular, so that you can choose what to install to control the memory footprint.

  • The Greengrass nucleus component is the minimum required installation of the Amazon IoT Greengrass Core software. The edge device on which you install the nucleus is called a Greengrass core device.

  • The nucleus handles deployments, orchestration, and lifecycle management of other components on the core device.

  • Features such as stream manager, secret manager, and log manager are components that you deploy only when you need those features. For more information, see Amazon-provided components.

Connectors

In Amazon IoT Greengrass V1, connectors are prebuilt modules that you deploy to Amazon IoT Greengrass V1 core devices to interact with local infrastructure, device protocols, Amazon, and other cloud services.

In Amazon IoT Greengrass V2, Amazon provides Greengrass components that implement the functionality provided by connectors in V1. The following Amazon IoT Greengrass V2 components provide Greengrass V1 connector functionality:

For more information, see Amazon-provided components.

Connected devices (Greengrass devices)

In Amazon IoT Greengrass V1, connected devices are Amazon IoT things that you add to a Greengrass group to connect to the core device in that group and communicate over MQTT. You must deploy that group each time that you add or remove a connected device. You use subscriptions to relay messages between connected devices, Amazon IoT Core, and applications on the core device.

In Amazon IoT Greengrass V2, connected devices are called Greengrass client devices.

  • You associate client devices to core devices to connect them and communicate over MQTT.

  • To authorize client devices to connect, you define authorization policies that can apply to groups of client devices, so you don't need to create a deployment to add or remove a client device.

  • To relay messages between client devices, Amazon IoT Core, and Greengrass components, you can configure an optional MQTT bridge component.

In both Amazon IoT Greengrass V1 and Amazon IoT Greengrass V2, devices can run FreeRTOS or use the Amazon IoT Device SDK or Greengrass discovery API to get information about core devices to which they can connect. The Greengrass discovery API is backward compatible, so if you have client devices that connect to a V1 core device, you can connect them to a V2 core device without changing their code.

For more information about client devices, see Interact with local IoT devices.

Local resources

In Amazon IoT Greengrass V1, Lambda functions that run in containers can be configured to access volumes and devices on the core device's file system. These file system resources are known as local resources.

In Amazon IoT Greengrass V2, you can run components that are Lambda functions, Docker containers, or native operating system processes or custom runtimes.

  • When you import a containerized Lambda function as a component, you must specify the local resources that the function uses.

  • Non-containerized Lambda functions and non-Lambda components can work directly with local resources on core devices, so you don't need to specify the local resources that the component uses.

Local shadow service

In Amazon IoT Greengrass V1, the local shadow service is enabled by default, and supports only unnamed classic shadows. You use the Amazon IoT Greengrass Core SDK in your Lambda functions to interact with shadows on your devices.

In Amazon IoT Greengrass V2, you enable the local shadow service by deploying the shadow manager component.

  • You can use the Amazon IoT Device SDK V2 in Lambda functions and custom components to interact with shadows on your devices.

  • The local shadow service supports named shadows.

  • The local shadow service lets you delete shadows and synchronize deleted shadows with Amazon IoT Core.

For more information, see Interact with device shadows.

Subscriptions

In Amazon IoT Greengrass V1, you define subscriptions for a Greengrass group to specify communication channels between Lambda functions, connectors, connected devices, the Amazon IoT Core MQTT broker, and the local shadow service. Subscriptions specify where Lambda functions receive event messages to consume as function payloads.

In Amazon IoT Greengrass V2, you specify communication channels without using subscriptions.

  • Components manage their own communication channels to interact with local publish/subscribe messages, Amazon IoT Core MQTT messages, and the local shadow service.

  • To configure communication channels between client devices, the local publish/subscribe broker, and the Amazon IoT Core MQTT broker, you configure and deploy the MQTT bridge component. The MQTT bridge component enables you to interact with client devices in components and relay messages between client devices and Amazon IoT Core.

Accessing other Amazon Web Services

In Amazon IoT Greengrass V1, you attach an Amazon Identity and Access Management (IAM) role, called the group role, to a Greengrass group. The group role defines the permissions that Lambda functions and Amazon IoT Greengrass features on that group's core device use to access Amazon Web Services.

In Amazon IoT Greengrass V2, you attach an Amazon IoT role alias to a Greengrass core device. The role alias points to an IAM role called the token exchange role. The token exchange role defines the permissions that Greengrass components on the core device use to access Amazon Web Services. For more information, see Authorize core devices to interact with Amazon services.