AWS IoT Greengrass Version 1 entered the extended life phase on June 30, 2023. For more information, see the AWS IoT Greengrass V1 maintenance policy. After this date, AWS IoT Greengrass V1 won't release updates that provide features, enhancements, bug fixes, or security patches. Devices that run on AWS IoT Greengrass V1 won't be disrupted and will continue to operate and to connect to the cloud. We strongly recommend that you migrate to AWS IoT Greengrass Version 2, which adds significant new features and support for additional platforms.
Configure the group role
The group role is an IAM role that you create and attach to your Greengrass group. This role contains the permissions that deployed Lambda functions (and other AWS IoT Greengrass features) use to access AWS services. For more information, see Greengrass group role.
You use the following high-level steps to create a group role in the IAM console.
-
Create a policy that allows or denies actions on one or more resources.
-
Create a role that uses the Greengrass service as a trusted entity.
-
Attach your policy to the role.
Then, in the AWS IoT console, you add the role to the Greengrass group.
Note
A Greengrass group has one group role. If you want to add permissions, you can edit attached policies or attach more policies.
For this tutorial, you create a permissions policy that allows describe, create, and update actions on an Amazon DynamoDB table. Then, you attach the policy to a new role and associate the role with your Greengrass group.
First, create a customer-managed policy that grants permissions required by the Lambda function in this module.
-
In the IAM console, in the navigation pane, choose Policies, and then choose Create policy.
-
On the JSON tab, replace the placeholder content with the following policy. The Lambda function in this module uses these permissions to create and update a DynamoDB table named
CarStats
.{ "Version": "2012-10-17", "Statement": [ { "Sid": "PermissionsForModule6", "Effect": "Allow", "Action": [ "dynamodb:DescribeTable", "dynamodb:CreateTable", "dynamodb:PutItem" ], "Resource": "arn:aws:dynamodb:*:*:table/CarStats" } ] }
-
Choose Next: Tags, and then choose Next: Review. Tags aren't used in this tutorial.
-
For Name, enter
greengrass_CarStats_Table
, and then choose Create policy.Next, create a role that uses the new policy.
-
In the navigation pane, choose Roles, and then choose Create role.
-
Under Trusted entity type, choose AWS service.
-
Under Use case, Use cases for other AWS services choose Greengrass, select Greengrass, and then choose Next.
-
Under Permissions policies, select the new
greengrass_CarStats_Table
policy, and then choose Next. -
For Role name, enter
Greengrass_Group_Role
. -
For Description, enter
Greengrass group role for connectors and user-defined Lambda functions
. -
Choose Create role.
Now, add the role to your Greengrass group.
In the AWS IoT console navigation pane, under Manage, expand Greengrass devices, and then choose Groups (V1).
-
Under Greengrass groups, choose your group.
-
Choose Settings, and then choose Associate role.
-
Choose Greengrass_Group_Role from your list of roles, and then choose Associate role.