makeporngreatagain.pro
yeahporn.top
hd xxx

Building a Mirco-service with Lambda, API Gateway & S3

1,567

In this lab, we will creating a micro-service based webpage which shall button tied to API gateway which in turns tied to Lambda function which shall return some value as response whenever the button is clicked from frontend

Here’s an architectural diagram for it

  1. Let’s start creating this with Lambda function
  2. Input the Name of lambda function
    Choose Python 3.7 as a runtime
    Role: Create a new role from one or more template
    And give the role a name
  3. Now copy below code inside lambda editor & save it
    def lambda_handler(event, context):
        print("In lambda handler")
        
        resp = {
            "statusCode": 200,
            "headers": {
                "Access-Control-Allow-Origin": "*",
            },
            "body": "Dabeer Shaikh"
        }
        
        return resp

  4. Now from service menu go to API Gateway service
  5. Choose below option and create an API Gateway
  6. After creation of API Gateway you will get a window like below
  7. Now from Actions lets create a method
  8. This shall be a GET method since we wanna get some response from our lambda function
  9. On left side after creating GET method, please do below setting and input your lambda function name
    This ties your API Gateway with Lambda
  10. Now deloy your API

  11. You shall get an API URL try to open it, this shall invoke our lambda function and try to get response from the Lambda function
  12. Response from Lambda
  13. Now we need to intregate this API URL with webpage, for this download this WEBPAGE
    Once the index.html file is downloaded open it in Notepad and replace the API URL with your API URL
  14. Now once you have edited the API URL in index.html page, upload that file to a S3 bucket
  15. Make the index.html file public and open it in web browser
  16. It will open up a page similar to below
    Now if you click on “Click ME” you are hitting API URL which in turns shall invoke a lambda function and get a reponse from it
  17. This is response is from lambda
  18. You can delete all resources created during this lab
Leave A Reply

Your email address will not be published.

baseofporn.com https://www.opoptube.com
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.