Skip to content

JamesEvans582/Build-an-API-with-lambda-integration-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Build-an-API-with-lambda-integration-tutorial

AWS tutorial

Firstly we will need to go to Lambda then create function.

Screenshot 2023-02-11 at 07 46 40

In function name call it what you like. For me I followed this tutorial off whizlabs so I used theirs. Run time click on the drop down and enter python 3.8

Change the execution role to create a new role with AWS policy templates. Screenshot 2023-02-11 at 07 47 18 Enter your role new with API. Then choose Basic Lambda@edge permissions (for cloudfront trigger)

Then hit create!

screenshot_129

Well done so far. Now we need to create the API. So on the console, go to API gateway, then build. Screenshot 2023-02-11 at 07 51 23

It will then give you an option of the types of API. We'll choose RestAPI, the third option, not the VPC, that's not needed for this tutorial.

So now we need to create the resource. Click actions then create resource.
Screenshot 2023-02-11 at 07 54 12 Type in the resource name, then click create resource.

That's great, we have resource but what action does it take, and how? This is where we create a method. So once again click action. We will put in the name and use a GET method, then click create.

Once you have done these stages, you're nearly there. So lets click on Deploy API

Screenshot 2023-02-11 at 07 59 47

In the deployment stage enter new, then enter the stage name, we're testing, so put testing API, and enter a brief description and deploy.

Final stage we need to invoke the URL and make sure the API is connecting to Lamda. Screenshot 2023-02-11 at 08 02 05

Click the link. Which will take you to a browser. You need to /whizlabsapi to test that it has validated. If it has it should look like the picture below. Screenshot 2023-02-11 at 08 05 36

Status 200 code, which means it sucessfully been created and a little texed from Lambda to.

That's all she wrote, hoped you found this tutorial helpful.

Happy clouding.

About

AWS tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published