執行 AWS IoT Greengrass 資格套件的先決條件 - AWS IoT Greengrass

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

執行 AWS IoT Greengrass 資格套件的先決條件

本節說明使用 AWS IoT Device Tester (IDT) 的先決條件 AWS IoT Greengrass。

下載 AWS IoT Device Tester 適用於 的最新版本 AWS IoT Greengrass

下載最新版本的 IDT,並將軟體解壓縮到檔案系統上具有讀取/寫入許可的位置 (<device-tester-extract-location>)。

注意

IDT 不支援由多位使用者從共用位置執行,例如 NFS 目錄或 Windows 網路共用資料夾。我們建議您將 IDT 套件解壓縮到本機磁碟機,並在本機工作站上執行 IDT 二進位檔。

Windows 的路徑長度限制為 260 個字元。如果您使用的是 Windows,請將 IDT 解壓縮到根目錄,例如 C:\ D:\,使路徑保持在 260 個字元的限制以下。

下載 AWS IoT Greengrass 軟體

IDT for AWS IoT Greengrass V2 會測試您的裝置與特定 版本的相容性 AWS IoT Greengrass。執行下列命令,將 AWS IoT Greengrass Core 軟體下載至名為 的檔案aws.greengrass.nucleus.zip。將 版本取代為 IDT 版本的支援核元件版本。

Linux or Unix
curl -s https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-version.zip > aws.greengrass.nucleus.zip
Windows Command Prompt (CMD)
curl -s https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-version.zip > aws.greengrass.nucleus.zip
PowerShell
iwr -Uri https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-version.zip -OutFile aws.greengrass.nucleus.zip

將下載aws.greengrass.nucleus.zip的檔案放入 <device-tester-extract-location>/products/ 資料夾。

注意

請勿將相同作業系統和架構的多個檔案放在這個目錄中。

建立和設定 AWS 帳戶

您必須先執行下列步驟,才能使用 AWS IoT Device Tester for AWS IoT Greengrass V2:

  1. 設定 AWS 帳戶。如果您已有 AWS 帳戶,請跳至步驟 2。

  2. 設定 IDT 的許可。

這些帳戶許可允許 IDT 代表您存取 AWS 服務和建立 AWS 資源,例如 AWS IoT 物件和 AWS IoT Greengrass 元件。

若要建立這些資源,IDT for AWS IoT Greengrass V2 會使用config.json檔案中設定的 AWS 登入資料,代表您進行 API 呼叫。系統會在測試期間的不同時間點內佈建這些資源。

注意

雖然大多數測試都符合 AWS 免費方案的資格,但您必須在註冊 時提供信用卡 AWS 帳戶。如需詳細資訊,請參閱如果我的帳戶適用於免費方案,為何需要付款方式?

步驟 1:設定 AWS 帳戶

在此步驟中,建立和設定 AWS 帳戶。如果您已擁有 AWS 帳戶,請跳到 步驟 2:設定 IDT 的許可

如果您沒有 AWS 帳戶,請完成下列步驟來建立一個 。

註冊 AWS 帳戶
  1. 開啟 https://portal.aws.amazon.com/billing/signup

  2. 請遵循線上指示進行。

    部分註冊程序需接收來電,並在電話鍵盤輸入驗證碼。

    當您註冊 時 AWS 帳戶,AWS 帳戶根使用者會建立 。根使用者有權存取該帳戶中的所有 AWS 服務 和資源。作為安全最佳實務,請將管理存取權指派給使用者,並且僅使用根使用者來執行需要根使用者存取權的任務

若要建立管理員使用者,請選擇下列其中一個選項。

選擇一種管理管理員的方式 根據 您也可以
在 IAM Identity Center

(建議)

使用短期憑證存取 AWS。

這與安全性最佳實務一致。有關最佳實務的資訊,請參閱 IAM 使用者指南中的 IAM 安全最佳實務

請遵循 AWS IAM Identity Center 使用者指南入門中的說明。 透過在 AWS Command Line Interface 使用者指南中設定 AWS CLI 以使用 來設定 AWS IAM Identity Center程式設計存取。
在 IAM 中

(不建議使用)

使用長期憑證存取 AWS。 請遵循 IAM 使用者指南中建立緊急存取的 IAM 使用者中的指示。 IAM 使用者指南中,透過管理 IAM 使用者的存取金鑰來設定程式設計存取。

步驟 2:設定 IDT 的許可

在此步驟中,設定 IDT for AWS IoT Greengrass V2 用來執行測試和收集 IDT 用量資料的許可。您可以使用 AWS Management ConsoleAWS Command Line Interface (AWS CLI) 來建立 IAM 政策和 IDT 的測試使用者,然後將政策連接到使用者。如果您已為 IDT 建立測試使用者,請跳至 設定您的裝置以執行 IDT 測試

  1. 登入 IAM 主控台

  2. 建立客戶受管政策,該政策授與建立具有特定許可之角色的許可。

    1. 在導覽窗格中,選擇政策,然後選擇建立政策

    2. 如果您不是使用 PreInstalled,請在 JSON 索引標籤上,將預留位置內容取代為下列政策。如果您使用的是 PreInstalled,請繼續下列步驟。

      { "Version":"2012-10-17", "Statement":[ { "Sid":"passRoleForResources", "Effect":"Allow", "Action":"iam:PassRole", "Resource":"arn:aws:iam::*:role/idt-*", "Condition":{ "StringEquals":{ "iam:PassedToService":[ "iot.amazonaws.com", "lambda.amazonaws.com", "greengrass.amazonaws.com" ] } } }, { "Sid":"lambdaResources", "Effect":"Allow", "Action":[ "lambda:CreateFunction", "lambda:PublishVersion", "lambda:DeleteFunction", "lambda:GetFunction" ], "Resource":[ "arn:aws:lambda:*:*:function:idt-*" ] }, { "Sid":"iotResources", "Effect":"Allow", "Action":[ "iot:CreateThing", "iot:DeleteThing", "iot:DescribeThing", "iot:CreateThingGroup", "iot:DeleteThingGroup", "iot:DescribeThingGroup", "iot:AddThingToThingGroup", "iot:RemoveThingFromThingGroup", "iot:AttachThingPrincipal", "iot:DetachThingPrincipal", "iot:UpdateCertificate", "iot:DeleteCertificate", "iot:CreatePolicy", "iot:AttachPolicy", "iot:DetachPolicy", "iot:DeletePolicy", "iot:GetPolicy", "iot:Publish", "iot:TagResource", "iot:ListThingPrincipals", "iot:ListAttachedPolicies", "iot:ListTargetsForPolicy", "iot:ListThingGroupsForThing", "iot:ListThingsInThingGroup", "iot:CreateJob", "iot:DescribeJob", "iot:DescribeJobExecution", "iot:CancelJob" ], "Resource":[ "arn:aws:iot:*:*:thing/idt-*", "arn:aws:iot:*:*:thinggroup/idt-*", "arn:aws:iot:*:*:policy/idt-*", "arn:aws:iot:*:*:cert/*", "arn:aws:iot:*:*:topic/idt-*", "arn:aws:iot:*:*:job/*" ] }, { "Sid":"s3Resources", "Effect":"Allow", "Action":[ "s3:GetObject", "s3:PutObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:CreateBucket", "s3:ListBucket", "s3:ListBucketVersions", "s3:DeleteBucket", "s3:PutObjectTagging", "s3:PutBucketTagging" ], "Resource":"arn:aws:s3::*:idt-*" }, { "Sid":"roleAliasResources", "Effect":"Allow", "Action":[ "iot:CreateRoleAlias", "iot:DescribeRoleAlias", "iot:DeleteRoleAlias", "iot:TagResource", "iam:GetRole" ], "Resource":[ "arn:aws:iot:*:*:rolealias/idt-*", "arn:aws:iam::*:role/idt-*" ] }, { "Sid":"idtExecuteAndCollectMetrics", "Effect":"Allow", "Action":[ "iot-device-tester:SendMetrics", "iot-device-tester:SupportedVersion", "iot-device-tester:LatestIdt", "iot-device-tester:CheckVersion", "iot-device-tester:DownloadTestSuite" ], "Resource":"*" }, { "Sid":"genericResources", "Effect":"Allow", "Action":[ "greengrass:*", "iot:GetThingShadow", "iot:UpdateThingShadow", "iot:ListThings", "iot:DescribeEndpoint", "iot:CreateKeysAndCertificate" ], "Resource":"*" }, { "Sid":"iamResourcesUpdate", "Effect":"Allow", "Action":[ "iam:CreateRole", "iam:DeleteRole", "iam:CreatePolicy", "iam:DeletePolicy", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:TagRole", "iam:TagPolicy", "iam:GetPolicy", "iam:ListAttachedRolePolicies", "iam:ListEntitiesForPolicy" ], "Resource":[ "arn:aws:iam::*:role/idt-*", "arn:aws:iam::*:policy/idt-*" ] } ] }
    3. 如果您使用的是 PreInstalled,請在 JSON 索引標籤上,將預留位置內容取代為下列政策。請確定您:

      • iotResources陳述式中的 thingNamethingGroup 取代為測試中裝置 (DUT) 上 Greengrass 安裝期間建立的物件名稱和物件群組,以新增許可。

      • roleAliasResources陳述式和passRoleForResources陳述式中的 passRoleroleAlias 取代為在 DUT 上 Greengrass 安裝期間建立的角色。

      { "Version":"2012-10-17", "Statement":[ { "Sid":"passRoleForResources", "Effect":"Allow", "Action":"iam:PassRole", "Resource":"arn:aws:iam::*:role/passRole", "Condition":{ "StringEquals":{ "iam:PassedToService":[ "iot.amazonaws.com", "lambda.amazonaws.com", "greengrass.amazonaws.com" ] } } }, { "Sid":"lambdaResources", "Effect":"Allow", "Action":[ "lambda:CreateFunction", "lambda:PublishVersion", "lambda:DeleteFunction", "lambda:GetFunction" ], "Resource":[ "arn:aws:lambda:*:*:function:idt-*" ] }, { "Sid":"iotResources", "Effect":"Allow", "Action":[ "iot:CreateThing", "iot:DeleteThing", "iot:DescribeThing", "iot:CreateThingGroup", "iot:DeleteThingGroup", "iot:DescribeThingGroup", "iot:AddThingToThingGroup", "iot:RemoveThingFromThingGroup", "iot:AttachThingPrincipal", "iot:DetachThingPrincipal", "iot:UpdateCertificate", "iot:DeleteCertificate", "iot:CreatePolicy", "iot:AttachPolicy", "iot:DetachPolicy", "iot:DeletePolicy", "iot:GetPolicy", "iot:Publish", "iot:TagResource", "iot:ListThingPrincipals", "iot:ListAttachedPolicies", "iot:ListTargetsForPolicy", "iot:ListThingGroupsForThing", "iot:ListThingsInThingGroup", "iot:CreateJob", "iot:DescribeJob", "iot:DescribeJobExecution", "iot:CancelJob" ], "Resource":[ "arn:aws:iot:*:*:thing/thingName", "arn:aws:iot:*:*:thinggroup/thingGroup", "arn:aws:iot:*:*:policy/idt-*", "arn:aws:iot:*:*:cert/*", "arn:aws:iot:*:*:topic/idt-*", "arn:aws:iot:*:*:job/*" ] }, { "Sid":"s3Resources", "Effect":"Allow", "Action":[ "s3:GetObject", "s3:PutObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:CreateBucket", "s3:ListBucket", "s3:ListBucketVersions", "s3:DeleteBucket", "s3:PutObjectTagging", "s3:PutBucketTagging" ], "Resource":"arn:aws:s3::*:idt-*" }, { "Sid":"roleAliasResources", "Effect":"Allow", "Action":[ "iot:CreateRoleAlias", "iot:DescribeRoleAlias", "iot:DeleteRoleAlias", "iot:TagResource", "iam:GetRole" ], "Resource":[ "arn:aws:iot:*:*:rolealias/roleAlias", "arn:aws:iam::*:role/idt-*" ] }, { "Sid":"idtExecuteAndCollectMetrics", "Effect":"Allow", "Action":[ "iot-device-tester:SendMetrics", "iot-device-tester:SupportedVersion", "iot-device-tester:LatestIdt", "iot-device-tester:CheckVersion", "iot-device-tester:DownloadTestSuite" ], "Resource":"*" }, { "Sid":"genericResources", "Effect":"Allow", "Action":[ "greengrass:*", "iot:GetThingShadow", "iot:UpdateThingShadow", "iot:ListThings", "iot:DescribeEndpoint", "iot:CreateKeysAndCertificate" ], "Resource":"*" }, { "Sid":"iamResourcesUpdate", "Effect":"Allow", "Action":[ "iam:CreateRole", "iam:DeleteRole", "iam:CreatePolicy", "iam:DeletePolicy", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:TagRole", "iam:TagPolicy", "iam:GetPolicy", "iam:ListAttachedRolePolicies", "iam:ListEntitiesForPolicy" ], "Resource":[ "arn:aws:iam::*:role/idt-*", "arn:aws:iam::*:policy/idt-*" ] } ] }
      注意

      如果您想要使用自訂 IAM 角色做為待測裝置的權杖交換角色,請務必更新政策中的 roleAliasResources 陳述式和 passRoleForResources陳述式,以允許自訂 IAM 角色資源。

    4. 選擇檢閱政策

    5. 對於名稱,輸入 IDTGreengrassIAMPermissions。在 Summary (摘要) 下,檢閱您的政策所授與的許可。

    6. 選擇 建立政策

  3. 建立 IAM 使用者並連接 IDT for 所需的許可 AWS IoT Greengrass。

    1. 建立 IAM 使用者。請遵循 IAM 使用者指南中的建立 IAM 使用者 (主控台) 中的步驟 1 到 5。

    2. 將許可連接至您的 IAM 使用者:

      1. Set permissions (設定許可) 頁面上,選擇 Attach existing policies directly (直接連接現有的政策)

      2. 搜尋您在上一個步驟中建立的 IDTGreengrassIAMPermissions 政策。選取核取方塊。

    3. 選擇下一步:標籤

    4. 選擇 Next: Review (下一步:檢閱) 以檢視選擇的摘要。

    5. 選擇 Create user (建立使用者)。

    6. 若要檢視使用者的存取金鑰 (存取金鑰 ID 和私密存取金鑰),請選擇密碼和存取金鑰旁的 Show (顯示)。若要儲存存取金鑰,請選擇 Download.csv,並將檔案儲存到安全的位置。您稍後會使用此資訊來設定登入 AWS 資料檔案。

  4. 下一步:設定您的實體裝置

  1. 如果 AWS CLI 尚未安裝,請在電腦上安裝和設定 。請遵循 AWS Command Line Interface 使用者指南中的安裝 AWS CLI 中的步驟。

    注意

    AWS CLI 是開放原始碼工具,可用來與 AWS 來自命令列 shell 的服務互動。

  2. 建立客戶受管政策,以授予管理 IDT 和 AWS IoT Greengrass 角色的許可。

    1. 如果您不是使用 PreInstalled,請開啟文字編輯器,並將下列政策內容儲存在 JSON 檔案中。如果您使用的是 PreInstalled,請繼續下列步驟。

      { "Version":"2012-10-17", "Statement":[ { "Sid":"passRoleForResources", "Effect":"Allow", "Action":"iam:PassRole", "Resource":"arn:aws:iam::*:role/idt-*", "Condition":{ "StringEquals":{ "iam:PassedToService":[ "iot.amazonaws.com", "lambda.amazonaws.com", "greengrass.amazonaws.com" ] } } }, { "Sid":"lambdaResources", "Effect":"Allow", "Action":[ "lambda:CreateFunction", "lambda:PublishVersion", "lambda:DeleteFunction", "lambda:GetFunction" ], "Resource":[ "arn:aws:lambda:*:*:function:idt-*" ] }, { "Sid":"iotResources", "Effect":"Allow", "Action":[ "iot:CreateThing", "iot:DeleteThing", "iot:DescribeThing", "iot:CreateThingGroup", "iot:DeleteThingGroup", "iot:DescribeThingGroup", "iot:AddThingToThingGroup", "iot:RemoveThingFromThingGroup", "iot:AttachThingPrincipal", "iot:DetachThingPrincipal", "iot:UpdateCertificate", "iot:DeleteCertificate", "iot:CreatePolicy", "iot:AttachPolicy", "iot:DetachPolicy", "iot:DeletePolicy", "iot:GetPolicy", "iot:Publish", "iot:TagResource", "iot:ListThingPrincipals", "iot:ListAttachedPolicies", "iot:ListTargetsForPolicy", "iot:ListThingGroupsForThing", "iot:ListThingsInThingGroup", "iot:CreateJob", "iot:DescribeJob", "iot:DescribeJobExecution", "iot:CancelJob" ], "Resource":[ "arn:aws:iot:*:*:thing/idt-*", "arn:aws:iot:*:*:thinggroup/idt-*", "arn:aws:iot:*:*:policy/idt-*", "arn:aws:iot:*:*:cert/*", "arn:aws:iot:*:*:topic/idt-*", "arn:aws:iot:*:*:job/*" ] }, { "Sid":"s3Resources", "Effect":"Allow", "Action":[ "s3:GetObject", "s3:PutObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:CreateBucket", "s3:ListBucket", "s3:ListBucketVersions", "s3:DeleteBucket", "s3:PutObjectTagging", "s3:PutBucketTagging" ], "Resource":"arn:aws:s3::*:idt-*" }, { "Sid":"roleAliasResources", "Effect":"Allow", "Action":[ "iot:CreateRoleAlias", "iot:DescribeRoleAlias", "iot:DeleteRoleAlias", "iot:TagResource", "iam:GetRole" ], "Resource":[ "arn:aws:iot:*:*:rolealias/idt-*", "arn:aws:iam::*:role/idt-*" ] }, { "Sid":"idtExecuteAndCollectMetrics", "Effect":"Allow", "Action":[ "iot-device-tester:SendMetrics", "iot-device-tester:SupportedVersion", "iot-device-tester:LatestIdt", "iot-device-tester:CheckVersion", "iot-device-tester:DownloadTestSuite" ], "Resource":"*" }, { "Sid":"genericResources", "Effect":"Allow", "Action":[ "greengrass:*", "iot:GetThingShadow", "iot:UpdateThingShadow", "iot:ListThings", "iot:DescribeEndpoint", "iot:CreateKeysAndCertificate" ], "Resource":"*" }, { "Sid":"iamResourcesUpdate", "Effect":"Allow", "Action":[ "iam:CreateRole", "iam:DeleteRole", "iam:CreatePolicy", "iam:DeletePolicy", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:TagRole", "iam:TagPolicy", "iam:GetPolicy", "iam:ListAttachedRolePolicies", "iam:ListEntitiesForPolicy" ], "Resource":[ "arn:aws:iam::*:role/idt-*", "arn:aws:iam::*:policy/idt-*" ] } ] }
    2. 如果您使用的是 PreInstalled,請開啟文字編輯器,並將下列政策內容儲存在 JSON 檔案中。請確定您:

      • 取代測試中裝置 (DUT) 在 Greengrass 安裝期間建立的iotResources陳述式中的 thingNamethingGroup,以新增許可。

      • roleAliasResources陳述式和passRoleForResources陳述式中的 passRoleroleAlias 取代為 DUT 上 Greengrass 安裝期間建立的角色。

      { "Version":"2012-10-17", "Statement":[ { "Sid":"passRoleForResources", "Effect":"Allow", "Action":"iam:PassRole", "Resource":"arn:aws:iam::*:role/passRole", "Condition":{ "StringEquals":{ "iam:PassedToService":[ "iot.amazonaws.com", "lambda.amazonaws.com", "greengrass.amazonaws.com" ] } } }, { "Sid":"lambdaResources", "Effect":"Allow", "Action":[ "lambda:CreateFunction", "lambda:PublishVersion", "lambda:DeleteFunction", "lambda:GetFunction" ], "Resource":[ "arn:aws:lambda:*:*:function:idt-*" ] }, { "Sid":"iotResources", "Effect":"Allow", "Action":[ "iot:CreateThing", "iot:DeleteThing", "iot:DescribeThing", "iot:CreateThingGroup", "iot:DeleteThingGroup", "iot:DescribeThingGroup", "iot:AddThingToThingGroup", "iot:RemoveThingFromThingGroup", "iot:AttachThingPrincipal", "iot:DetachThingPrincipal", "iot:UpdateCertificate", "iot:DeleteCertificate", "iot:CreatePolicy", "iot:AttachPolicy", "iot:DetachPolicy", "iot:DeletePolicy", "iot:GetPolicy", "iot:Publish", "iot:TagResource", "iot:ListThingPrincipals", "iot:ListAttachedPolicies", "iot:ListTargetsForPolicy", "iot:ListThingGroupsForThing", "iot:ListThingsInThingGroup", "iot:CreateJob", "iot:DescribeJob", "iot:DescribeJobExecution", "iot:CancelJob" ], "Resource":[ "arn:aws:iot:*:*:thing/thingName", "arn:aws:iot:*:*:thinggroup/thingGroup", "arn:aws:iot:*:*:policy/idt-*", "arn:aws:iot:*:*:cert/*", "arn:aws:iot:*:*:topic/idt-*", "arn:aws:iot:*:*:job/*" ] }, { "Sid":"s3Resources", "Effect":"Allow", "Action":[ "s3:GetObject", "s3:PutObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:CreateBucket", "s3:ListBucket", "s3:ListBucketVersions", "s3:DeleteBucket", "s3:PutObjectTagging", "s3:PutBucketTagging" ], "Resource":"arn:aws:s3::*:idt-*" }, { "Sid":"roleAliasResources", "Effect":"Allow", "Action":[ "iot:CreateRoleAlias", "iot:DescribeRoleAlias", "iot:DeleteRoleAlias", "iot:TagResource", "iam:GetRole" ], "Resource":[ "arn:aws:iot:*:*:rolealias/roleAlias", "arn:aws:iam::*:role/idt-*" ] }, { "Sid":"idtExecuteAndCollectMetrics", "Effect":"Allow", "Action":[ "iot-device-tester:SendMetrics", "iot-device-tester:SupportedVersion", "iot-device-tester:LatestIdt", "iot-device-tester:CheckVersion", "iot-device-tester:DownloadTestSuite" ], "Resource":"*" }, { "Sid":"genericResources", "Effect":"Allow", "Action":[ "greengrass:*", "iot:GetThingShadow", "iot:UpdateThingShadow", "iot:ListThings", "iot:DescribeEndpoint", "iot:CreateKeysAndCertificate" ], "Resource":"*" }, { "Sid":"iamResourcesUpdate", "Effect":"Allow", "Action":[ "iam:CreateRole", "iam:DeleteRole", "iam:CreatePolicy", "iam:DeletePolicy", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:TagRole", "iam:TagPolicy", "iam:GetPolicy", "iam:ListAttachedRolePolicies", "iam:ListEntitiesForPolicy" ], "Resource":[ "arn:aws:iam::*:role/idt-*", "arn:aws:iam::*:policy/idt-*" ] } ] }
      注意

      如果您想要使用自訂 IAM 角色做為待測裝置的權杖交換角色,請務必更新政策中的 roleAliasResources 陳述式和 passRoleForResources陳述式,以允許自訂 IAM 角色資源。

    3. 執行下列命令來建立名為 的客戶受管政策IDTGreengrassIAMPermissionspolicy.json 將 取代為您在上一個步驟中建立的 JSON 檔案的完整路徑。

      aws iam create-policy --policy-name IDTGreengrassIAMPermissions --policy-document file://policy.json
  3. 建立 IAM 使用者並連接 IDT for 所需的許可 AWS IoT Greengrass。

    1. 建立 IAM 使用者。在此範例設定中,使用者命名為 IDTGreengrassUser

      aws iam create-user --user-name IDTGreengrassUser
    2. 將您在步驟 2 中建立IDTGreengrassIAMPermissions的政策連接到您的 IAM 使用者。將 命令中的 <account-id> 取代為 的 ID AWS 帳戶。

      aws iam attach-user-policy --user-name IDTGreengrassUser --policy-arn arn:aws:iam::<account-id>:policy/IDTGreengrassIAMPermissions
  4. 為使用者建立私密存取金鑰。

    aws iam create-access-key --user-name IDTGreengrassUser

    將輸出儲存在安全的位置。您稍後會使用此資訊來設定登入 AWS 資料檔案。

  5. 下一步:設定您的實體裝置

AWS IoT Device Tester 許可

下列政策說明 AWS IoT Device Tester 許可。

AWS IoT Device Tester 需要這些許可才能檢查版本和自動更新功能。

  • iot-device-tester:SupportedVersion

    AWS IoT Device Tester 准許擷取支援的產品、測試套件和 IDT 版本清單。

  • iot-device-tester:LatestIdt

    AWS IoT Device Tester 准許擷取可供下載的最新 IDT 版本。

  • iot-device-tester:CheckVersion

    AWS IoT Device Tester 准許檢查 IDT、測試套件和產品的版本相容性。

  • iot-device-tester:DownloadTestSuite

    AWS IoT Device Tester 准許下載測試套件更新。

AWS IoT Device Tester 也會針對選用指標報告使用下列許可:

  • iot-device-tester:SendMetrics

    准許 AWS 收集有關 AWS IoT Device Tester 內部使用的指標。如果省略此許可,則不會收集這些指標。