- Create a new Lambda function, using the blueprint 'alexa-skill-kit-sdk-factskill'
- Choose the trigger as "Alexa Skills Kit"
- Give the function a name
- Copy/paste the code from index.js in the code window
- Under the Lambda function handler and role section, click on the Role dropdown, and choose 'Create new role from template(s)'.
- Give the Role a name, say - alexa-lambda-with-dynamodb
- From the Policy templates, select Simple Microservice permissions.
- From the AWS console, click on IAM
- Click on Roles
- Locate and click on the role you use with your Lambda functions, such as lambda_basic_execution
- Click the "Attach Policy" button
- For a quick demo, filter on "DynamoDB" and attach the AmazonDynamoDBFullAccess policy (For a production scenario, choose a more fine-grained policy granting access to certain resources).
alexa.dynamoDBTableName = 'lastHaircut';
this.emit(':tellWithCard', outputSpeech,"Last Haircut",outputSpeech);
this.emit(':saveState', true);