AWS IoT 核心:批量注册失败

AWS IoT core: Bulk registration failure

我正在尝试找出在 AWS IoT Core 中批量注册 IoT 设备的可能性,这让我找到了这些指南: Guide 1, Guide 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 存储桶中才能工作。我的坏