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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