Create an OTA Update service role
The OTA Update service assumes this role to create and manage OTA update jobs on your behalf.
To create an OTA service role
-
Sign in to the https://console.aws.amazon.com/iam/
. -
From the navigation pane, choose Roles.
-
Choose Create role.
-
Under Select type of trusted entity, choose AWS Service.
-
Choose IoT from the list of AWS services.
-
Under Select your use case, choose IoT.
-
Choose Next: Permissions.
-
Choose Next: Tags.
-
Choose Next: Review.
-
Enter a role name and description, and then choose Create role.
For more information about IAM roles, see IAM Roles.
Important
To address the confused deputy security issue, you must follow instructions in the AWS IoT Core guide.
To add OTA update permissions to your OTA service role
-
In the search box on the IAM console page, enter the name of your role, and then choose it from the list.
-
Choose Attach policies.
-
In the Search box, enter "AmazonFreeRTOSOTAUpdate", select AmazonFreeRTOSOTAUpdate from the list of filtered policies, and then choose Attach policy to attach the policy to your service role.
To add the required IAM permissions to your OTA service role
-
In the search box on the IAM console page, enter the name of your role, and then choose it from the list.
-
Choose Add inline policy.
-
Choose the JSON tab.
-
Copy and paste the following policy document into the text box:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "iam:GetRole", "iam:PassRole" ], "Resource": "arn:aws:iam::
your_account_id
:role/your_role_name
" } ] }Make sure that you replace
your_account_id
with your AWS account ID, andyour_role_name
with the name of the OTA service role. -
Choose Review policy.
-
Enter a name for the policy, and then choose Create policy.
Note
The following procedure isn't required if your Amazon S3 bucket name begins with "afr-ota".
If it does, the AWS managed policy AmazonFreeRTOSOTAUpdate
already includes
the required permissions.
To add the required Amazon S3 permissions to your OTA service role
-
In the search box on the IAM console page, enter the name of your role, and then choose it from the list.
-
Choose Add inline policy.
-
Choose the JSON tab.
-
Copy and paste the following policy document into the box.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObjectVersion", "s3:GetObject", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::
example-bucket
/*" ] } ] }This policy grants your OTA service role permission to read Amazon S3 objects. Make sure that you replace
example-bucket
with the name of your bucket. -
Choose Review policy.
-
Enter a name for the policy, and then choose Create policy.