---
title: "PUT /greengrass/servicerole"
method: PUT
path: "/greengrass/servicerole"
---

# PUT /greengrass/servicerole

`PUT /greengrass/servicerole`

Associates a Greengrass service role with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. IoT Greengrass uses this role to verify the identity of client devices and manage core device connectivity information. The role must include the <a href="https://console.aws.amazon.com/iam/home#/policies/arn:awsiam::aws:policy/service-role/AWSGreengrassResourceAccessRolePolicy">AWSGreengrassResourceAccessRolePolicy</a> managed policy or a custom policy that defines equivalent permissions for the IoT Greengrass features that you use. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-service-role.html">Greengrass service role</a> in the <i>IoT Greengrass Version 2 Developer Guide</i>.

## Request body

- object
  - `RoleArn` string, required — The Amazon Resource Name (ARN) of the service role to associate with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

## Response `200`

Success

- AssociateServiceRoleToAccountResponse
  - `associatedAt` string — The time when the service role was associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

## Other responses

- `480` — ValidationException
- `481` — InternalServerException

---

[API](https://skmtc.net/aws/apis/greengrassv2.md) · [All operations](https://skmtc.net/aws/apis/greengrassv2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/greengrassv2/versions/f491b1d234d1/schema)
