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

preguntada hace 2 años248 visualizaciones
1 Respuesta
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
EXPERTO
Jan_B
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas