[英]How to update a thing certificate in AWS IoT?
How do I update the certificate of an existing Thing in AWS IoT, assuming I know the thing name and an attribute with the same value? 如何更新AWS IoT中现有Thing的证书,假设我知道事物名称和具有相同值的属性? Ie the thing has name
"foo"
and attribute "id=foo"
. 即事物的名称为
"foo"
,属性为"id=foo"
。
From the limited documentation, I'm assuming I do something like: 从有限的文档中,我假设我做了类似的事情:
RegisterCertificate
) RegisterCertificate
) ListThings
, filtered by attribute) ListThings
,按属性过滤) AttachThingPrincipal
?) AttachThingPrincipal
?) Somehow find the old certificate (is there no better way than ListCertificates
and paging)?? 不知何故找到旧证书(没有比
ListCertificates
和分页更好的方法)?
Update the old certificate to be INACTIVE ( UpdateCertificate
) 将旧证书更新为非活动(
UpdateCertificate
)
Can anyone confirm the correct, most succinct way to do this? 任何人都可以确认正确,最简洁的方法吗?
I welcome better solutions, but this worked for me: 我欢迎更好的解决方案,但这对我有用:
RegisterThing
again (same ThingName, same policy, different cert). RegisterThing
(相同的ThingName,相同的策略,不同的证书)。 This seems to attach a new certificate to my thing. ListThingPrincipals
, filtering on ThingName. ListThingPrincipals
,过滤ThingName。 The result will be a list of ARNs representing the certificates associated with the thing, of the form arn:aws:iot:<region>:<account id>:cert/<cert id>
. arn:aws:iot:<region>:<account id>:cert/<cert id>
。 DescribeCertificate
, with the certificate id as parameter. DescribeCertificate
,并将证书ID作为参数。 UpdateCertificate
and mark that certificate as INACTIVE
. UpdateCertificate
并将该证书标记为INACTIVE
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.