amazon-web-services - AWS IoT 核心:批量注册失败
问题描述
我试图找出在 AWS IoT Core 中批量注册 IoT 设备的可能性,这使我找到了这些指南: 指南 1、指南 2
我已经到了需要运行aws iot start-thing-registration-task
命令的步骤,但出现错误:
'inputFileKey' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9!_.*'()-\/]+
起初,我尝试按照指南删除 csr 的开始行和结束行,并使其以换行符分隔,但我得到了同样的错误。然后,我尝试使用研讨会中的“mk-bulk.sh”并使用该 json 文件,该文件给出了相同的错误以及一个错误,指出该文件超出了 AWS CLI 函数的 1024 字节限制。这些指南来自 2018 年,所以情况可能有所改变,但它们是我能找到的最新的。非常感谢任何帮助,如果您希望我提供我的单行 json,请告诉我。
我正在使用的 CLI 通过 python 子进程运行,如下所示:
subprocess.call("aws iot start-thing-registration-task --template-body file://C:/Users/user/awsbulkregistration/provisioning-template.json --input-file-bucket S3Bucket --input-file-key file://%s --role-arn arn:aws:iam::ACCOUNT_ID:role/S3Bucket" % BUCKET_FILE)
BUCKET_FILE 为:C:/Users/user/awsbulkregistration/s3bucket1.json
我得到的完整错误是:
An error occurred (InvalidRequestException) when calling the StartThingRegistrationTask operation: 1 validation error detected: Value
'{
"ThingName": "Device1",
"SerialNumber": "1",
"CSR": "[redacted]"
}' at 'inputFileKey' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9!_.*'()-\/]+
解决方案
好的,因此该文件需要位于 s3 存储桶中才能正常工作。我的错
推荐阅读
- julia - Julia中浮点运算的速度
- python - 给定一个纯文本和一个可能的密文,确定密文是否可以使用上述方案从纯文本形成
- node.js - 我们可以在电子 js 上禁用键盘输入吗
- python - 有没有办法根据键盘输入改变玩家面对的方向?Pyglet, Cocos2d
- c++ - 如何使用 g++ 在 c++ 20 中使用模块?
- sql - 加入日期到日期范围 SQL
- firebase - 每次打开应用程序时都会触发 Flutter Dynamic Link
- javascript - 防止弹出窗口冒泡
- elasticsearch - Vue Sstorefront 上的 Elasticsearch 查询
- powershell - PowerShell:在几个文本文件的每 50 个单词后添加一个新的空行