SlideShare a Scribd company logo
Amazon Web Services and Serverless Apps
Roberto Casadei
Concurrent and Distributed Programming course
Department of Computer Science and Engineering (DISI)
Alma Mater Studiorum – Università of Bologna
June 4, 2019
R. Casadei AWS Serverless Apps on AWS 1/27
Outline
1 Amazon Web Services (AWS): Overview
2 Serverless Apps on AWS
R. Casadei AWS Serverless Apps on AWS 2/27
Intro
Amazon Web Services (AWS) is a cloud computing platform, i.e., a platform of
web services offering solutions for computing, storing, and networking, at
different layers of abstraction
Services are charged for on a pay-per-use pricing model
As an AWS customer, you can choose among different data centers (regions)
As of 2019/05, AWS spans 66 Availability Zones within 21 geographic Regions around the world
Services are exposed through APIs: (1) HTTP, (2) web-based, (3) CLI, (4) SDK client
R. Casadei AWS Serverless Apps on AWS 3/27
AWS Services (1/4)
https://docs.aws.amazon.com/—More than 90 services, e.g.:
Compute
Amazon EC2 (Elastic Compute Cloud): provides VMs
AWS Lambda: for serverless apps
Storage
Amazon S3 (Simple Storage Service): object storage
AWS Backup: to automate backup tasks across AWS services and on-premises
Database
Amazon DynamoDB: K/V, document store
Amazon RDS (Relational Database Service): managed RDBMS
Security, Identity, & Compliance
AWS IAM (Identity & Access Management)
R. Casadei AWS Serverless Apps on AWS 4/27
AWS Services (2/4)
Machine Learning
Amazon Comprehend: uses NLP to extract insights from text
Amazon ML: provides GUI tools/wizards to ease creation of ML models
Amazon Translate
Management & Governance
AWS CloudFormation: helps create/provision of AWS infrastructure
declaratively/predictably/repeatedly
AWS Health: provides ongoing visibility of your AWS resources, services, and accounts
Networking & Content Delivery
Amazon API Gateway: for creating, publishing, maintaining, monitoring, and securing
REST and WebSocket APIs at any scale
R. Casadei AWS Serverless Apps on AWS 5/27
AWS Services (3/4)
Analytics
Amazon Kinesis: to collect, process, and analyze video and data streams in real time
Amazon CloudSearch: for setting up search solutions for your website/app
AWS Glue: fully-managed ETL service
Amazon Redshift: data warehouse service
Application Integration
Amazon MQ: a managed message broker service for Apache ActiveMQ
Amazon SNS (Simple Notification Service): cloud-mediated notification service
Amazon SQS (Simple Queue Service): fully managed message queuing service
Internet of Things
AWS IoT Core: enables secure, bi-directional communication between Internet-connected
things and the AWS Cloud over MQTT and HTTP
AWS IoT Device Management: supports e.g. onboarding config, monitoring devices,
remote management etc.
AWS IoT Events: enables monitoring and triggers upon events
R. Casadei AWS Serverless Apps on AWS 6/27
AWS Services (4/4)
Additionally:
AR & VR: Amazon Sumerian (for 3D scenes on the web), ...
Blockchain: Amazon Managed Blockchain
Business apps: Amazon Chime (for online meetings), ...
Customer Engagement: Amazon Connect (Contact-Center-as-a-Service)
Cryptography & PKI: AWS KMS (Key Management Service) (encryption keys), ...
Developer tools: AWS Cloud9 (cloud-based IDE), AWS CodeDeploy (deployment of
apps), ...
End User Computing: Amazon WorkSpaces (virtual desktops), ...
Game development: Amazon GameLift, Amazon Lumberyard
Media services: Amazon Elastic Transcoder (convert media files in S3 into formats
required by playback devices), ...
Migration & Transfer: services e.g. to migrate DB data from/to cloud
Mobile: AWS Device Farm (app testing service), ...
Robotics: AWS RoboMaker
Satellite: AWS Ground Station
R. Casadei AWS Serverless Apps on AWS 7/27
How much does it cost?
Services are billed based on usage (invoiced on a monthly basis). For example:
Based on hours of usage – if you use a server for 61mins, usually it’s counted as 2hs.
Based on traffic – Measure in GBs or num of requests.
Based on storage usage – Provisioned capacity or real usage.
AWS Simple Monthly Calculator: http://aws.amazon.com/calculator
AWS Budgets: you can create custom cost/usage budget alerts
Billing console: https://console.aws.amazon.com/billing/home
Billing example (x5 requests)
R. Casadei AWS Serverless Apps on AWS 8/27
Free tier (as of May 2019)
https://aws.amazon.com/free/
Always free
AWS Lambda: 106
requests/month
Amazon DynamoDB: 25 GB storage
Amazon Glacier: 10 GB of long-term storage
…
12-month free (since subscription to AWS)
Amazon EC2: 750 hours/month
Amazon API Gateway: 106
ingress requests/month
Amazon RDS: 750 hours/month
AWS IoT: 250k messages/month
…
R. Casadei AWS Serverless Apps on AWS 9/27
AWS Educate
https://aws.amazon.com/it/education/awseducate/
Free credits (annually renewable) for students and educators
R. Casadei AWS Serverless Apps on AWS 10/27
Interacting with AWS
Web-based Management Console: https://console.aws.amazon.com
HTTP API
Example: EC2 Query API
https://ec2.amazonaws.com/?Action=RunInstances
&ImageId=ami-2bb65342
&MaxCount=3&MinCount=1
&Placement.AvailabilityZone=us-east-1a
&Monitoring.Enabled=true
&AUTHPARAMS
Command-line interface (CLI): aws ec2 run-instances ...
SDKs for multiple languages: Android, JS, Node.js, PHP, Ruby, Python, Java, .NET, Go.
$ npm install -D aws-sdk
AWS SDK for Node
const AWS = require('aws-sdk');
const ec2 = new AWS.EC2({region: 'us-east-1'});
Higher-level tools/services: e.g., AWS CloudFormation is an Infrastructure-as-Code
tool converts JSON/YAML blueprints (templates) into running infrastructure
{ infrastructure: { loadbalancer: {...}, cdn: {...}, database: {...}, dns : {...} }
R. Casadei AWS Serverless Apps on AWS 11/27
Use AWS
Create an AWS Account and user
Create an AWS account: https://aws.amazon.com
Go to the AWS Management Console: https://console.aws.amazon.com
Enable billing alarms from Billing Dashboard and then create a billing alarm
Do NOT use the AWS root account: go to Services → IAM → Users → Add user and
create a user with “Programmatic access”, with AdministratorAccess policy.
Then, to make API calls (or use CLI) you need your user’s access keys.
CLI installation and initial setup
$ sudo pip install awscli
$ aws configure # configure credentials
# AWS Access Key ID [None]: XXXXXXXXXXXXXXXX
# AWS Secret Access Key [None]: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Default region name [None]: eu-central-1 (Alternatives: us-east-1..)
# Default output format [None]: json
$ aws help # Get available services
$ aws ec2 help # Get help for specific service
$ aws ec2 describe-regions help # Get help for specific action
When you aws configure, a file ~/.aws/credentials is created; then, when you run
a cmd, you may omit --profile and use the settings stored in the default profile.
Command Format: aws <service> <action> [opts]
R. Casadei AWS Serverless Apps on AWS 12/27
Outline
1 Amazon Web Services (AWS): Overview
2 Serverless Apps on AWS
R. Casadei AWS Serverless Apps on AWS 13/27
Serverless » What
Serverless: a method of deploying and running apps on cloud infrastructure
Cloud execution model where pay-per-use + servers abstracted away
Serverless apps are event-driven, distributed, autoscalable
Providers: AWS Lambda, Google Cloud Functions, Azure Functions
Provider responsibilities: capacity planning, scaling, balancing, monitoring
Shouldn’t use when: always-up, websocket apps; latency is critical; ..
AWS Lambda
It runs code in response to events and automatically manages compute resources
Allows you to run functions written in Node.js, Python, C#, and JVM languages
Limits: 15 minutes max exec time (default 3secs); max 3GB memory (default 128MB)
Pricing: 0.2$ per million function execs + $0.000016 per GB of memory/month (for
storage of functions); see also free tier ○
AWS Lambda application development
Difficult parts: deployment and function configuration
Claudia is a Node.js library for deployment to AWS Lambda and API Gateway
Serverless Application Model (SAM), tool by AWS which uses AWS CloudFormation
Serverless Framework: similar to SAM, but supports other platforms (e.g., Azure)
R. Casadei AWS Serverless Apps on AWS 14/27
Serverless » How it works
A serverless function runs only when triggered by an event
You pay only for its execution time; after exec, the function shuts down, while keeping its
trigger active.
Serverless app design: instead of having a server with API endpoints and business
logic, each part of your app is isolated to independent and autoscalable containers.
AWS services for serverless apps:
Lambda: compute service
API Gateway: accepts HTTP requests and routes them to other services
DynamoDB: autoscalable NoSQL DB
Example function
function lambdaFunction(event, context, callback) {
callback(null, 'Hello from AWS Lambda')
}
exports.handler = lambdaFunction;
AWS Lambda requires the module export to be an object of name handler
event keeps data passed by the service who triggered the function
Triggers examples: HTTP requests via API Gateway; changes in DynamoDB stores..
context contains data about your Lambda function: exec time, its trigger, etc.
callback is a way to reply (or error) to the trigger with arguments
R. Casadei AWS Serverless Apps on AWS 15/27
What should I do, manually?
1) Control access to an API with IAM permissions:
https://docs.aws.amazon.com/apigateway/latest/developerguide/
setting-up.html
https://docs.aws.amazon.com/apigateway/latest/developerguide/
permissions.html
2) Create a REST API with Lambda Integrations in Amazon API Gateway
https://docs.aws.amazon.com/apigateway/latest/developerguide/
apigateway-getting-started-with-rest-apis.html
Lambda proxy integration (recommended): the entire client request is sent to the backend
Lambda function as is, mapped to the input event parameter of the function; the Lambda
function’s output is returned to the client as is.
Lambda non-proxy integration (custom): you configure the way parameters, headers, and
body of the client requests and responses are translated to/from Lambda functions
R. Casadei AWS Serverless Apps on AWS 16/27
Amazon API Gateway
Amazon API Gateway is an AWS service for creating, publishing, maintaining,
monitoring, and securing REST and WebSocket APIs at any scale
API Gateway handles all the tasks involved in accepting and processing up to millions of
concurrent API calls, including traffic management, authZ and access control, monitoring,
API version management, and routing to backend services (e.g., EC2, Lambda, ..)
Pricing (as of June 2019)
https://aws.amazon.com/api-gateway/pricing/
Free tier (first 12-month)—per month: 1M REST API calls; 1M msgs & 750k connection
mins for Websocket APIs
REST APIs (US east): 3.5–1.5$ per million calls; 0.0020$/hour per 0.5GB cache
Data transfer (US-east Ohio): you’ll be charged at the EC2 data transfer rate
Data transfer IN to EC2 from Internet: 0$
Data transfer OUT from EC2 to Internet: 0$/GB up to 1GB/month; 0.09$/GB for next
999GB/month; ...
Data transfer OUT from EC2 to AWS: 0.01$/GB to US east Virginia; 0.02$/GB to EU (Frankfurt);
...
R. Casadei AWS Serverless Apps on AWS 17/27
Claudia
Claudia is a Node.js library, built on top of AWS SDK, that eases the deployment of
Node.js projects to AWS Lambda and API Gateway. Components:
1) Claudia (Cmd-line tool): allowing creation and update of functions from terminal
2) Claudia API Builder: for creation of APIs for API Gateway
It automates all the error-prone deployment and configuration tasks.
Creating and updating the function with a single command
Reducing boilerplate, allowing you to focus on your work
Managing multiple versions easily
R. Casadei AWS Serverless Apps on AWS 18/27
Installing Claudia
$ npm install [--save-dev|-g] claudia claudia-api-builder
# If installed locally, run claudia via: node_modules/.bin/claudia
Claudia uses the AWS SDK for Node.js to function, and so requires AWS profile keys
Create a new AWS profile
Create a profile: AWS Console => Users tab => IAM section => Add user
− Attach existing policies: IAMFullAccess (to enable Claudia to create execution roles for
your lambdas; otherwise you need to use --role with claudia create);
AWSLambdaFullAccess (for Claudia deployments); AmazonAPIGatewayAdministrator (for
Claudia API); AmazonDynamoDBFullAccess; AmazonAPIGatewayPushToCloudWatchLogs
AWS roles/policies are important for production
− Once you confirm, you get an access key ID and a secret access key for your new user.
Finally, configure your profile with the AWS CLI
$ aws configure
R. Casadei AWS Serverless Apps on AWS 19/27
Hello World Claudia1
$ npm install -g claudia
$ mkdir hello-world && cd hello-world
$ npm init
exports.handler = function (event, ctx, callback) {
console.log("Function: ", ctx.functionName, ctx.functionVersion);
console.log("Event data: ", JSON.stringify(event));
console.log("Request: ", ctx.awsRequestId);
console.log("Remaining time: ", ctx.getRemainingTimeInMillis());
callback(null, 'hello world');
};
$ claudia create --region us-east-1 --handler lambda.handler
$ claudia test-lambda
# change lambda code
$ claudia update
If name in package.json is XXX, Claudia creates an AWS role XXX-executor (with a
policy log-writer) and a function with name XXX
1https://claudiajs.com/tutorials/hello-world-lambda.html
R. Casadei AWS Serverless Apps on AWS 20/27
Building APIs with Claudia
Claudia API Builder uses API Gateway proxy pass-through to capture all the HTTP
request details and structure them in a JS developer-friendly way.
$ npm install --save claudia-api-builder
api.js
const Api = require('claudia-api-builder');
const api = new Api();
api.get('/', () => 'Welcome to my API');
api.get('/hello/{x}', (req) => { return "hello " + req.pathParams.x; });
api.post('/act', (req) => { createSomething(req.body); }, {
success: 201, // "201 Created" status code on success
error: 400 // "400 Bad request" status code on error
});
module.exports = api; // export your Claudia API Builder instance
$ claudia create  # Create a new lambda function
--region eu-central-1  # AWS region for deployment
--api-module api # api.js is the API entry point
# { "lambda": { ... }, // Lambda function info
# "api": { ..., "url": "<API-BASE-URL>" } }
R. Casadei AWS Serverless Apps on AWS 21/27
How Claudia deploys your API (on claudia create)
R. Casadei AWS Serverless Apps on AWS 22/27
DynamoDB
DynamoDB is a fully managed, autoscaled, propetary NoSQL DB provided by AWS
Data model: data tables (schemaless); attributes (one is primary key); items
Creating tables: you need to define the region for your table and the provisioned
throughput (i.e., the RD and WR capacity that should be reserved for you app)
For autoscaling, you need to define min and max capacity
aws dynamodb create-table 
--table-name orders 
--attribute-definitions AttributeName=orderId,AttributeType=S 
--key-schema AttributeName=orderId,KeyType=HASH 
--provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1 
--region eu-central-1 
--query TableDescription.TableArn 
--output text
Output is the Amazon Resource Name (ARN) of the newly created table.
SDK API: in Node AWS SDK, use AWS.DynamoDB.DocumentClient to work asyncly
with DynamoDB
$ npm install --save aws-sdk
R. Casadei AWS Serverless Apps on AWS 23/27
Working with DynamoDB (1/3)
Add IAM policy to allow Lambdas to communicate with DynamoDB
aws iam put-role-policy --policy-document file://./dynamodb.json 
--role-name <lambda-executor> --policy-name OrdersApiDynamoDB
You can find the value for -role-name in claudia.json
dynamodb.json: a JSON file that describes policies
{ "Version": "2012-10-17",
"Statement": [{
"Action": ["dynamodb:Scan", "dynamodb:DeleteItem",
"dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:UpdateItem"
,
"dynamodb:GetRecords", "dynamodb:GetShardIterator",
"dynamodb:DescribeStream", "dynamodb:ListStreams"],
"Effect": "Allow",
"Resource": "*"
}]
}
R. Casadei AWS Serverless Apps on AWS 24/27
Working with DynamoDB (2/3)
Programmatically add items
const AWS = require('aws-sdk');
const docClient = new AWS.DynamoDB.DocumentClient();
const uuid = require('uuid');
function createOrder(req) {
if (!req || !req.product) throw new Error('...');
return docClient.put({ TableName: 'orders',
Item: { orderId: uuid(), product: req.product, orderStatus: 'pending' }
})
.promise()
.then((res) => { console.log('Order saved:',res); return res; })
.catch((err) => { console.log('Err:',err); throw err; } );
};
module.exports = createOrder;
All AWS SDK classes have a promise() method that can, instead of default
callback behavior, return a promise.
Claudia API Builder expects a Promise for async operations
R. Casadei AWS Serverless Apps on AWS 25/27
Working with DynamoDB (3/1)
List all items from CLI
$ aws dynamodb scan --table-name orders 
--region eu-central-1 --output json
CRUDs
function getOrders(orderId) {
if (typeof orderId === 'undefined')
return docClient.scan({TableName: 'pizza-orders'})
.promise().then(r => r.Items);
return docClient.get({TableName: 'pizza-orders', Key: {orderId: orderId}})
.promise().then(res => res.Item);
}
function updateOrder(orderId, opts) {
// ...
return docClient.update({TableName:'pizza-orders', Key:{orderId:orderId},
UpdateExpression: 'set pizza = :p, address=:a',
ExpressionAttributeValues: { ':p': opts.pizza, ':a': opts.address },
ReturnValues: 'ALL_NEW'
}).promise().then((res) => return res.Attributes);
R. Casadei AWS Serverless Apps on AWS 26/27
Wrap-up
Key points
Cloud apps leverage services on the “cloud” through APIs
Understand the layers of abstractions (I/P/S-aaS)
When using a service, understand what is provided
Understand the pricing
Exercises
1. Take a look at the examples in the following repository:
https://bitbucket.org/unibo_disi/pcd-lab-aws-claudiajs
2. Read the docs to understand the pricing for DynamoDB:
https://aws.amazon.","lambda:
GetAccountSettings"com/dynamodb/pricing/on-demand/
R. Casadei AWS Serverless Apps on AWS 27/27
References (1/1)
[1] AWS Documentation. https://docs.aws.amazon.com/. [Online; accessed 2019-06].
[2] S. Stojanovic and A. Simovic. Serverless Applications with Node.Js: Using AWS Lambda and
Claudia.Js. Manning Publications Company, 2019. ISBN: 9781617294723. URL:
https://books.google.it/books?id=e7rAswEACAAJ.
[3] M. Wittig, A. Wittig, and B. Whaley. Amazon Web Services in Action. Manning, 2018. ISBN:
9781617295119. URL: https://books.google.it/books?id=-LRotAEACAAJ.
R. Casadei Appendix References 28/27

More Related Content

What's hot

Intro to AWS Lambda
Intro to AWS Lambda Intro to AWS Lambda
Intro to AWS Lambda
Amazon Web Services
 
Detailed Analysis of AWS Lambda vs EC2
 Detailed Analysis of AWS Lambda vs EC2 Detailed Analysis of AWS Lambda vs EC2
Detailed Analysis of AWS Lambda vs EC2
Whizlabs
 
Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
Amazon Web Services
 
AWS Lambda Documentation
AWS Lambda DocumentationAWS Lambda Documentation
AWS Lambda Documentation
Whizlabs
 
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...Amazon Web Services
 
Introduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-ITIntroduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-IT
Chitpong Wuttanan
 
5 Things You Don't Know About AWS Cloud
5 Things You Don't Know About AWS Cloud5 Things You Don't Know About AWS Cloud
5 Things You Don't Know About AWS Cloud
Amazon Web Services
 
AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹
Amazon Web Services
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
Scott Leberknight
 
Serverless Applications on AWS
Serverless Applications on AWSServerless Applications on AWS
Serverless Applications on AWS
Dean Bryen
 
Increase Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesIncrease Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web Services
Amazon Web Services
 
A Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS LambdaA Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS Lambda
Amazon Web Services
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet Up
Amazon Web Services
 
Content Delivery: accelerare in modo sicuro e flessibile siti web e applicazioni
Content Delivery: accelerare in modo sicuro e flessibile siti web e applicazioniContent Delivery: accelerare in modo sicuro e flessibile siti web e applicazioni
Content Delivery: accelerare in modo sicuro e flessibile siti web e applicazioni
Amazon Web Services
 
應用程式迅速開發與串連廣大用戶要素
應用程式迅速開發與串連廣大用戶要素應用程式迅速開發與串連廣大用戶要素
應用程式迅速開發與串連廣大用戶要素
Amazon Web Services
 
Continuous Deployment in AWS Lambda
Continuous Deployment in AWS LambdaContinuous Deployment in AWS Lambda
Continuous Deployment in AWS Lambda
Shu Ting Tseng
 
AWS and Serverless with Alexa
AWS and Serverless with AlexaAWS and Serverless with Alexa
AWS and Serverless with Alexa
Rory Preddy
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
Muhammed YALÇIN
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
Amazon Web Services
 

What's hot (20)

Intro to AWS Lambda
Intro to AWS Lambda Intro to AWS Lambda
Intro to AWS Lambda
 
An Introduction to AWS
An Introduction to AWSAn Introduction to AWS
An Introduction to AWS
 
Detailed Analysis of AWS Lambda vs EC2
 Detailed Analysis of AWS Lambda vs EC2 Detailed Analysis of AWS Lambda vs EC2
Detailed Analysis of AWS Lambda vs EC2
 
Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
 
AWS Lambda Documentation
AWS Lambda DocumentationAWS Lambda Documentation
AWS Lambda Documentation
 
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
Real World Development: Peeling The Onion – Migrating A Monolithic Applicatio...
 
Introduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-ITIntroduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-IT
 
5 Things You Don't Know About AWS Cloud
5 Things You Don't Know About AWS Cloud5 Things You Don't Know About AWS Cloud
5 Things You Don't Know About AWS Cloud
 
AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Serverless Applications on AWS
Serverless Applications on AWSServerless Applications on AWS
Serverless Applications on AWS
 
Increase Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesIncrease Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web Services
 
A Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS LambdaA Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS Lambda
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet Up
 
Content Delivery: accelerare in modo sicuro e flessibile siti web e applicazioni
Content Delivery: accelerare in modo sicuro e flessibile siti web e applicazioniContent Delivery: accelerare in modo sicuro e flessibile siti web e applicazioni
Content Delivery: accelerare in modo sicuro e flessibile siti web e applicazioni
 
應用程式迅速開發與串連廣大用戶要素
應用程式迅速開發與串連廣大用戶要素應用程式迅速開發與串連廣大用戶要素
應用程式迅速開發與串連廣大用戶要素
 
Continuous Deployment in AWS Lambda
Continuous Deployment in AWS LambdaContinuous Deployment in AWS Lambda
Continuous Deployment in AWS Lambda
 
AWS and Serverless with Alexa
AWS and Serverless with AlexaAWS and Serverless with Alexa
AWS and Serverless with Alexa
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 

Similar to AWS and Serverless Computing

AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
Amazon Web Services
 
Raleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applicationsRaleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applications
Amazon Web Services
 
re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda
Amazon Web Services
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
Amazon Web Services
 
Testing of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService CloudTesting of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService Cloud
Rustam Zeynalov
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
Amazon Web Services
 
Architetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
Architetture Serverless: concentrarsi sull'idea, non sull'infrastrutturaArchitetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
Architetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
Amazon Web Services
 
How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018
Amazon Web Services
 
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS LambdaFebruary 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
Amazon Web Services
 
Deep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftDeep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY Loft
Amazon Web Services
 
AWS Serverless concepts and solutions
AWS Serverless concepts and solutionsAWS Serverless concepts and solutions
AWS Serverless concepts and solutions
ElenaIvannikova3
 
Building AWS Lambda Applications with the AWS Serverless Application Model (A...
Building AWS Lambda Applications with the AWS Serverless Application Model (A...Building AWS Lambda Applications with the AWS Serverless Application Model (A...
Building AWS Lambda Applications with the AWS Serverless Application Model (A...
Amazon Web Services
 
A quick presentation on AWS, AWS use-cases, resources and more
A quick presentation on AWS, AWS use-cases, resources and moreA quick presentation on AWS, AWS use-cases, resources and more
A quick presentation on AWS, AWS use-cases, resources and more
Tech Sub
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
Amazon Web Services
 
Intro To Serverless Application Architecture: Collision 2018
Intro To Serverless Application Architecture: Collision 2018Intro To Serverless Application Architecture: Collision 2018
Intro To Serverless Application Architecture: Collision 2018
Amazon Web Services
 
Primeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverlessPrimeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverless
Amazon Web Services
 
Voxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by DesignVoxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by Design
Voxxed Athens
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
Amazon Web Services
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
Wayne Scarano
 
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and MicroservicesReply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
Andrea Mercanti
 

Similar to AWS and Serverless Computing (20)

AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
 
Raleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applicationsRaleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applications
 
re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
 
Testing of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService CloudTesting of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService Cloud
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
 
Architetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
Architetture Serverless: concentrarsi sull'idea, non sull'infrastrutturaArchitetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
Architetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
 
How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018
 
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS LambdaFebruary 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
 
Deep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftDeep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY Loft
 
AWS Serverless concepts and solutions
AWS Serverless concepts and solutionsAWS Serverless concepts and solutions
AWS Serverless concepts and solutions
 
Building AWS Lambda Applications with the AWS Serverless Application Model (A...
Building AWS Lambda Applications with the AWS Serverless Application Model (A...Building AWS Lambda Applications with the AWS Serverless Application Model (A...
Building AWS Lambda Applications with the AWS Serverless Application Model (A...
 
A quick presentation on AWS, AWS use-cases, resources and more
A quick presentation on AWS, AWS use-cases, resources and moreA quick presentation on AWS, AWS use-cases, resources and more
A quick presentation on AWS, AWS use-cases, resources and more
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
Intro To Serverless Application Architecture: Collision 2018
Intro To Serverless Application Architecture: Collision 2018Intro To Serverless Application Architecture: Collision 2018
Intro To Serverless Application Architecture: Collision 2018
 
Primeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverlessPrimeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverless
 
Voxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by DesignVoxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by Design
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
 
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and MicroservicesReply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
 

More from Roberto Casadei

Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...
Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...
Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...
Roberto Casadei
 
A Presentation of My Research Activity
A Presentation of My Research ActivityA Presentation of My Research Activity
A Presentation of My Research Activity
Roberto Casadei
 
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...
Roberto Casadei
 
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...Programming Distributed Collective Processes for Dynamic Ensembles and Collec...
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...
Roberto Casadei
 
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
Roberto Casadei
 
Aggregate Computing Research: an Overview
Aggregate Computing Research: an OverviewAggregate Computing Research: an Overview
Aggregate Computing Research: an Overview
Roberto Casadei
 
Introduction to the 1st DISCOLI workshop on distributed collective intelligence
Introduction to the 1st DISCOLI workshop on distributed collective intelligenceIntroduction to the 1st DISCOLI workshop on distributed collective intelligence
Introduction to the 1st DISCOLI workshop on distributed collective intelligence
Roberto Casadei
 
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...
Roberto Casadei
 
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems ProgrammingFScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
Roberto Casadei
 
6th eCAS workshop on Engineering Collective Adaptive Systems
6th eCAS workshop on Engineering Collective Adaptive Systems6th eCAS workshop on Engineering Collective Adaptive Systems
6th eCAS workshop on Engineering Collective Adaptive Systems
Roberto Casadei
 
Augmented Collective Digital Twins for Self-Organising Cyber-Physical Systems
Augmented Collective Digital Twins for Self-Organising Cyber-Physical SystemsAugmented Collective Digital Twins for Self-Organising Cyber-Physical Systems
Augmented Collective Digital Twins for Self-Organising Cyber-Physical Systems
Roberto Casadei
 
Tuple-Based Coordination in Large-Scale Situated Systems
Tuple-Based Coordination in Large-Scale Situated SystemsTuple-Based Coordination in Large-Scale Situated Systems
Tuple-Based Coordination in Large-Scale Situated Systems
Roberto Casadei
 
Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...
Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...
Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...
Roberto Casadei
 
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...
Roberto Casadei
 
Testing: an Introduction and Panorama
Testing: an Introduction and PanoramaTesting: an Introduction and Panorama
Testing: an Introduction and Panorama
Roberto Casadei
 
On Context-Orientation in Aggregate Programming
On Context-Orientation in Aggregate ProgrammingOn Context-Orientation in Aggregate Programming
On Context-Orientation in Aggregate Programming
Roberto Casadei
 
Engineering Resilient Collaborative Edge-enabled IoT
Engineering Resilient Collaborative Edge-enabled IoTEngineering Resilient Collaborative Edge-enabled IoT
Engineering Resilient Collaborative Edge-enabled IoT
Roberto Casadei
 
Aggregate Processes in Field Calculus
Aggregate Processes in Field CalculusAggregate Processes in Field Calculus
Aggregate Processes in Field Calculus
Roberto Casadei
 
Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...
Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...
Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...
Roberto Casadei
 
The Rust Programming Language: an Overview
The Rust Programming Language: an OverviewThe Rust Programming Language: an Overview
The Rust Programming Language: an Overview
Roberto Casadei
 

More from Roberto Casadei (20)

Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...
Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...
Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with Sca...
 
A Presentation of My Research Activity
A Presentation of My Research ActivityA Presentation of My Research Activity
A Presentation of My Research Activity
 
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...
 
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...Programming Distributed Collective Processes for Dynamic Ensembles and Collec...
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...
 
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
 
Aggregate Computing Research: an Overview
Aggregate Computing Research: an OverviewAggregate Computing Research: an Overview
Aggregate Computing Research: an Overview
 
Introduction to the 1st DISCOLI workshop on distributed collective intelligence
Introduction to the 1st DISCOLI workshop on distributed collective intelligenceIntroduction to the 1st DISCOLI workshop on distributed collective intelligence
Introduction to the 1st DISCOLI workshop on distributed collective intelligence
 
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...
 
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems ProgrammingFScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
 
6th eCAS workshop on Engineering Collective Adaptive Systems
6th eCAS workshop on Engineering Collective Adaptive Systems6th eCAS workshop on Engineering Collective Adaptive Systems
6th eCAS workshop on Engineering Collective Adaptive Systems
 
Augmented Collective Digital Twins for Self-Organising Cyber-Physical Systems
Augmented Collective Digital Twins for Self-Organising Cyber-Physical SystemsAugmented Collective Digital Twins for Self-Organising Cyber-Physical Systems
Augmented Collective Digital Twins for Self-Organising Cyber-Physical Systems
 
Tuple-Based Coordination in Large-Scale Situated Systems
Tuple-Based Coordination in Large-Scale Situated SystemsTuple-Based Coordination in Large-Scale Situated Systems
Tuple-Based Coordination in Large-Scale Situated Systems
 
Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...
Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...
Pulverisation in Cyber-Physical Systems: Engineering the Self-Organising Logi...
 
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...
 
Testing: an Introduction and Panorama
Testing: an Introduction and PanoramaTesting: an Introduction and Panorama
Testing: an Introduction and Panorama
 
On Context-Orientation in Aggregate Programming
On Context-Orientation in Aggregate ProgrammingOn Context-Orientation in Aggregate Programming
On Context-Orientation in Aggregate Programming
 
Engineering Resilient Collaborative Edge-enabled IoT
Engineering Resilient Collaborative Edge-enabled IoTEngineering Resilient Collaborative Edge-enabled IoT
Engineering Resilient Collaborative Edge-enabled IoT
 
Aggregate Processes in Field Calculus
Aggregate Processes in Field CalculusAggregate Processes in Field Calculus
Aggregate Processes in Field Calculus
 
Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...
Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...
Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...
 
The Rust Programming Language: an Overview
The Rust Programming Language: an OverviewThe Rust Programming Language: an Overview
The Rust Programming Language: an Overview
 

Recently uploaded

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

AWS and Serverless Computing

  • 1. Amazon Web Services and Serverless Apps Roberto Casadei Concurrent and Distributed Programming course Department of Computer Science and Engineering (DISI) Alma Mater Studiorum – Università of Bologna June 4, 2019 R. Casadei AWS Serverless Apps on AWS 1/27
  • 2. Outline 1 Amazon Web Services (AWS): Overview 2 Serverless Apps on AWS R. Casadei AWS Serverless Apps on AWS 2/27
  • 3. Intro Amazon Web Services (AWS) is a cloud computing platform, i.e., a platform of web services offering solutions for computing, storing, and networking, at different layers of abstraction Services are charged for on a pay-per-use pricing model As an AWS customer, you can choose among different data centers (regions) As of 2019/05, AWS spans 66 Availability Zones within 21 geographic Regions around the world Services are exposed through APIs: (1) HTTP, (2) web-based, (3) CLI, (4) SDK client R. Casadei AWS Serverless Apps on AWS 3/27
  • 4. AWS Services (1/4) https://docs.aws.amazon.com/—More than 90 services, e.g.: Compute Amazon EC2 (Elastic Compute Cloud): provides VMs AWS Lambda: for serverless apps Storage Amazon S3 (Simple Storage Service): object storage AWS Backup: to automate backup tasks across AWS services and on-premises Database Amazon DynamoDB: K/V, document store Amazon RDS (Relational Database Service): managed RDBMS Security, Identity, & Compliance AWS IAM (Identity & Access Management) R. Casadei AWS Serverless Apps on AWS 4/27
  • 5. AWS Services (2/4) Machine Learning Amazon Comprehend: uses NLP to extract insights from text Amazon ML: provides GUI tools/wizards to ease creation of ML models Amazon Translate Management & Governance AWS CloudFormation: helps create/provision of AWS infrastructure declaratively/predictably/repeatedly AWS Health: provides ongoing visibility of your AWS resources, services, and accounts Networking & Content Delivery Amazon API Gateway: for creating, publishing, maintaining, monitoring, and securing REST and WebSocket APIs at any scale R. Casadei AWS Serverless Apps on AWS 5/27
  • 6. AWS Services (3/4) Analytics Amazon Kinesis: to collect, process, and analyze video and data streams in real time Amazon CloudSearch: for setting up search solutions for your website/app AWS Glue: fully-managed ETL service Amazon Redshift: data warehouse service Application Integration Amazon MQ: a managed message broker service for Apache ActiveMQ Amazon SNS (Simple Notification Service): cloud-mediated notification service Amazon SQS (Simple Queue Service): fully managed message queuing service Internet of Things AWS IoT Core: enables secure, bi-directional communication between Internet-connected things and the AWS Cloud over MQTT and HTTP AWS IoT Device Management: supports e.g. onboarding config, monitoring devices, remote management etc. AWS IoT Events: enables monitoring and triggers upon events R. Casadei AWS Serverless Apps on AWS 6/27
  • 7. AWS Services (4/4) Additionally: AR & VR: Amazon Sumerian (for 3D scenes on the web), ... Blockchain: Amazon Managed Blockchain Business apps: Amazon Chime (for online meetings), ... Customer Engagement: Amazon Connect (Contact-Center-as-a-Service) Cryptography & PKI: AWS KMS (Key Management Service) (encryption keys), ... Developer tools: AWS Cloud9 (cloud-based IDE), AWS CodeDeploy (deployment of apps), ... End User Computing: Amazon WorkSpaces (virtual desktops), ... Game development: Amazon GameLift, Amazon Lumberyard Media services: Amazon Elastic Transcoder (convert media files in S3 into formats required by playback devices), ... Migration & Transfer: services e.g. to migrate DB data from/to cloud Mobile: AWS Device Farm (app testing service), ... Robotics: AWS RoboMaker Satellite: AWS Ground Station R. Casadei AWS Serverless Apps on AWS 7/27
  • 8. How much does it cost? Services are billed based on usage (invoiced on a monthly basis). For example: Based on hours of usage – if you use a server for 61mins, usually it’s counted as 2hs. Based on traffic – Measure in GBs or num of requests. Based on storage usage – Provisioned capacity or real usage. AWS Simple Monthly Calculator: http://aws.amazon.com/calculator AWS Budgets: you can create custom cost/usage budget alerts Billing console: https://console.aws.amazon.com/billing/home Billing example (x5 requests) R. Casadei AWS Serverless Apps on AWS 8/27
  • 9. Free tier (as of May 2019) https://aws.amazon.com/free/ Always free AWS Lambda: 106 requests/month Amazon DynamoDB: 25 GB storage Amazon Glacier: 10 GB of long-term storage … 12-month free (since subscription to AWS) Amazon EC2: 750 hours/month Amazon API Gateway: 106 ingress requests/month Amazon RDS: 750 hours/month AWS IoT: 250k messages/month … R. Casadei AWS Serverless Apps on AWS 9/27
  • 10. AWS Educate https://aws.amazon.com/it/education/awseducate/ Free credits (annually renewable) for students and educators R. Casadei AWS Serverless Apps on AWS 10/27
  • 11. Interacting with AWS Web-based Management Console: https://console.aws.amazon.com HTTP API Example: EC2 Query API https://ec2.amazonaws.com/?Action=RunInstances &ImageId=ami-2bb65342 &MaxCount=3&MinCount=1 &Placement.AvailabilityZone=us-east-1a &Monitoring.Enabled=true &AUTHPARAMS Command-line interface (CLI): aws ec2 run-instances ... SDKs for multiple languages: Android, JS, Node.js, PHP, Ruby, Python, Java, .NET, Go. $ npm install -D aws-sdk AWS SDK for Node const AWS = require('aws-sdk'); const ec2 = new AWS.EC2({region: 'us-east-1'}); Higher-level tools/services: e.g., AWS CloudFormation is an Infrastructure-as-Code tool converts JSON/YAML blueprints (templates) into running infrastructure { infrastructure: { loadbalancer: {...}, cdn: {...}, database: {...}, dns : {...} } R. Casadei AWS Serverless Apps on AWS 11/27
  • 12. Use AWS Create an AWS Account and user Create an AWS account: https://aws.amazon.com Go to the AWS Management Console: https://console.aws.amazon.com Enable billing alarms from Billing Dashboard and then create a billing alarm Do NOT use the AWS root account: go to Services → IAM → Users → Add user and create a user with “Programmatic access”, with AdministratorAccess policy. Then, to make API calls (or use CLI) you need your user’s access keys. CLI installation and initial setup $ sudo pip install awscli $ aws configure # configure credentials # AWS Access Key ID [None]: XXXXXXXXXXXXXXXX # AWS Secret Access Key [None]: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Default region name [None]: eu-central-1 (Alternatives: us-east-1..) # Default output format [None]: json $ aws help # Get available services $ aws ec2 help # Get help for specific service $ aws ec2 describe-regions help # Get help for specific action When you aws configure, a file ~/.aws/credentials is created; then, when you run a cmd, you may omit --profile and use the settings stored in the default profile. Command Format: aws <service> <action> [opts] R. Casadei AWS Serverless Apps on AWS 12/27
  • 13. Outline 1 Amazon Web Services (AWS): Overview 2 Serverless Apps on AWS R. Casadei AWS Serverless Apps on AWS 13/27
  • 14. Serverless » What Serverless: a method of deploying and running apps on cloud infrastructure Cloud execution model where pay-per-use + servers abstracted away Serverless apps are event-driven, distributed, autoscalable Providers: AWS Lambda, Google Cloud Functions, Azure Functions Provider responsibilities: capacity planning, scaling, balancing, monitoring Shouldn’t use when: always-up, websocket apps; latency is critical; .. AWS Lambda It runs code in response to events and automatically manages compute resources Allows you to run functions written in Node.js, Python, C#, and JVM languages Limits: 15 minutes max exec time (default 3secs); max 3GB memory (default 128MB) Pricing: 0.2$ per million function execs + $0.000016 per GB of memory/month (for storage of functions); see also free tier ○ AWS Lambda application development Difficult parts: deployment and function configuration Claudia is a Node.js library for deployment to AWS Lambda and API Gateway Serverless Application Model (SAM), tool by AWS which uses AWS CloudFormation Serverless Framework: similar to SAM, but supports other platforms (e.g., Azure) R. Casadei AWS Serverless Apps on AWS 14/27
  • 15. Serverless » How it works A serverless function runs only when triggered by an event You pay only for its execution time; after exec, the function shuts down, while keeping its trigger active. Serverless app design: instead of having a server with API endpoints and business logic, each part of your app is isolated to independent and autoscalable containers. AWS services for serverless apps: Lambda: compute service API Gateway: accepts HTTP requests and routes them to other services DynamoDB: autoscalable NoSQL DB Example function function lambdaFunction(event, context, callback) { callback(null, 'Hello from AWS Lambda') } exports.handler = lambdaFunction; AWS Lambda requires the module export to be an object of name handler event keeps data passed by the service who triggered the function Triggers examples: HTTP requests via API Gateway; changes in DynamoDB stores.. context contains data about your Lambda function: exec time, its trigger, etc. callback is a way to reply (or error) to the trigger with arguments R. Casadei AWS Serverless Apps on AWS 15/27
  • 16. What should I do, manually? 1) Control access to an API with IAM permissions: https://docs.aws.amazon.com/apigateway/latest/developerguide/ setting-up.html https://docs.aws.amazon.com/apigateway/latest/developerguide/ permissions.html 2) Create a REST API with Lambda Integrations in Amazon API Gateway https://docs.aws.amazon.com/apigateway/latest/developerguide/ apigateway-getting-started-with-rest-apis.html Lambda proxy integration (recommended): the entire client request is sent to the backend Lambda function as is, mapped to the input event parameter of the function; the Lambda function’s output is returned to the client as is. Lambda non-proxy integration (custom): you configure the way parameters, headers, and body of the client requests and responses are translated to/from Lambda functions R. Casadei AWS Serverless Apps on AWS 16/27
  • 17. Amazon API Gateway Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST and WebSocket APIs at any scale API Gateway handles all the tasks involved in accepting and processing up to millions of concurrent API calls, including traffic management, authZ and access control, monitoring, API version management, and routing to backend services (e.g., EC2, Lambda, ..) Pricing (as of June 2019) https://aws.amazon.com/api-gateway/pricing/ Free tier (first 12-month)—per month: 1M REST API calls; 1M msgs & 750k connection mins for Websocket APIs REST APIs (US east): 3.5–1.5$ per million calls; 0.0020$/hour per 0.5GB cache Data transfer (US-east Ohio): you’ll be charged at the EC2 data transfer rate Data transfer IN to EC2 from Internet: 0$ Data transfer OUT from EC2 to Internet: 0$/GB up to 1GB/month; 0.09$/GB for next 999GB/month; ... Data transfer OUT from EC2 to AWS: 0.01$/GB to US east Virginia; 0.02$/GB to EU (Frankfurt); ... R. Casadei AWS Serverless Apps on AWS 17/27
  • 18. Claudia Claudia is a Node.js library, built on top of AWS SDK, that eases the deployment of Node.js projects to AWS Lambda and API Gateway. Components: 1) Claudia (Cmd-line tool): allowing creation and update of functions from terminal 2) Claudia API Builder: for creation of APIs for API Gateway It automates all the error-prone deployment and configuration tasks. Creating and updating the function with a single command Reducing boilerplate, allowing you to focus on your work Managing multiple versions easily R. Casadei AWS Serverless Apps on AWS 18/27
  • 19. Installing Claudia $ npm install [--save-dev|-g] claudia claudia-api-builder # If installed locally, run claudia via: node_modules/.bin/claudia Claudia uses the AWS SDK for Node.js to function, and so requires AWS profile keys Create a new AWS profile Create a profile: AWS Console => Users tab => IAM section => Add user − Attach existing policies: IAMFullAccess (to enable Claudia to create execution roles for your lambdas; otherwise you need to use --role with claudia create); AWSLambdaFullAccess (for Claudia deployments); AmazonAPIGatewayAdministrator (for Claudia API); AmazonDynamoDBFullAccess; AmazonAPIGatewayPushToCloudWatchLogs AWS roles/policies are important for production − Once you confirm, you get an access key ID and a secret access key for your new user. Finally, configure your profile with the AWS CLI $ aws configure R. Casadei AWS Serverless Apps on AWS 19/27
  • 20. Hello World Claudia1 $ npm install -g claudia $ mkdir hello-world && cd hello-world $ npm init exports.handler = function (event, ctx, callback) { console.log("Function: ", ctx.functionName, ctx.functionVersion); console.log("Event data: ", JSON.stringify(event)); console.log("Request: ", ctx.awsRequestId); console.log("Remaining time: ", ctx.getRemainingTimeInMillis()); callback(null, 'hello world'); }; $ claudia create --region us-east-1 --handler lambda.handler $ claudia test-lambda # change lambda code $ claudia update If name in package.json is XXX, Claudia creates an AWS role XXX-executor (with a policy log-writer) and a function with name XXX 1https://claudiajs.com/tutorials/hello-world-lambda.html R. Casadei AWS Serverless Apps on AWS 20/27
  • 21. Building APIs with Claudia Claudia API Builder uses API Gateway proxy pass-through to capture all the HTTP request details and structure them in a JS developer-friendly way. $ npm install --save claudia-api-builder api.js const Api = require('claudia-api-builder'); const api = new Api(); api.get('/', () => 'Welcome to my API'); api.get('/hello/{x}', (req) => { return "hello " + req.pathParams.x; }); api.post('/act', (req) => { createSomething(req.body); }, { success: 201, // "201 Created" status code on success error: 400 // "400 Bad request" status code on error }); module.exports = api; // export your Claudia API Builder instance $ claudia create # Create a new lambda function --region eu-central-1 # AWS region for deployment --api-module api # api.js is the API entry point # { "lambda": { ... }, // Lambda function info # "api": { ..., "url": "<API-BASE-URL>" } } R. Casadei AWS Serverless Apps on AWS 21/27
  • 22. How Claudia deploys your API (on claudia create) R. Casadei AWS Serverless Apps on AWS 22/27
  • 23. DynamoDB DynamoDB is a fully managed, autoscaled, propetary NoSQL DB provided by AWS Data model: data tables (schemaless); attributes (one is primary key); items Creating tables: you need to define the region for your table and the provisioned throughput (i.e., the RD and WR capacity that should be reserved for you app) For autoscaling, you need to define min and max capacity aws dynamodb create-table --table-name orders --attribute-definitions AttributeName=orderId,AttributeType=S --key-schema AttributeName=orderId,KeyType=HASH --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1 --region eu-central-1 --query TableDescription.TableArn --output text Output is the Amazon Resource Name (ARN) of the newly created table. SDK API: in Node AWS SDK, use AWS.DynamoDB.DocumentClient to work asyncly with DynamoDB $ npm install --save aws-sdk R. Casadei AWS Serverless Apps on AWS 23/27
  • 24. Working with DynamoDB (1/3) Add IAM policy to allow Lambdas to communicate with DynamoDB aws iam put-role-policy --policy-document file://./dynamodb.json --role-name <lambda-executor> --policy-name OrdersApiDynamoDB You can find the value for -role-name in claudia.json dynamodb.json: a JSON file that describes policies { "Version": "2012-10-17", "Statement": [{ "Action": ["dynamodb:Scan", "dynamodb:DeleteItem", "dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:UpdateItem" , "dynamodb:GetRecords", "dynamodb:GetShardIterator", "dynamodb:DescribeStream", "dynamodb:ListStreams"], "Effect": "Allow", "Resource": "*" }] } R. Casadei AWS Serverless Apps on AWS 24/27
  • 25. Working with DynamoDB (2/3) Programmatically add items const AWS = require('aws-sdk'); const docClient = new AWS.DynamoDB.DocumentClient(); const uuid = require('uuid'); function createOrder(req) { if (!req || !req.product) throw new Error('...'); return docClient.put({ TableName: 'orders', Item: { orderId: uuid(), product: req.product, orderStatus: 'pending' } }) .promise() .then((res) => { console.log('Order saved:',res); return res; }) .catch((err) => { console.log('Err:',err); throw err; } ); }; module.exports = createOrder; All AWS SDK classes have a promise() method that can, instead of default callback behavior, return a promise. Claudia API Builder expects a Promise for async operations R. Casadei AWS Serverless Apps on AWS 25/27
  • 26. Working with DynamoDB (3/1) List all items from CLI $ aws dynamodb scan --table-name orders --region eu-central-1 --output json CRUDs function getOrders(orderId) { if (typeof orderId === 'undefined') return docClient.scan({TableName: 'pizza-orders'}) .promise().then(r => r.Items); return docClient.get({TableName: 'pizza-orders', Key: {orderId: orderId}}) .promise().then(res => res.Item); } function updateOrder(orderId, opts) { // ... return docClient.update({TableName:'pizza-orders', Key:{orderId:orderId}, UpdateExpression: 'set pizza = :p, address=:a', ExpressionAttributeValues: { ':p': opts.pizza, ':a': opts.address }, ReturnValues: 'ALL_NEW' }).promise().then((res) => return res.Attributes); R. Casadei AWS Serverless Apps on AWS 26/27
  • 27. Wrap-up Key points Cloud apps leverage services on the “cloud” through APIs Understand the layers of abstractions (I/P/S-aaS) When using a service, understand what is provided Understand the pricing Exercises 1. Take a look at the examples in the following repository: https://bitbucket.org/unibo_disi/pcd-lab-aws-claudiajs 2. Read the docs to understand the pricing for DynamoDB: https://aws.amazon.","lambda: GetAccountSettings"com/dynamodb/pricing/on-demand/ R. Casadei AWS Serverless Apps on AWS 27/27
  • 28. References (1/1) [1] AWS Documentation. https://docs.aws.amazon.com/. [Online; accessed 2019-06]. [2] S. Stojanovic and A. Simovic. Serverless Applications with Node.Js: Using AWS Lambda and Claudia.Js. Manning Publications Company, 2019. ISBN: 9781617294723. URL: https://books.google.it/books?id=e7rAswEACAAJ. [3] M. Wittig, A. Wittig, and B. Whaley. Amazon Web Services in Action. Manning, 2018. ISBN: 9781617295119. URL: https://books.google.it/books?id=-LRotAEACAAJ. R. Casadei Appendix References 28/27