Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of date information on how to access function through API #96

Open
ZooeyMiller opened this issue Jul 11, 2017 · 6 comments
Open

Out of date information on how to access function through API #96

ZooeyMiller opened this issue Jul 11, 2017 · 6 comments
Assignees

Comments

@ZooeyMiller
Copy link

The tutorial's section about accessing a Lambda function through an API gateway is out of date. This needs updating.

Right now @finnhodgkin and I are researching how to actually do this (which is what the current time estimate is for), and once we have worked that out and finished running through the tutorial we will work on updating the tutorial (for which we'll add another time estimate).

Possibly relates to #62

@finnhodgkin
Copy link
Contributor

@ZooeyMiller
Copy link
Author

Using the link @finnhodgkin has posted above I have gotten the lambda function running through and API without an API key. Now trying to get it working with an API key. Proving complicated.

@ZooeyMiller
Copy link
Author

Got this working! Will write the basic process here and then when we are done going through the tutorial we will start working on a PR to fix the stuff we've found.

process is as follows:

  1. make a lamba function (done in prev steps)
  2. on that function go to "triggers"
  3. Make an API Gateway trigger
  4. It will be created with "any" method
  5. Delete any by selecting it, clicking "actions" and then "delete method"
  6. create a post method (actions -> create method -> post)
  7. click on it
  8. click "method request"
  9. change "api key required" to true
  10. click on "stages" on the left
  11. click "create"
  12. make a stage with a name of your choice
  13. go to "usage plans"
  14. create -> add a name -> you can turn off throttling and rate limiting for the test one if you like
  15. click next
  16. add api stage -> choose yr api from dropdown -> choose the stage u just made from the next dropdown -> click rge tick -> next
  17. create api key + add to usage plan -> give itt a name, let it auto generate -> done
  18. on the left go to api keys
  19. click yr api key
  20. click "show" next to api key
  21. take a note of yr key
  22. deploy your api (apis -> your api -> actions -> deploy)
  23. copy the invoke url and add your endpoint to the end of it.
  24. paste this into postman (or similar)
  25. set "body" to a json of whatever yr function is expecting
  26. go to headers and add a header called "x-api-key" with a value of the api key that you noted down earlier.
  27. send the post request
  28. see the result of your function

@ZooeyMiller ZooeyMiller removed the T1h label Jul 11, 2017
@ZooeyMiller
Copy link
Author

Time estimate of 1hr was too short. still needs to be written up to be put into the readme though.

@nelsonic
Copy link
Member

@ZooeyMiller yeah, T1h was unlikely, please add a revised estimate label for the time you expect to spend as per: dwyl/contributing#revising-a-time-estimate 👍

@ZooeyMiller
Copy link
Author

@nelsonic the initial research has now been completed (in around 2 hours) and I imagine the actual update to the readme as it relates directly to this issue will be between 1 and 2 hours so have added a t4h label to encapsulate this total.

@finnhodgkin finnhodgkin removed the T4h label Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants