← 返回命令列表

Linux command

aws-iot 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all IoT things

aws iot list-things

Create a new thing

aws iot create-thing --thing-name [device_name]

Describe a thing

aws iot describe-thing --thing-name [device_name]

Create keys and certificate

aws iot create-keys-and-certificate --set-as-active --certificate-pem-outfile [cert.pem] --private-key-outfile [private.key]

Attach a policy

aws iot attach-policy --policy-name [policy_name] --target [certificate_arn]

Attach a certificate

aws iot attach-thing-principal --thing-name [device_name] --principal [certificate_arn]

Get the IoT endpoint

aws iot describe-endpoint --endpoint-type iot:Data-ATS

List certificates

aws iot list-certificates

说明

aws iot is a subcommand of the AWS CLI that manages AWS IoT Core, a platform for connecting IoT devices to the cloud. It handles device registry, security, and message routing. Things are representations of physical devices in the registry. Each thing can have attributes, types, and groups for organization. Devices authenticate using X.509 certificates and policies control what actions they can perform. The message broker uses MQTT, HTTPS, and WebSocket protocols. Rules engine processes incoming messages and routes them to AWS services like Lambda, S3, DynamoDB, or other IoT topics.

参数

list-things
List registered things.
create-thing
Register a new thing.
describe-thing
Get thing details.
delete-thing
Remove a thing from registry.
create-keys-and-certificate
Generate a new certificate and key pair.
list-certificates
List certificates in the account.
attach-policy
Attach an IoT policy to a certificate or identity.
detach-policy
Remove a policy attachment.
attach-thing-principal
Associate a certificate with a thing.
describe-endpoint
Get the IoT endpoint for connections.
create-policy
Create an IoT policy document.
list-thing-groups
List thing groups.
create-topic-rule
Create a rule for routing messages.
search-index
Search the thing index.
create-job
Create a remote job for target devices.
list-topic-rules
List topic rules.
--thing-name _name_
Name of the thing.
--certificate-pem-outfile _file_
File to write certificate PEM.
--private-key-outfile _file_
File to write private key.
--policy-name _name_
Name of the IoT policy.
--endpoint-type _type_
Endpoint type (iot:Data-ATS recommended).
--set-as-active
Set a newly created certificate as active.
--target _arn_
Target ARN to attach a policy to (certificate or Cognito identity).

FAQ

What is the aws-iot command used for?

aws iot is a subcommand of the AWS CLI that manages AWS IoT Core, a platform for connecting IoT devices to the cloud. It handles device registry, security, and message routing. Things are representations of physical devices in the registry. Each thing can have attributes, types, and groups for organization. Devices authenticate using X.509 certificates and policies control what actions they can perform. The message broker uses MQTT, HTTPS, and WebSocket protocols. Rules engine processes incoming messages and routes them to AWS services like Lambda, S3, DynamoDB, or other IoT topics.

How do I run a basic aws-iot example?

Run `aws iot list-things` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does list-things do in aws-iot?

List registered things.