I'm using node-aws-lambda to deploy a lambda function directly using gulp and node.js. The function itself is being deployed properly. However, the trigger I try to configure is using an Amazon Alexa Smart Home Skill ARN. The validation complains that this ARN is not allowed.
This is my config (access and policies are fine):
module.exports = {
accessKeyId: 'AAAAAAAAAAAAAAAAAAA', // User:
secretAccessKey: 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB', // optional
region: 'eu-west-1',
handler: 'index.handler',
role: 'arn:aws:iam::1234567890:role/SmartHomeSkillRole', // KNXSmartHomeSkillRole
functionName: 'SmartHomeSkill_Remote',
timeout: 10,
memorySize: 128,
publish: true,
runtime: 'nodejs4.3',
description: 'A remotely build skill for alexa',
eventSource: {
EventSourceArn: 'amzn1.ask.skill.d9d9f7b1-f7d6-4050-a3d1-753e47e7038a',
BatchSize: 200,
StartingPosition: "TRIM_HORIZON"
}
}
The value in EventSourceArn is being the failure's source (amzn1.ask.skill is not valid, while putting the trigger in manually in the console works well):
ValidationException: 1 validation error detected: Value 'amzn1.ask.skill.d9d9f7b1-f7d6-4050-a3d1-753e47e7038a' at 'eventSourceArn' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:(aws|aws-us-gov):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)
at Object.extractError (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\protocol\json.js:48:27)
at Request.extractError (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\protocol\rest_json.js:37:8)
at Request.callListeners (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\sequential_executor.js:105:20)
at Request.emit (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\sequential_executor.js:77:10)
at Request.emit (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\request.js:682:14)
at Request.transition (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\request.js:22:10)
at AcceptorStateMachine.runTo (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\state_machine.js:14:12)
at E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\state_machine.js:26:10
at Request.<anonymous> (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\request.js:38:9)
at Request.<anonymous> (E:\DropBox\p\jisageek\IoT\AlexaKNX\node_modules\aws-sdk\lib\request.js:684:12)
Is that an error in the sdk or do I have to configure the trigger manually or is there another way to create a trigger programmatically?
Any advice is appreciated. Thanks!
joerg