Can lambda function return additional custom information/message when "allowProvisioning" : "false"?

0

If the Lambda function doesn't return "allowProvisioning" : "true" in the response, the provisioning request fails with ACCESS_DENIED. Is it possible to add additional custom information for the user when "allowProvisioning" : "false" in the response ? e.g. information why provisionig failed

已提问 2 年前248 查看次数
1 回答
0

Great feedback but currently this is not possible as documented here

Depending on your use case, you could use the following approach:

  1. Create a provisioning template where the IoT policy can be passed as a parameter and reference this policy name parameter in PolicyName
  2. If the pre-provision hook lambda denies provisioning, return "allowProvisioning" : "true" but pass a policy name in the parameterOverrides section that denies connectivity to AWS IoT. The Thing and certs will be created but the attached policy will deny any connection attempt.
  3. Use the DeviceConfiguration section of the template to return info about the reason why the provisioning failed.

Hope that helps and if my answer was useful, please consider up-voting or accepting my answer. Thx!

profile pictureAWS
专家
Jan_B
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则