Before you use Device Advisor for the first time, complete the following tasks:
Create an IoT thingFirst, create an IoT thing and attach a certificate to that thing. For a tutorial on how to create things, see Create a thing object.
Create an IAM role to use as your device roleGo to the AWS Identity and Access Management console and log in to the AWS account you use for Device Advisor testing.
In the left navigation pane, chose Policies.
Choose Create policy.
Under Create policy, do the following:
For Service, choose IoT.
Under Actions, do one of the following:
(Recommended) Select actions based on the policy attached to the IoT thing or certificate you created in the previous section.
Search for the following actions in the Filter action box and select them:
Connect
Publish
Subscribe
Receive
RetainPublish
Under Resources, restrict the client, topic, and topic resources. Restricting these resources is a security best practice. To restrict resources, do the following:
Choose Specify client resource ARN for the Connect action.
Choose Add ARN, then do either of the following:
NoteThe clientId is the MQTT client ID that your device uses to interact with Device Advisor.
Specify the Region, accountID, and clientID in the visual ARN editor.
Manually enter the Amazon Resource Names (ARNs) of the IoT topics you want to run your test cases with.
Choose Add.
Choose Specify topic resource ARN for the Receive and one more action.
Choose Add ARN, then do either of the following:
NoteThe topic name is the MQTT topic that your device publishes messages to.
Specify the Region, accountID, and Topic name in the visual ARN editor.
Manually enter the ARNs of the IoT topics you want to run your test cases with.
Choose Add.
Choose Specify topicFilter resource ARN for the Subscribe action.
Choose Add ARN, then do either of the following:
NoteThe topic name is the MQTT topic that your device subscribes to.
Specify the Region, accountID, and Topic name in the visual ARN editor.
Manually enter the ARNs of the IoT topics you want to run your test cases with.
Choose Add.
Choose Next: Tags.
Choose Next: Review.
Under Review policy, enter a Name for your policy.
Choose Create policy.
On the left navigation pane, Choose Roles.
Choose Create Role.
Under Select trusted entity, choose Custom trust policy.
Enter the following trust policy into the Custom trust policy box. To protect against the confused deputy problem, add the global condition context keys aws:SourceArn
and aws:SourceAccount
to the policy.
Your aws:SourceArn
must comply with the format: arn:aws:iotdeviceadvisor:
Make sure that region:account-id
:*.
matches your AWS IoT Region and region
matches your customer account ID. For more information, see Cross-service confused deputy prevention.account-id
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAwsIoTCoreDeviceAdvisor",
"Effect": "Allow",
"Principal": {
"Service": "iotdeviceadvisor.amazonaws.com"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"aws:SourceAccount": "111122223333"
},
"ArnLike": {
"aws:SourceArn": "arn:aws:iotdeviceadvisor:*:111122223333
:suitedefinition/*"
}
}
}
]
}
Choose Next.
Choose the policy you created in Step 4.
(Optional) Under Set permissions boundary, choose Use a permissions boundary to control the maximum role permissions, and then select the policy you created.
Choose Next.
Enter a Role name and a Role description.
Choose Create role.
Navigate to the IAM console at https://console.aws.amazon.com/iam/. If prompted, enter your AWS credentials to sign in.
In the left navigation pane, choose Policies.
Choose Create Policy, then choose the JSON tab.
Add the necessary permissions to use Device Advisor. The policy document can be found in the topic Security best practices.
Choose Review Policy.
Enter a Name and Description.
Choose Create Policy.
We recommend that you create an IAM user to use when you run Device Advisor tests. Running Device Advisor tests from an admin user can pose security risks and isn't recommended.
Navigate to the IAM console at https://console.aws.amazon.com/iam/ If prompted, enter your AWS credentials to sign in.
In the left navigation pane, Choose Users.
Choose Add User.
Enter a User name.
Users need programmatic access if they want to interact with AWS outside of the AWS Management Console. The way to grant programmatic access depends on the type of user that's accessing AWS.
To grant users programmatic access, choose one of the following options.
Which user needs programmatic access? To ByWorkforce identity
(Users managed in IAM Identity Center)
Use temporary credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs.Following the instructions for the interface that you want to use.
For the AWS CLI, see Configuring the AWS CLI to use AWS IAM Identity Center in the AWS Command Line Interface User Guide.
For AWS SDKs, tools, and AWS APIs, see IAM Identity Center authentication in the AWS SDKs and Tools Reference Guide.
(Not recommended)
Use long-term credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs.Following the instructions for the interface that you want to use.
For the AWS CLI, see Authenticating using IAM user credentials in the AWS Command Line Interface User Guide.
For AWS SDKs and tools, see Authenticate using long-term credentials in the AWS SDKs and Tools Reference Guide.
For AWS APIs, see Managing access keys for IAM users in the IAM User Guide.
Choose Next: Permissions.
To provide access, add permissions to your users, groups, or roles:
Enter the name of the custom-managed policy that you created in the search box. Then, select the check box for Policy name.
Choose Next: Tags.
Choose Next: Review.
Choose Create user.
Choose Close.
Device Advisor requires access to your AWS resources (things, certificates, and endpoints) on your behalf. Your IAM user must have the necessary permissions. Device Advisor will also publish logs to Amazon CloudWatch if you attach the necessary permissions policy to your IAM user.
Configure your deviceDevice Advisor uses the server name indication (SNI) TLS extension to apply TLS configurations. Devices must use this extension when they connect and pass a server name that is identical to the Device Advisor test endpoint.
Device Advisor allows the TLS connection when a test is in the Running
state. It denies the TLS connection before and after each test run. For this reason, we recommend that you use the device connect retry mechanism for a fully automated testing experience with Device Advisor. You can run test suites that include more than one test case, such as TLS connect, MQTT connect, and MQTT publish. If you run multiple test cases, we recommend that your device try to connect to our test endpoint every five seconds. You can then automate running multiple test cases in sequence.
To ready your device software for testing, we recommend that you use an SDK that can connect to AWS IoT Core. You should then update the SDK with the Device Advisor test endpoint provided for your AWS account.
Device Advisor supports two types of endpoints: Account-level and Device-level endpoints. Choose the endpoint that best fits your use case. To simultaneously run multiple test suites for different devices, use a Device-level endpoint.
Run the following command to get the Device-level endpoint:
For MQTT customers using X.509 client certificates:
aws iotdeviceadvisor get-endpoint --thing-arn your-thing-arn
or
aws iotdeviceadvisor get-endpoint --certificate-arn your-certificate-arn
For MQTT over WebSocket customers using Signature Version 4:
aws iotdeviceadvisor get-endpoint --device-role-arn your-device-role-arn
--authentication-method SignatureVersion4
To run one test suite at a time, choose an Account-level endpoint. Run the following command to get the Account-level endpoint:
aws iotdeviceadvisor get-endpoint
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4