© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Heitor Lessa
Specialist Solutions Architect, Amazon Web Services
What’s New for Serverless
@heitor_lessa
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Brief intro to Serverless
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build and run
applications
without thinking about
servers
… pay per request not
for idle
“ Scales with usage
Never pay for idle
High availability
built-in
No servers
to provision
or manage
A serverless world…
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless Applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Lambda function
Node.js
Python
Java
C#
Go
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Common Serverless Application Use Cases
AnalyticsOperational management
Live Dashboards
Data workflowsContent management
ETL workflows
Interactive BackendsMobile and web apps
Webhooks and Bots
Autonomous ITPolicy engines
Infrastructure management
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Services for Building Serverless Applications
AWS Lambda Amazon DynamoDB
Amazon SNS
Amazon API GatewayAmazon SQS
Amazon Kinesis
Amazon S3
Developer Tools and User Management
API Management and Real-time Backend Orchestration, Messaging and Queues Analytics
Compute Storage Database
Amazon Cognito
AWS AppSync Amazon Athena
AWS Lambda@Edge Amazon Aurora(preview)
AWS Step Functions
AWS CodeBuild AWS CodePipeline
AWS Cloud9
AWS CodeDeploy
AWS Serverless Application
Model (SAM)
AWS X-Ray
Open Source and
Third parties
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What’s New for Serverlessa.k.a In Case You Missed These Goodies!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
a.k.a In Case You Missed These Goodies!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Serverless Application Repository
• Search and browse ready-made apps and samples
• Customize open-source apps to get started quickly
• Share apps privately or publically
• Monetize APIs using the AWS Marketplace
• All apps powered by AWS SAM
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Concurrency metric in Amazon Cloudwatch
Per-function concurrency throttles
What you can do with it
1. Limit concurrency to legacy systems
2. Protect serverless production services
from other functions in the same account
3. Temporarily disable a function
4. Develop functions with limited billing and
“runaway” protection
Lambda – Concurrency controls
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda – Safe deployments with CodeDeploy
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda – Safe deployments with SAM/CodeDeploy
Globals:
Function:
Runtime: python3.6
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery10Minutes
MyLambdaFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.lambda_handler
….
NEW!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda – Safe deployments with SAM/CodeDeploy
Globals:
Function:
Runtime: python3.6
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery10Minutes
Alarms:
# A list of alarms that you want to monitor
- !Ref AliasErrorMetricGreaterThanZeroAlarm
- !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
Hooks:
# Validation Lambda functions that are run before & after traffic shifting
PreTraffic: !Ref PreTrafficLambdaFunction
PostTraffic: !Ref PostTrafficLambdaFunction
NEW!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda – Multi-Account deployments reference
aws.amazon.com/blogs/compute/managing-cross-account-serverless-microservices/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API Gateway
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API Gateway - Canary Support
API Clients All publicly
and privately
accessible
endpoints
Backends
in AWSv1
90%
v2
10%
api.mydomain.com/prod
10% traffic to new deployment of stage, rest to previous version
No changes to client
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API Gateway – New features summary
Your Virtual Private Cloud (VPC)
Endpoints
in your VPCAPI Gateway
Network
Load BalancerPrivate Link
Another AWS Account
Authorizer Backend
Another AWS Account
IAM Users
IAM Resource Policy
Mobile Apps
Websites
Services
IP/CIDR Block via
IAM Resource Policy
Cross-Account
Authorizer/Integ.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AppSync
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AppSync – GA
AppSync General Availability across multiple regions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GraphQL APIs
Open, declarative data-fetching specification
!= Graph database
Use NoSQL, Relational, HTTP, etc.
Traditional data-fetching GraphQL
/posts
/postInfo
/postJustTitle
/postsByAuthor
/postNameStartsWithX
/commentsOnPost
/posts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GraphQL Spec - Schema
{
"id": "1",
"name": "Get Milk",
“priority": "1"
},
{
"id": “2",
"name": “Go to gym",
“priority": “5"
},…
type Query {
getTodos: [Todo]
}
type Todo {
id: ID!
name: String
description: String
priority: Int
duedate: String
}
query {
getTodos {
id
name
priority
}
}
Model data with
application schema
Client requests what it
needs
Only that data is
returned
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AppSync – Feature summary
GraphQL
Schema
Upload
Schema
GraphQL
Query
Mutation
Subscription
Real-time
Offline
AppSync
API
Cognito
User Pool
Legacy
Application
Data sources
DynamoDB
Table
Lambda
Function
Elasticsearch
Service
Authorization
Any Provider
OIDC compliant
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Developer tooling
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Developer tooling – SAM CLIAWS CLI tool for local testing of serverless apps
Works with Lambda functions and
“proxy-style” APIs
Deep SAM template validation and
project bootstrapping for all runtimes
Uses open-source Docker-Lambda images to
mimic Lambda’s execution environment:
• Emulates timeout, memory limits, runtimes
github.com/awslabs/aws-sam-cli
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Developer tooling – CodeBuild Local Agent
Locally test and debug CodeBuild builds
Supports Artifacts, Curated CodeBuild images
and custom Docker images
docker pull amazon/aws-codebuild-local
docker run \-v /var/run/docker.sock:/var/run/docker.sock \-e "IMAGE_NAME=aws/codebuild/python:3.6.5" \-e "ARTIFACTS=/Users/myUser/build-artifacts" \-e "SOURCE=/Users/myUser/sample-app" \
amazon/aws-codebuild-local
aws.amazon.com/blogs/devops/announcing-local-build-support-for-aws-codebuild/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resources
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Additional Resources
aws.amazon.com/about-aws/whats-new/2018/
aws.amazon.com/serverless/
Tricky demo time