2 Answers
- Newest
- Most votes
- Most comments
1
I think the IAM role of your pre-provisioning hook Lambda may be missing a permission. IoT needs permission to invoke the function.
Some good information here in this workshop: https://iot-device-management.workshop.aws/en/provisioning-options/fleet-provisioning.html#optional-pre-provisioning-hook
At this step:
aws lambda add-permission --statement-id $(date '+%Y%m%d%H%M%S') \
--principal iot.amazonaws.com \
--action lambda:InvokeFunction \
--function-name [YOUR_LAMBDA_FUNCTION_NAME]
0
this is for serverless
functions:
preprovisioning:
name: preprovisioning
handler: functions/preprovisioning.lambda_handler
timeout: 100
resources:
Resources:
PermissionToCallHookLambda:
Type: "AWS::Lambda::Permission"
Properties:
Action: lambda:InvokeFunction
FunctionName: preprovisioning
Principal: "iot.amazonaws.com"
answered 3 years ago
Relevant content
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 9 months ago
I added that permission in the lambda execution role instead