Usage/Deployment Instructions
Step 1: Create a new key pair while creating machine from AMI as below.

Step 2: Download the key pair and save it on disk.

Step 3: Run puttygen from Start button of the system. (If it is not available, you can download from here and get it installed on your system http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html )

Step 4: Upload keypair to the putty key generator. Save the private key by clicking the Save private key button (.ppk file).

Step 5: Now run putty configuration.

Step 6: Put IP Address and select the .ppk file as shown below.


Step 7: Type ec2-user in the putty command box.


Create Function on AMI
-
Create project folder and go inside it
mkdir <Name of directory>
cd <Name of directory>
-
Type the following command to create serverless using python3 template:
sls create --template aws-python3
You will get three file
-
.gitignore : source control management file
-
handle.js : contain a source code for a simple
-
serverless.yml : project configuration file
You can customize as much as you want to serverless.yml, but for me I’ll change only service, stage, region, and resources.
To deploy serverless service, you can type the following command:
sls deploy
-
To invoke your function you can type:
sls invoke --function hello
Note: You can edit the handle.js command to edit the function.
CREATE API
Open the link to create API of your function.
https://console.aws.amazon.com/console/home
Under Compute, go to Lambda

Here all the functions created are listed.
Click on a function to create an API for the same. Here you get 3 tabs (Configuration, Triggers, and Monitoring)
Click on Triggers.
Click on + Add Triggers.

Click on the box to select trigger type.

Click on API Gateway.
Select Security option as OPEN.
Click on Submit button.
Under Application Services, go to API Gateway.
Under LambdaMicroServices, go to Stages.
Here you will get method type and Invoke URL.

You can test the URL in browser. Run the URL in browser, it will display output of the function.