ResourceRegistrationFailureException when calling the RegisterThing operation

0

I'm following the JITP workflow as described in this AWS blog post: Setting Up Just-in-Time Provisioning with AWS IoT Core.https://aws.amazon.com/de/blogs/iot/setting-up-just-in-time-provisioning-with-aws-iot-core/

Steps I've Taken:

  1. Generated the root CA certificate.
  2. Registered the CA certificate in AWS IoT Core.
  3. Created the provisioning template.!

{ "Parameters": { "AWS::IoT::Certificate::Id": { "Type": "String" }, "AWS::IoT::Certificate::Country": { "Type": "String" } }, "Resources": { "thing": { "Type": "AWS::IoT::Thing", "Properties": { "ThingName": { "Ref": "AWS::IoT::Certificate::Id" }, "AttributePayload": { "version": "v1", "country": { "Ref": "AWS::IoT::Certificate::Country" } } } }, "certificate": { "Type": "AWS::IoT::Certificate", "Properties": { "CertificateId": { "Ref": "AWS::IoT::Certificate::Id" }, "Status": "ACTIVE" } }, "policy": { "Type": "AWS::IoT::Policy", "Properties": { "PolicyName": "jitp-policy" } } } }

Enter image description here

Problem: Whenever I try to connect using the device certificate and key, I always get an unsuccessful result.

Observations: In the AWS Console under IoT Core > Certificates, I see the certificate is generated but has a status of pending_activation. In CloudWatch, the error code is ResourceRegistrationFailureException. It appears that the thing is not being registered, nor is the policy being attached.

Question: Does anyone have an idea what I might be doing wrong or missing in my setup? Any advice on how to successfully register the thing and attach the policy would be greatly appreciated.

Thank you!

JG
asked 2 months ago144 views
2 Answers
0

Thank you for your response. I have just seen this type of log:

{ "timestamp": "2024-08-02 14:10:11.895", "logLevel": "ERROR", "traceId": "101690654900000000062769xxxxxx", "accountId": "xxxxxxxxxxxxxx", "status": "Failure", "errorCode": "ResourceRegistrationFailureException" }

There is no error message in the log.

Is there a problem with the template or the attached policy because I have seen that a certificate has been generated in iot->safety->certificate but with the status "pending activation" and no thing is registered nor a policy is attached.

Thank you!

JG
answered 2 months ago
  • Please take a closer look at your jitp-role. Perhaps modify the question to add details about that role.

  • Thanks for your quick support. But I had a problem with template "Parameter" section and therefore I am not able to get a successfull result. But now it works perfectly fine. Thanky you so much again!

  • What was the error? I can't see the issue.

  • I am not very sure about that but when I change the template like this and that works for me: { "Parameters": { "AWS::IoT::Certificate::Id": { "Type": "String" }, "AWS::IoT::Certificate::Country":{ "Type":"String" }, "AWS::IoT::Certificate::CommonName": { "Type": "String" } }, "Resources": { "thing": { "Type": "AWS::IoT::Thing", "Properties": { "ThingName": { "Ref": "AWS::IoT::Certificate::CommonName" }, "AttributePayload": { "version":"v1", "country":{ "Ref": "AWS::IoT::Certificate::Country" } } } }, "certificate": { "Type": "AWS::IoT::Certificate", "Properties": { "CertificateId": { "Ref": "AWS::IoT::Certificate::Id" }, "Status": "ACTIVE" } }, "policy": { "Type": "AWS::IoT::Policy", "Properties": { "PolicyName": "jitp-policy" } } } }

0

In CloudWatch, the error code is ResourceRegistrationFailureException.

Hi. I think the CloudWatch log entry should have an error message in addition to this error code. If so, this should give a clue.

profile pictureAWS
EXPERT
Greg_B
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions