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

gefragt vor 2 Jahren248 Aufrufe
1 Antwort
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
EXPERTE
Jan_B
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen