Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Clone a repo #8

Open
codeputer opened this issue May 7, 2017 · 0 comments
Open

Clone a repo #8

codeputer opened this issue May 7, 2017 · 0 comments

Comments

@codeputer
Copy link

codeputer commented May 7, 2017

I'm new to GitHub/Python/AWS - what follows is my experience with this example - and I would not hesitate to call the whole experience an "issue":

Where should I start with the problems that I have with this example...

My biggest complaint is the level of detail in regard to in installation requirements, and what should be expected after each command is executed. I'm new to the LAMP stack, and this example didn't make it easy on me to appreciate that environment.

As I'm not experienced enough in this environment to know what I did wrong, the short story is that this example as it is, simply did not work, and is mis-leading in a couple of places. Examples:

  • The Twilio credentials in the code are not required. In fact, there is nothing in the code that is required for Twilio to work. Twilio itself must be configured to send the GET/POST to the API Gateway (not the lambda).

  • The mapping in the Integration and Response is CRITICAL to get this example to work - love is in the details. If you look at the graphic, Twilio creates webhooks (POST or GET!) that are URL encoded. Why they would create a URL encoded POST is beyond my capabilities to understand.

AWS Lambda will ONLY accept a JSON payload, and will ONLY return a JSON payload. Its' API Gateway responsibility to convert any request into a JSON payload, and return the response in the format that is required. That is what the mappings within API Gateway are for, and hence handle the request and response from Lambda in the format that is required by the caller.

The Bash script jumps up and down a directory tree in order to zip the entire application (code plus all the libraries). I may have created the directories in the wrong spot, but I did it wrong, and the script fails. The Python files (lambda-function) are never included in the ZIP file. As the Lambda expression invokes this function, having the file missing out of the zip file causes a problem.. Assuming that the ZIP file contains the main purpose of the application - is a dangerous and very time consuming assumption.

Transferring files to AWS is another critical aspect that is generally glossed over - and is just a little more complicated than the cut and paste of a directory from a remote machine via Windows RDP. Be warned Windows Users that this wonderful means of transferring files via a CLI is very different, and will likely cause you many hours of therapy.

Then comes the round trip of working with his example at an application level - alter the code, transfer to Linux (would you really edit on a Linux machine?), zip the code, transfer the file zip back, upload to S3 (file is to big to transfer directly to Lambda - and yes this is an example app), transfer to Lambda, execute request, view results in Cloud Formation - AND repeat!

Yup the cost of Linux server is free - but so is the assumption that your time is free as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant