Nothing Special   »   [go: up one dir, main page]

CSC SKILL Workbook-19CS3281S

Download as pdf or txt
Download as pdf or txt
You are on page 1of 89

SKILL WORKBOOK

19CS3281S-CLOUD SERVERLESS COMPUTING

Team CSC; Dr.V.NARESH, Dr.NAWEEN


K L UNIVERSITY | 19CS3281S-CLOUD SERVERLESS COMPUTING
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

SKILL WORKBOOK

STUDENT NAME
REG. NO
YEAR
SEMESTER
SECTION
FACULTY Dr.V.NARESH,Dr.NAWEENKUMAR

1
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

Organization of the STUDENT SKILL WORKBOOK


The laboratory framework includes a creative element but shifts the time-intensive
aspects outside of the Two-Hourclosed laboratory period. Within this structure, each
laboratory includes three parts: Preskill, In-skill, and Post-skill.
a. Pre-SKILL
The Preskill exercise is a homework assignment that links the lecture with the
laboratory period - typically takes 2 hours to complete. The goal is to synthesize the
information they learn in lecture with material from their textbook to produce a
working piece of software. Preskill Students attending a two-hour closed laboratory
are expected to make a good-faith effort to complete the Preskill exercise before
coming to the skill. Their work need not be perfect, but their effort must be real
(roughly 80 percent correct).
b. In-SKILL
The In-skill section takes place during the actual laboratory period. The First hour of
the laboratory period can be used to resolve any problems the students might have
experienced in completing the Preskill exercises. The intent is to give constructive
feedback so that students leave the skill with working Preskill software - a significant
accomplishment on their part. During the second hour, students complete the In-skill
exercise to reinforce the concepts learned in the Preskill. Students leave the skill
having received feedback on their Preskill and In-skill work.
c. Post-SKILL
The last phase of each laboratory is a homework assignment that is done following
the laboratory period. In the Post-skill, students analyse the efficiency or utility of a
given system call. Each Post-skill exercise should take roughly 120 minutes to
complete.

2
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
2021-22 EVEN SEMESTER SKILL CONTINUOUS EVALUATION

In-skill
Sl. Pre-skill Postl skill Viva Voce Total Faculty
Date Experiment Name
No (5M) LOGIC EXECUTION RESULT ANALYSIS (5M) (5M) (50M) Signature
(10M) (10M) (10M) (5M)

3
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

2021-22 EVEN SEMESTER SKILL CONTINUOUS EVALUATION

4
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK Name of The Experiment / TOPIC Page


No.

1 Create a Simple Chat Bot Serverless Applicatin With Amazon LEX 6-14

2 Create a AWS S3 Bucket and Configuring as a Static Website Hosting 15-24

3 Create a AWS CloudFront Distribution for Content Delivery Network 25-33


to restrict s3 bucket
4 Implement Amazon API Gateway EndPoint and Writing it up to our 34-41
WebSite
5 Create an AWS Lambda Function to create a test case for our Lambda 42-50
Mock
6 Create A DynamoDB Table for seeding wheather table from CSV file 51-63
for API.

7 Build a serverless web application for Dynamic website hosting using 64-67
S3 , Route53 ,CloudFront and Certificate Manager

8 Develop Serverless WebApplication on AWS using GET-METHOD 68-70


getemployeedeails by email
9 Develop Serverless WebApplication on AWS using POST-METHOD 71-73
postemployeedeails using email
10 Build a Serverless Application for Amazon Rekognition Service for 74-76
given Image using Lambda, S3Bucket,IAM role and API Gateway.
11 Create First serverless applications in AWS,AZURE,GCP 77-82

a)AWS-Implementing a Serverless Architecture for the Cafe

b)AZURE- Create a WEB APP in Blob Storage and upload images


with Azure Functions

c)GCP- Building Serverless Front-End Applications Using Google


Cloud Platform
12 Build a Node.js Serverless Application using AWS SAM, Build 83-88
serverless application using Kubernetes and Create serverless
application using Openshift container platform web console

5
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK –1
SKILL 1:
Create a Simple Chat Bot Serverless Applicatin With
Amazon LEX

6
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

7
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

8
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

1. Can my cat go outside


2. Is it warm enough for my cat
3. Can I let my cat out in {city_str}
4. Should my cat wear booties in {city_str}
5. Will my cat stay dry in {city_str}

9
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

So you want to know if your cat can go out today in {city_str}?

Sorry, can you please repeat your initial question?

10
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

Congratulations

Refer:

1. https://www.coursera.org/learn/aws-fundamentals-building-serverless-
applications/supplement/rn0YB/exercise-1-1-creating-a-simple-bot-with-lex

