Skip to content

Instantly share code, notes, and snippets.

@sanju2
Created August 30, 2023 19:15
Show Gist options
  • Save sanju2/0ba05a7c005f0f5d22066135b1b1bb55 to your computer and use it in GitHub Desktop.
Save sanju2/0ba05a7c005f0f5d22066135b1b1bb55 to your computer and use it in GitHub Desktop.
Create Rest API using Lambda & ApiGateway - AWS Sinhalen Website
import json
def lambda_handler(event, context):
response = event["servicename"]
match event["servicename"]:
case "ec2":
response = "Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2's simple web service interface allows you to obtain and configure capacity with minimal friction."
case "s3":
response = "Amazon Simple Storage Service (Amazon S3) is an object storage service offering industry-leading scalability, data availability, security, and performance."
case _:
response = "Service Incorrect"
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment