alexa-samples / skill-sample-python-smarthome-sandbox

This is Alexa skill sample code for showing how several areas of a Smart Home model come together to define and provide endpoint devices using Lambda, IoT Core, DynamoDB, and API Gateway services.
Other
26 stars 30 forks source link

CloudFormation template & s3 codes not up to day #14

Open littlehi opened 5 years ago

littlehi commented 5 years ago

Hi,

I have deployed this sample, I received a 502 Error from APIGateway, when using POSTMAN to create an endpoint.

The root cause of this error is CloudFormation template ( https://s3.amazonaws.com/endpoint-code-us/backend.template) and lambda code packages that store on s3 not updated to the latest version.

Flow the below steps to slove this issue: 1.package the source code skill-sample-python-smarthome-sandbox/lambda/api/ to endpoint-package.zip

2.package the source code skill-sample-python-smarthome-sandbox/lambda/smarthome to skill-package.zip

3.upload these packages to your s3 bucket

4.update the CloudFormation template file SkillLambda and EndpointLambda resource to your new s3 bucket .

5.upload your CloudFormation template to your s3 bucket.

6.Using your new cloudforamtion template to deploy.

kramgam commented 3 years ago

If anyone is still trying to figure this out after running through the manual steps amazon has provided. follow what @littlehi says. it worked for me. As a quicker solution without having to edit the CloudFormation template, do the following:

  1. follow @littlehi step 1 and 2. then go to the lambda functions and delete the files and folders then click on "Actions" >> Upload a .zip file. Upload the endpoint-package.zip to the "SampleEnpointAdapter". Then go to the "SampleSkillAdapter" lambda function and upload the skill-package.zip to it the same way (deleting existing files/folders first)
  2. CLICK DEPLOY - I cant believe I missed this :(
  3. go back to Postman and send.
  4. You should be good to go!

Thank you @littlehi !!!!