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

1 Answer
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
EXPERT
Jan_B
answered 2 years 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