AWS Gateway API with REST API And Lambda setup

To setup gateway API for your REST API, click on "Create API". Then click on "Build"



Next, you will be prompted for these. Select "New API" and then TLS 1.3. 



And then use default settings and click on "Create API".



Then you click on "Create Method".



Amd we will configure to point this service to our lamda function.


Please ensure you have a lambda ready to go and then click "Create". 


You can easily test it out by clicking on "Test" 



AWS gateway has this concept called Stage that basic define a REST API path, for example my server 

https//myhost/dev and https//myhost/test 

And let's say you created your REST API which has a path /hello then you references it via 

https//myhost/dev/hello and https//myhost/test/hello

Here dev and test are called stage and that's where you need to deploy your application.

API Key

You can configure your REST API to ask for an API key 




You can also add extra RESPONSE HEADER. It is a 2 step process. First you need to create the HEADER name and then you assigna value to it. 


For example, we will create XGRAPHQL for Response Method. And then we provide a value 




In the "Integration Response", we give it a value, please remember to give it a quote as shown below:- 



And then you can see it as shown here:-










Comments

Popular posts from this blog

Windows SSH: Permissions for 'private-key' are too open

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20