question

Amazon Customer avatar image
Amazon Customer asked

link the lighting api with lambda function

Hi, By following the lighting api instructions, created my lambda function and also added permission to the lambda function from aws CLI. But looks like the lambda function is never being called and also I found there is an "Add Event Source" feature in the configuration of the lambda function, by choosing "Alexa Connected Home(preview) as " as the event source type, it give me the following error code : "There was an error creating the event source mapping: Service error." Any idea about the event source for the lambda function and also is there a way to verify the link between lambda function and lighting api? Thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

memo@amazon avatar image
memo@amazon answered
Hello, The event source option is a new feature, it's not required. If you granted the access from CLI then the event source will throw the error you described. There are two ways to get around this. 1. Keep it the way it is, the CLI granted permission should work. 2. Remove CLI granted permissions, and then use the event source Here are the two CLI commands to remove permissions (run both): [code] aws lambda remove-permission \ --function-name arn:aws:lambda:us-east-1:000000000000:function:myFunction \ --statement-id 1 \ --action lambda:invokeFunction \ --principal arn:aws:iam::185440857803:user/LambdaExecutionUser \ aws lambda remove-permission \ --function-name arn:aws:lambda:us-east-1:000000000000:function:myFunction \ --statement-id 2 \ --action lambda:invokeFunction \ --principal arn:aws:iam:: 882658230287:user/LambdaExecutionUser [/code]
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.