11
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

QUIZ:

Amazon Lex
Question 1
What is an "intent"?

a) The response from Amazon Lex back to the user.


b) An Amazon Lex feature that does natural langauge processing
c) A particular goal that the user wants to achieve.

Question 2
What is a slot?

a) Data that the user must provide to fulfill the intent.


b) The response from Amazon Lex back to the user.

Question 3
What service does Amazon Lex use for text-to-speech?

a) Amazon Alexa
b) Amazon Poly
c) Amazon Rekognition
d) Amazon Alexa

WRITE YOUR OBSERVATIONS HERE:

12
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREEN HERE:

13
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

14
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
WEEK – 2

SKILL 2:
Creating a S3 Bucket and Configuring as a Static
Website

15
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

16
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

17
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::2019-03-01-er-website/*"
]
}
]
}

18
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

https://s3.amazonaws.com/awsu-hosting/CSA-TF-100-SCSRVL-10-EN/s3website.zip

+ images
- mobile.jpg
+ scripts
- config.js
- helper.js
- jquery.js
- text.js
- voice.js
+ styles
- reset.css
- text.css
- voice.css
+ cities.md
+ error.html
+ favicon.ico
+ index.html
+ README.md
+ text.html
+ voice.html

19
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

20
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

21
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

<h1>Too cold for my cat?</h1>

<h1>Too hot for my cat?</h1>

22
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATION HERE:

23
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREEN HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

24
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK - 3
SKILL-3
Create a AWS CloudFront Distribution for Content
Delivery Network to restrict s3 bucket

25
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

26
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

27
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

28
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

29
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::2019-03-01-er-website/*"
},
{
"Sid": "2",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1KO2GAPIWFF7X"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::2019-03-01-er-website/*"
}
]
}

"Version": "2012-10-17",
"Statement": [
{
"Sid": "2",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1KO2GAPIWFF7X"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::2019-03-01-er-website/*"
}
]
}

30
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

31
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS HERE:

32
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREEN HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

33
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
WEEK - 4

SKILL-4

Amazon API Gateway EndPoint and Writing it up to our


WebSite

34
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

"city_str": "VEGAS"
}

35
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

no data

{"Content-Type":"application/json"}

HTTP Method: POST, Resource Path: /

Method request path: {}


Method request query string: {}
Method request headers: {}
Method request body before transformations: {
"city_str": "VEGAS"
}
Method response body after transformations:
Method response headers: {Content-Type=application/json}
Successfully completed execution
Method completed with status: 200

"temp_int": 69
}

36
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

"city_str": "CHICAGO"
}

"temp_int": 69
}

{"Content-Type":"application/json"}

Execution log for request bc5f8d95-3f6b-11e9-9e4c-a7f1e746c2c6

Starting execution for request: bc5f8d95-3f6b-11e9-9e4c-a7f1e746c2c6


HTTP Method: POST, Resource Path: /
Method request path: {}
Method request query string: {}
Method request headers: {}
Method request body before transformations: {
"city_str": "CHICAGO"
}

37
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
Method response body after transformations: {
"temp_int": 69
}
Method response headers: {Content-Type=application/json}
Successfully completed execution
Method completed with status: 200

38
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

"message": "Missing Authentication Token"


}

var API_GATEWAY_URL_STR = null;

39
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

var API_GATEWAY_URL_STR = "https://Your-Invoke-URL.execute-api.us-east-1.amazonaws.com/test";

WRITE YOUR OBSERVATIONS HERE:

40
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREEN HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

41
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK - 5

SKILL-5
Create an AWS Lambda Function to create a test case for
our Lambda Mock

42
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

"Version": "2012-10-17",
"Statement": [

43
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
"arn:aws:logs:*:*:*"
]
}
]
}

function handler(event, context, callback){


var
city_str = event.city_str,
response = {
city_str: city_str,
temp_int: 74
};
console.log(response);
callback(null, response);
}
exports.handler = handler;

44
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

"city_str": "LA"
}

45
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

46
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

47
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
{
"city_str": "SEATTLE"
}

"city_str": "SEATTLE",
"temp_int": 74
}

Sending request to https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-east-


1:179741345863:function:get_weather/invocations

Method response body after transformations: {"city_str":"SEATTLE","temp_int":74}

48
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS:

49
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREEN HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

50
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK - 6

SKILL-6
CREATING A DynamoDB TABLE for seeding wheather table
from CSV file for API.

51
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

52
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

53
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

54
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

exports.handler = function(event, context, callback) {


var
AWS = require("aws-sdk"),
fs = require("fs"),
item = {},
some_temp_int = 0,
params = {},
DDB = new AWS.DynamoDB;

AWS.config.update({
region: "us-east-1"
});
fs.readFileSync("cities.csv", "utf8").split('\n').map(function(item_str)
{
params.ReturnConsumedCapacity = "TOTAL";
params.TableName = "weather";
params.Item = {
"sc": {
"S": item_str.split(",")[0]
},
"t": {
"N": String(item_str.split(",")[1])

55
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
}
};
DDB.putItem(params, function(err, data){
if(err){
console.error(err);
}else{
//ignore output
}
});
});
setTimeout(function(){
callback(null, "ok");
}, 1000 * 10);
}

56
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

57
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

58
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

function handler(event, context, callback){


var
AWS = require("aws-sdk"),
DDB = new AWS.DynamoDB({

59
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
apiVersion: "2012-08-10",
region: "us-east-1"
}),

city_str = event.city_str.toUpperCase(),
data = {
city_str: city_str,
temp_int_str: 72
},
response = {},
params = {
TableName: "weather",
KeyConditionExpression: "sc = :v1",
ExpressionAttributeValues: {
":v1":{
S: city_str
}
}
};

DDB.query(params, function(err, data){


var
item = {},
response = {
statusCode: 200,
headers: {},
body: null
};
if(err){
response.statusCode = 500;
console.log(err);
response.body = err;
}else{
// console.log(data.Items[0]);
var data = data.Items[0];
if(data && data.t){
console.log(data.sc.S + " and " + data.t.N);
item = {
temp_int:Number(data.t.N),
city_str: data.sc.S
};
}else{
item = {
city_str: event.city_str
//when we don't return a temp, the client can say city not fo
und
};
}

60
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
}
response = item;
// console.log(response);
callback(null, response);
});
}
exports.handler = handler;

"city_str": "DENVER"
}

"temp_int": 38,
"city_str": "DENVER"
}

"city_str": "PITTSBURGH"
}

"temp_int": 78,
"city_str": "PITTSBURGH"
}

61
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS:

62
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREEN HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

63
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK - 7
SKILL-7
Build a serverless web application for Dynamic website hosting
using S3 , Route53 ,CloudFront and Certificate Manager

STEP BY STEP:
1)Initially will create s3 bucket in N.Virginia
2)Upload index.html file and make it public
3)Enable static webhosting (index.html)
4)Bucket policy /*( copy only after https://) in browser
5)Freenom website(naresh123.ml)
6)Route53(naresh123.ml)-NS&SOA
7)CloudFront( *.naresh123.ml, naresh123.ml)
8)Redirect http to https
9)Request for Certificate Manager(N.Virginia)

64
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
10)Request CNAME into Route53
11)Certificate issue
12)Add certificate and add naresh123.ml
13)Copy cloudfront domainname in browser
14)Create A record in Route53 (alias choos cloudfront)
15) Paste https://naresh123.ml in browser
REFER:
https://kluniversityin-
my.sharepoint.com/:f:/g/personal/naresh_vurukonda_kluniversity_i
n/EhaiQ0-
b7xVBgUV06dW_Iw8B5FeWf4_RHuKwU6JB47OAFA?e=qRdpqV

OUTPUT SCREEN:

65
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS HERE:

66
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREEN HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

67
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK - 8
SKILL-8
Develop Serverless WebApplication on AWS using GET-
METHOD getemployeedeails by email

REFER: https://kluniversityin-
my.sharepoint.com/:f:/g/personal/naresh_vurukonda_kluniversity_in/EqZzfykCMDBMixQkQqfnuoU
BgJKsYik1kWDBUyHvCTsXfQ?e=BalCVT

68
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS HERE:

69
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREENSHOT HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

70
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK - 9
SKILL-9
Develop Serverless WebApplication on AWS using POST-
METHOD postemployeedeails using email

REFER: https://kluniversityin-
my.sharepoint.com/:f:/g/personal/naresh_vurukonda_kluniversity_in/ErJU96i8QlBHuCMkV6HTkq0B
omak4hqMjWcqDqUiIpyMCw?e=kCuiMi

71
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS HERE:

72
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREENSHOT HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

73
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK - 10
SKILL-10
Build a Serverless Application for Amazon Rekognition
Service for given Image using Lambda, S3Bucket,IAM
role and API Gateway

74
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

REFER:
https://kluniversityin-
my.sharepoint.com/:f:/g/personal/naresh_vurukonda_kluniversity_in/EmpPHQ43P1JLkfU9dal9oecB
AD9EgFqmeFmRS6E6_V_HiQ?e=a0D5mM

WRITE YOUR OBSERVATIONS HERE:

75
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

PASTE YOUR OUTPUT SCREENSHOT HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

76
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WEEK – 11
SKILL-11

Create First serverless applications in AWS,AZURE,GCP

A) AWS-Implementing a Serverless Architecture for the


Café

When you start the lab, your architecture will look like the following example:

At the end of this lab, your architecture should look like the following example:

77
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
Task 1: Downloading the source code
Task 2: Creating the DataExtractor Lambda function in the VPC
Task 3: Creating the salesAnalysisReport Lambda function
Task 4: Creating an SNS topic
Task 5: Creating an email subscription to the SNS topic
Task 6: Testing the salesAnalysisReport Lambda function
Task 7: Setting up an Amazon EventBridge event to trigger the Lambda function each day
Update from the café

Refer :
module13 challenge lab in awsacademy Architect Course:

WRITE YOUR OBSERVATIONS HERE:

78
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

B) AZURE- Create a WEB APP in Blob Storage and upload images with
Azure Functions

What is covered in this lab?


 Create an Azure Storage account and configure containers to host static websites and
images
 Create an Azure Function for uploading images to blob storage
 Resize images using Azure Functions
 Store image metadata in Cosmos DB
 Use Cognitive Services Vision API to auto-generate image captions
 Add authentication

In order to complete this lab you will need an Azure subscription. Please see the
prerequisite section for more details. If you don't have an Azure subscription, create
a free account before you begin

refer:

https://docs.microsoft.com/en-us/labs/build2018/serverlesswebapp/

79
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS HERE:

80
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

C) GCP- Building Serverless Front-End Applications Using Google


Cloud Platform

The use of serverless applications by developers to handle the business logic of their
applications in on the high increase, but how does the Google Cloud — a major service
provider within the public cloud — allow developers to manage serverless applications?

Recently, the development paradigm of applications has begun to shift from manually having
to deploy, scale and update the resources used within an application to relying on third-party
cloud service providers to do most of the management of these resources. As a developer or
an organization that wants to build a market-fit application within the quickest time possible,
your main focus might be on delivering your core application service to your users while you
spend a smaller amount of time on configuring, deploying and stress testing your application.
If this is your use case, handling the business logic of your application in a serverless manner
might your best option. But how?

refer:
https://www.smashingmagazine.com/2020/11/serverless-frontend-
applications-google-cloud-platform/

81
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
WRITE YOUR OBSERVATIONS HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

82
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
WEEK - 12
SKILL-12
A) How to Build a Node.js Serverless Application using AWS SAM
In real life, you won’t be creating a lambda function in console. The best way to create and manage
lambda function is by using SAM or Serverless Application Model.

We are going to setup local development environment on a windows 10 system. And, we will do that
using SAM or Serverless Application Model. For your information, SAM is nothing but an open source
framework for building serverless applications.

nce environment is setup, we will create a Node.js lambda function. We will expose this lambda
function to internet using an API gateway endpoint. Once deployed to AWS cloud, we will test the
endpoint and complete this, During this journey, basically, we will be using below set of commands-
#Step 1 - Download a sample application sam init

#Step 2 - Navigate into project directory and Build your application cd


hello-world-app sam build

#Step 3 - Deploy your application sam deploy --guided

Prerequisite
 An AWS Account
 A Admin User With Access/Secret Key
 Admin right on local system to install software
 Basic Knowledge of SAM and Node.js

refer:
https://cloudkatha.com/how-to-build-a-node-js-
serverless-application-using-aws-
sam/?utm_source=rss&utm_medium=rss&utm_campa
ign=how-to-build-a-node-js-serverless-application-
using-aws-sam

Steps to Build a Node.js Serverless


Application using AWS SAM
1. Install Node.js Runtime
2. Install and Configure AWS CLI

83
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL
3. Install SAM CLI
4. Install Git
5. Create a New Serverless Project
6. Understanding the Created Project
7. Build the Application
8. Deploy Your Serverless Application to Cloud
9. Verify the Serverless Application
10. Clean Up

WRITE YOUR OBSERVATIONS HERE:

84
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

B) Build serverless application using Kubernetes

85
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS HERE:

86
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

C) Create serverless application using Openshift container platform web


console

87
19CS3281S-CLOUD SERVERLESS COMPUTING-SKILL

WRITE YOUR OBSERVATIONS HERE:

(For Evaluator’s use only)

Comment of the Evaluator (if Any) Evaluator’s Observation


Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

88

You might also like