Reputation: 69339
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? I.e. the thing has name "foo"
and attribute "id=foo"
.
From the limited documentation, I'm assuming I do something like:
RegisterCertificate
)ListThings
, filtered by attribute)AttachThingPrincipal
?)Somehow find the old certificate (is there no better way than ListCertificates
and paging)??
Update the old certificate to be INACTIVE (UpdateCertificate
)
Can anyone confirm the correct, most succinct way to do this?
Upvotes: 2
Views: 906
Reputation: 69339
I welcome better solutions, but this worked for me:
RegisterThing
again (same ThingName, same policy, different cert). This seems to attach a new certificate to my thing.ListThingPrincipals
, filtering on 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>
.DescribeCertificate
, with the certificate id as parameter.UpdateCertificate
and mark that certificate as INACTIVE
.Upvotes: 3