Figure 10-14. Status of createLambdaForAlexa
9.
In the AWS Lambda console, “WiFi-Smart-Device-Kit-Custom-Skill” and “WiFi-Smart-Device-Kit-
Smart-Home-Skill” are created. Go to AWS Lambda console, edit “WiFi-Smart-Device-Kit-Custom-
Skill”. In “Function code”, edit
index.js
to input the AWS IoT Endpoint and the Region. The AWS
IoT Endpoint can be found from the Settings page of AWS IoT console.
Figure 10-15. AWS Lambda Console
10.3
Create Amazon Cognito for Alexa
1.
Edit the
\cloud-formation-templates\ createCognito.template.yaml
file. Add
“CallbackURL” of “Wi-Fi Smart Device For Alexa Smart Home Skill” Cognito User Pool App Client
from
7.1 Microchip Wi-Fi Smart Device Smart Home Skill Setup
WiFISmartDeviceForAlexaSmartHomeSkillClientSettings:
Type: 'Custom::CognitoUserPoolClientSettings'
Properties:
ServiceToken: !GetAtt CloudFormationCognitoUserPoolClientSettings.Arn
UserPoolId: !Ref UserPool
UserPoolClientId: !Ref WiFISmartDeviceForAlexaSmartHomeSkillClient
SupportedIdentityProviders:
- COGNITO
CallbackURL: 'https://layla.amazon.com/api/skill/link/M2TDOWMJ3J2LNM,https://
alexa.amazon.co.jp/api/skill/link/M2TDOWMJ3J2LNM,https://pitangui.amazon.com/api/skill/
link/M2TDOWMJ3J2LN'
LogoutURL: 'https://www.google.com'
AllowedOAuthFlowsUserPoolClient: true
AllowedOAuthFlows:
2.
Add “CallbackURL” of “Wi-Fi Smart Device For Alexa Custom Skill” App Client from
Wi-Fi Sensor Board Skill Setup
WiFISmartDeviceForAlexaCustomSkillClientSettings:
Type: 'Custom::CognitoUserPoolClientSettings'
Properties:
ServiceToken: !GetAtt CloudFormationCognitoUserPoolClientSettings.Arn
UserPoolId: !Ref UserPool
UserPoolClientId: !Ref WiFISmartDeviceForAlexaCustomSkillClient
SupportedIdentityProviders:
- COGNITO
CallbackURL: 'https://layla.amazon.com/api/skill/link/M2TDOWMJ3J2LNM,https://
alexa.amazon.co.jp/api/skill/link/M2TDOWMJ3J2LNM,https://pitangui.amazon.com/api/skill/
link/M2TDOWMJ3J2LN'
LogoutURL: 'https://www.google.com'
ATWINC15x0 Smart Device Kit
Appendix C: AWS CloudFormation to Setup Cl...
©
2019 Microchip Technology Inc.
User Guide
DS50002885A-page 83