SlideShare une entreprise Scribd logo
1  sur  138
Télécharger pour lire hors ligne
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What's new with Serverless
Speaker: Stephen Liedig (AWS)
Application Modernisation in a Serverless World
Speaker: Stephen Liedig (AWS)
Serverless Trains: TrainLink and Sydney Trains
Speaker: Aileen Gemma Smith (Vizalytics)
How serverless scales to perform over 200 million well-architected checks a day
Speaker: Paul Hortop and Mike Rahmati (Cloud Conformity)
AWS Serverless Webinar: Unleash Innovation & Build Modern Applications
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Stephen Liedig, Senior Solutions Architect, AWS
March 2019
What’s new with Serverless
@sliedigaws
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Table of contents
• Compute
• IDE
• Languages
• Programming Model
• Workflows
• Databases
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
The broadest and deepest cloud platform
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Compute
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Running Containers & Serverless at scale
Different security
boundaries than
instances
Inefficient resource
utilization
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Firecracker MicroVM
• Firecracker microVMs have the same security as KVM VMs
• Designed for low overhead, high density, and fast start times
• Built-in fair sharing
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
IDEs Languages WorkflowsProgramming
Model
Everyone wants to just focus
on business logic in Serverless
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
IDEs
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
New IDE Support
G E N E R A L L Y A V A I L A B L E
A W S
C l o u d 9
AWS Toolkit
for PyCharm
G E N E R A L L Y A V A I L A B L E
AWS Toolkit
for IntelliJ
I N D E V E L O P E R P R E V I E W
AWS Toolkit
for VS Code
I N D E V E L O P E R P R E V I E W
O p e n s o u r c e t o o l k i t s m e e t i n g y o u w h e r e a n d h o w y o u l i k e t o w o r k
AWS Toolkits for popular IDEs
+
Cloud IDEs
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Languages
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Lambda release history
*As of October 2018, does not include region launches
LambdaPreviewAnnouncement
re:Invent2014
Python2.7Support
JavaSupport
Node4.2Support
C#.NetSupport
Python3.6
Node.js6.10
.NetCorev2.0
GoSupportNode.jsv8
.Net2.1Support
2015 2016 2017 2018
?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Managed Runtimes
+
Lambda support for Ruby 2.5
Node.js 6.10
Node.js 8.10
Python 2.7
Python 3.6
Python 3.7
Go 1.x .Net Core 1.0 (C#)
.Net Core 2.0 (C#)
.Net Core 2.1 (C#/PowerShell)
Java 8
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Programming Model
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Custom Runtimes
• Bring any Linux compatible language
runtime
• Powered by new Runtime API - Codifies
the runtime calling conventions and
integration points
• Same technology powering Ruby support
in AWS Lambda
o f f e r e d b y
o f f e r e d b y
o f f e r e d b y
o f f e r e d b y
Partner Sponsored
Partner Sponsored
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Lambda Layers
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
Before
Extend the Lambda
execution environment
with any binaries,
dependencies, or
runtimes
BUSINESS
LOGIC
BUSINESS
LOGIC
BUSINESS
LOGIC
BUSINESS
LOGIC
LIB
A
LIB
B
After
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Lambda Layers – AWS SAM Support
Serverless Application Model
(SAM)
AWS::Serverless::LayerVersion resource
creates new Lambda Layer from local
filesystem or S3 URI
Layers can also be restricted to certain
Runtimes (CompatibleRuntimes
property)
SAM CLI 0.8.1+ supports Layers locally
and remotely (ARN)
BashRuntime:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: bash-sam
Description: Bash Runtime FWIW
ContentUri: bash_runtime
LicenseInfo: 'MIT-0 license’
RetentionPolicy: Retain
CompatibleRuntimes: [List]
HelloBashFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: bash_hello
Handler: hello.handler
Runtime: provided
Layers:
- !Ref BashRuntime
- <LayerTwoArn>
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless Application Repository
Benefits
• Managed artefact repository for
serverless applications with support
for AWS Serverless Application
Model (SAM) and semantic versioning
• Lightweight cross-account sharing
and ability to make application public
for anyone’s use
• Reduce deduplication of effort across
teams and foster organisational best
practises
Features
• Full application lifecycle APIs via the
AWS SDK and AWS CLI
• Works with AWS SAM and AWS
CloudFormation to publish and
deploy apps
• Supports AWS Route53, Amazon
CloudFront, AWS Step Functions,
AWS AppSync, Amazon IAM.
• Use AWS resource policies to
privately share apps or make them
public
• Embedded in the AWS Lambda
console for easy discovery
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Nested Applications using SAR
Compose application architectures from reusable
building blocks
• Deploy new architectures as a set of serverless apps (nesting)
• Foster best organizational practices and reduce duplication of effort
• Share components, modules and full applications privately with teams
or publicly with others to improve agility
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Nested Applications support for the SAM
Resources:
TweetLoggerFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: app.process_tweets
Runtime: python3.6
MemorySize: 128
Timeout: 10
CodeUri: src/
TwitterEventSourceApp:
Type: 'AWS::Serverless::Application'
Properties:
Location:
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/aws-serverless-twitter-event-source
SemanticVersion: 1.1.0
Parameters: # Using default value for PollingFrequencyInMinutes (1)
TweetProcessorFunctionName: !Ref TweetLoggerFunction
BatchSize: 20
DecryptionKeyName: !Ref DecryptionKeyName
EncryptedAccessToken: !Ref EncryptedAccessToken
EncryptedAccessTokenSecret: !Ref EncryptedAccessTokenSecret
EncryptedConsumerKey: !Ref EncryptedConsumerKey
EncryptedConsumerSecret: !Ref EncryptedConsumerSecret
SearchText: !Sub '${SearchText} -filter:nativeretweets' # filter out retweet records from search results
TimeoutInMinutes: 20
Your function
Nested SAR App
SAR App Parameters
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon API Gateway
Manage APIs with API Gateway
Mobile Apps
Websites
Services
API
Gateway
Cache
Public Endpoints
on Amazon EC2
Amazon
CloudWatch
Monitoring
All publicly
accessible endpoints
Lambda
Functions
Any other
AWS service
Fully-managed
CloudFront Distribution
Customer-managed
CloudFront
Distribution
HTTPS
Corporate
data center
AWS
Direct Connect
VPC
Endpoints
in VPC
VPC
Applications
& Services
in VPC
Region
Applications & Services
in the same AWS Region
Amazon
API Gateway
Edge-OptimizedRegionalPrivate
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon API Gateway
Manage APIs with API Gateway
Mobile Apps
Websites
Services
Public Endpoints
on Amazon EC2
All publicly
accessible endpoints
Lambda
Functions
Any other
AWS service
Amazon
API Gateway
WebSocketAPI
Chat
Dashboards
AWS IoT
Devices
This new type of API will
enable customers to build
real-time two way
communication
applications backed by
Lambda functions or other
API Gateway integrations.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
https://www.youtube.com/watch?v=3SCdzzD0PdQ
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ALB Support for Lambda
Enables easier transition from existing compute
stacks to Lambda
Mix and match compute options to build your
backends
Robust load balancer controls (health checks,
programmable rules engine, and traffic shaping)
AWS Fargate Amazon EC2
AWS Lambda
Application Load Balancing (ALB)
If you need:
• AuthN/Z,
• request validation
• rate limiting
• SDK generation
• direct AWS service backend…
use Amazon API Gateway.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ALB Support for Lambda
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Workflows
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Step Functions
• Coordinate the components of distributed
applications and microservices using visual
workflows
• Keeps the orchestration out of the code!
• Automatically triggers and tracks each step,
and retries when there are errors
• Logs the state of each step, so when things
do go wrong, you can diagnose and debug
problems quickly
“Serverless” workflow management
with zero administration
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Step Functions
A
B C
A
?
CBA
BA
“I want to retry failed tasks”“I want to sequence tasks” “I want try/catch/finally”
“I want to select tasks based on data” “I want to run tasks in parallel”
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Step Functions API Connectors
Glue AWS services together
without writing code
+ AWS Batch AWS Fargate AWS GlueECS
Amazon
DynamoDB
Amazon SNS Amazon SQS Amazon
SageMaker
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Databases
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Provisioning capacity for DynamoDB
• Sometimes it’s hard to know what’s best
• Estimating how much throughput capacity to provision can
be guesswork
• Not enough experience with app can cause unexpected
extreme app usage
• Spikey traffic can be costly to maintain availability and
performance
• Auto-scaling can cause lag time apps can’t afford HIGH-SCALE
APPLICATIONS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon DynamoDB Read/Write Capacity On Demand
No more capacity planning – pay only for what you use
N o c a p a c i t y p l a n n i n g
N o n e e d t o s p e c i f y h o w
m u c h r e a d / w r i t e
t h r o u g h p u t y o u e x p e c t
t o u s e
P a y o n l y f o r w h a t
y o u u s e
P a y - p e r - r e q u e s t
p r i c i n g
I d e a l f o r u n p r e d i c t a b l e
w o r k l o a d s
R a m p f r o m z e r o t o t e n s
o f t h o u s a n d s o f r e q u e s t s
p e r s e c o n d o n d e m a n d
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
DynamoDB Transactional APIs
• Any item, in any table, in any region
• Simplify your code by executing multiple, all-or-nothing
actions within and across tables with a single API call.
• Simultaneous writes or updates to multiple items.
• Check multiple conditions while executing actions.
• Provides atomicity, consistency, isolation, and durability
(ACID) in DynamoDB.
• You can perform transactions both within and across
multiple DynamoDB tables.
• Native, server-side solution that provides better performance
and lower costs than client-side libraries.
Single
API Call
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
In closing…
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Here are all of new launches!
https://aws.amazon.com/new/reinvent
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Join the conversation
bit.ly/aws-dev-slack
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Thank you!
Go Build, Go Serverless!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Stephen Liedig, Senior Solutions Architect, AWS
March 2019
Application Modernization in a
Serverless World
@sliedigaws
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What is Modern Application
Development?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Modern Application Development
Assess and
prioritize,
app by app
Pick path to
modernization
Lift & shift:
data center → EC2
Re-platform:
VMs → containers
Refactor:
monolith → microservices
Re-invent:
host fleets → serverless
A journey with many paths
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Approaches to Modern Application Development
• Simplify environment management
• Reduce the impact of code changes
• Automate operations
• Accelerate the delivery of new, high-quality services
• Gain insight across resources and applications
• Protect customers and the business
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Approaches to Modern Application Development
• Simplify environment management with serverless technologies
• Reduce the impact of code changes with microservice architectures
• Automate operations by modelling applications & infrastructure as code
• Accelerate the delivery of new, high-quality services with CI/CD
• Gain insight across resources and applications by enabling observability
• Protect customers and the business with end-to-end security & compliance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Development transformation at Amazon: 2001+
2001 2001+
monolithic
application + teams
microservices + 2 pizza teams
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Monolith development lifecycle
developers delivery pipelineapp
monitorreleasetestbuild
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Microservice development lifecycle
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
developers delivery pipelineservices
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What changes do you need to make to adopt these best practices?
Serverless
No provisioning/management
Automatic scaling
Pay for value billing
Availability and resiliency
Microservices
Componentization
Business capabilities
Products not projects
Infrastructure automation
DevOps
Cultural philosophies
Cross-disciplinary teams
CI/CD
Automation tools
DEV OPS
Architectural
patterns
Operational
Model
Software
Delivery
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless
where possiblearchitectures
Event Driven
delivering
business value
Focus
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Approaches to modern application development
• Simplify environment management with serverless technologies
• Reduce the impact of code changes with microservice architectures
• Automate operations by modelling applications & infrastructure as code
• Accelerate the delivery of new, high-quality services with CI/CD
• Gain insight across resources and applications by enabling observability
• Protect customers and the business with end-to-end security & compliance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What microservices are…
“the microservice architectural style is an approach to developing a single
application as a suite of small services, each running in its own process and
communicating with lightweight mechanisms, often an HTTP resource API.”
- Martin Fowler
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What microservices are…
“Independently deployable services that work together, modelled around a
business domain.”
- Sam Newman
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What microservices are…
“The technical authority for a business capability”
- Udi Dahan
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Balance # services with deployment effortCOSTOREFFORT
NUMBER OF SERVICES
Minimum Cost
Cost to Integrate Cost per Service
https://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/ARC201
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Shipping
Inventory
Customer
Service
Accounts
Returns
Invoicing
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Shipping
Inventory
Customer
Service
?How?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Domain Driven Design
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Domain Driven Design
“Ubiquitous language” - Modelling the
language of the business
Provides guidance about model domains
with entities, value objects, repositories ad
services
Top Tip!
Start reading from chapter 11 - strategic
design vs tactical design
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Bounded Contexts
• Bounded Contexts are an essential
modeling tool in DDD and microservices
• Identify explicit boundaries around our
understanding of the ubiquitous
language and the things people care
about.
• Multiple models for a business concept
https://www.martinfowler.com/bliki/BoundedContext.html
Customer
Ticket
Product
Product
Version
Customer
Product
Territory
Opportunity
Pipeline
Sales
Person
Defect
Sales Context Support Context
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Bounded Contexts
Concept
Contracting with
authors
Managing the
book’s
authorship and
editorial process
Designing the
book layout &
illustrations
Source: Implementing Domain-Driven Design, Vaughn Vernon
Publishing Example: Book model
Translating the
book
Producing the
physical print
and/ or
electronic
editions
Marketing the
book
Selling the book
to resellers and/
or directly to
consumers
Shipping a
physical book to
resellers and
consumer
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Context Maps
Bounded contexts alone don’t provide a global
view of your domain.
Context maps deal with mapping different, but
related, Ubiquitous Languages, by integrating their
Bounded Contexts.
Evans and Vernon describe 7 patterns for
integrating bounded contexts
• Shared Kernel
• Customer / Supplier
• Conformist
• Anticorruption Layer
• Separate Ways
• Open / Host Service
• Published Language
Sales Context Support Context
Marketing Context
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Domain Events
• Objects in a domain that represent that something has happened
• Immutable – cannot change the past
• Should be represented as verbs in the past tense, e.g. “customer_created”
• Light weight, correlated by properties that are common across bounded contexts
“customer_id”
• Pattern for bounded context integration - Publish / Subscribe
• Consider adopting EventStorming as a modelling technique
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Messaging & Integration Patterns
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Managing Dependencies
Loose Coupling / High Cohesion
Encapsulation
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Integration options from AWS
Orchestration
Sequencing
Parallel execution
State management
AWS Step Functions
Eventing
Performance at scale
Fully-managed
Enterprise-ready
Amazon SNS
Messaging
Durable and scalable
Comprehensive security
Query-in-place
Amazon SQS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Using AWS Lambda with Amazon SQS
1. Scheduled
time occurs
2. Lambda
invoked
CloudWatch Events
(time-based)
Queue
3. Pull messages
from queue
CloudWatch Events
(time-based)
4. Pull message
from queue
3. Lambda invoked
n times
2. Execute Step Function
every minute
1. Scheduled
time occurs
Queue Queue
AWS Step Functions workflow
AWS Lambda
AWS Lambda
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon SQS as an Event Source (SQSaaES)
• Lambda polls the queue and when it detects
new messages, it invokes your Lambda function
by passing the messages as a parameter.
• Full control over the queue processing settings
such as visibility timeouts, delay queues, redrive
policy, etc. Supports batch processing.
• Lambda will gradually increase the queue
polling rate as long as queue polling result in
fetching of new messages.
• Supports Identity and Resource based policy
3. Lambda removes
message from
queue
2. Lambda polls queue
and invokes function
1. Message inserted into
to a queue
Queue
AWS Lambda
Amazon Simple
Queue Service
Lambda function
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Subscriber A
Subscriber C
Subscriber B
Publish / Subscribe
• One logical publisher for a given domain event. Fully enforces a consistent
boundary.
• Addresses multiple types of coupling
• Each subscriber can react to
domain events in their own
bounded context
• SNS supports multiple subscription
channels – Lambda, SQS, HTTP/S,
Email, SMS, Mobile Push
Topic
Publisher
Dom
ain
event
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Service A
Service D
Service C
Subscriber B
Mapping events to topics
Grey
Topic
Blue
Topic
Blue
Subscribers
Grey
Each message type is mapped to logical destination
Blue
Blue
Grey
Grey
Lambda function
Publisher
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon SNS Message Filters
• Publishers do not need to route message
• Subscribers do not need to filter for message of interest
• Lowers cost
Colour
TopicPublisher
Subscribers
BlueGrey
Attr=
Grey
Grey
Attr=
Blue
Blue
Filter Policy
Attr=Grey
Filter Policy
Attr=Blue
Service A
Service B
Service C
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Message Filtering Operators
Subscription filter policy
{"sport": ["rugby"]}
matches message attribute
{"sport": "rugby"}
Exact matching on string values
(Whitelisting)
Anything-but matching on string
values (Blacklisting)
Prefix matching on string
values
Exact matching on
numeric values
Range matching on
numeric values
Subscription filter policy
{"sport": [{"anything-but":
"rugby"}]}
matches message attributes such as
{"sport": "baseball"}
and
{"sport": "basketball"}
and
{"sport": "football"}
but not
{"sport": "rugby"}
Subscription filter policy
{"sport": [{"prefix": "bas"}]}
matches message attributes such as
{"sport": "baseball"}
and
{"sport": "basketball"}
Subscription filter policy
{"balance": [{"numeric":
["=", 301.5]}]}
matches message attributes
{"balance": 301.500}
and
{"balance": 3.015e2}
Subscription filter policy
{"balance": [{"numeric":
["<", 0]}]}
matches negative numbers only, and
{"balance": [{"numeric":
[">", 0, "<=", 150]}]}
matches any positive number up to 150.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Coordination by Function Chaining
Lambda function Lambda function Lambda function
Lambda function Lambda function
Lambda function
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Step Functions
• Coordinate the components of distributed
applications and microservices using visual
workflows
• Keeps the orchestration out of the code!
• Ideal for long-running processes and
implementing failure management patterns
and distributed transaction processing
• Automatically triggers and tracks each step,
and retries when there are errors. Support
execution logging
• Logs the state of each step, so when things
do go wrong, you can diagnose and debug
problems quickly
“Serverless” workflow management with
zero administration
"ProcessOrder": {
"Comment": ”t1”
"Type": "Task",
"Resource": "${NewOrderFunction.Arn}",
"TimeoutSeconds": 10,
"Catch": [{
"ErrorEquals": ["ErrProcessOrder"],
"ResultPath": "$.error",
"Next": "UpdateOrderStatus"
}],
"Next": "ProcessPayment"
},
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Step Functions
A
B C
A
?
CBA
BA
“I want to retry failed tasks”“I want to sequence tasks” “I want try/catch/finally”
“I want to select tasks based on data” “I want to run tasks in parallel”
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Step Functions API Connectors
Glue AWS services together
without writing code
+ AWS Batch AWS Fargate AWS GlueECS
Amazon
DynamoDB
Amazon SNS Amazon SQS Amazon
SageMaker
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Nested Apps using Serverless Application Repository
Compose application architectures from
reusable building blocks
• Serverless architectures deployed as a set of nested
applications
• Foster best organizational practices and reduce
duplication of effort
• Share components, modules and full applications
privately with teams or publicly with others to
improve agility
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Storage and backup (nested serverless application)
Common Patterns Emerge
Fork-pattern-
backup-queue
Fork-pattern-
backup-function
Fork-pattern-
backup-bucket
Search and analytics (nested serverless application)
Fork-pattern-
index-queue
Fork-pattern-
index-function
Fork-pattern-
index-table
polls saves
polls saves
publishes
publishes
Serverless Application
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Messaging and integration patterns
Event Store (nested app)
polls saves
publisher Amazon
SNS
publishes
Subscriber B
AWS Step Functions workflow
Domain
Event
Domain
Event
Domain
Event
Amazon
SQS
workerclient
DLQ
saves
Command
Decoupled Messaging Publish / Subscribe
Service A (Bounded Context)
publishes
Domain
Event
queue
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Approaches to Modern Application Development
• Simplify environment management with serverless technologies
• Reduce the impact of code changes with microservice architectures
• Automate operations by modelling applications & infrastructure as code
• Accelerate the delivery of new, high-quality services with CI/CD
• Gain insight across resources and applications by enabling observability
• Protect customers and the business with end-to-end security & compliance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Serverless Application Model (SAM)
Model function environments with SAM
• Open source framework for building serverless applications on AWS
• Shorthand syntax to express functions, APIs, databases, and event
source mappings
• Transforms and expands SAM syntax into AWS CloudFormation syntax
on deployment
• Supports all AWS CloudFormation resource types
https://aws.amazon.com/serverless/sam/
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.get
Runtime: nodejs8.10
CodeUri: src/
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MyTable
Events:
GetResource:
Type: Api
Properties:
Path: /resource/{resourceId}
Method: get
MyTable:
Type: AWS::Serverless::SimpleTable
Just 20 lines to create:
• Lambda function
• IAM role
• API Gateway
• DynamoDB table
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Use SAM CLI to package and deploy SAM templates
Install:
pip install --user aws-sam-cli
Commands:
sam logs
sam validate
sam local [generate-event | invoke | start-api | start-lambda]
sam init
sam build
sam package
sam deploy
sam publish
New
CodePipeline
Jenkins
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SAM CLI sample workflow
sam init --name my-function --runtime python
cd my-function/
sam build
sam package --s3-bucket my-packages-bucket 
--output-template-file packaged.yaml
sam deploy --template-file packaged.yaml 
--stack-name my-function-prod
sam publish # To the AWS Serverless Application Repository
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS CodeBuild
• Fully managed build service that compiles source
code, runs tests, and produces software packages
• Scales continuously and processes multiple builds
concurrently
• No build servers to manage
• Pay by the minute, only for the compute resources
you use
• Monitor builds through CloudWatch Events
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS CodeBuild
• Each build runs in a new Docker container for a
consistent, immutable environment
• Docker and AWS CLI are installed in every official
CodeBuild image
• Provide custom build environments suited to your
needs through the use of Docker images
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS CodeBuild: Lambda buildspec
version: 0.2
phases:
build:
commands:
- npm ci
- npm test
- >
aws cloudformation package
--template-file template.yml
--output-template template-output.yml
--s3_bucket $BUCKET
artifacts:
type: zip
files:
- template-output.yml
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Cloud Development Kit (CDK)
• Open source framework to define cloud infrastructure in C#/.NET, Java, JavaScript, or
TypeScript
• Provides library of higher-level resource types (“construct” classes) that have AWS best
practices built in by default, packaged as npm modules
• Provisions resources with CloudFormation
• Supports all CloudFormation resource types
Developer
PreviewAWS CDK
https://awslabs.github.io/aws-cdk
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
CDK template
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
class BonjourFargate extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 });
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
new ecs.LoadBalancedFargateService(
this, "FargateService", {
cluster,
image: ecs.DockerHub.image("amazon/amazon-ecs-sample"),
});
}
}
const app = new cdk.App();
new BonjourFargate(app, 'Bonjour');
app.run();
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
CDK template
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
class BonjourFargate extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 });
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
new ecs.LoadBalancedFargateService(
this, "FargateService", {
cluster,
image: ecs.DockerHub.image("amazon/amazon-ecs-sample"),
});
}
}
const app = new cdk.App();
new BonjourFargate(app, 'Bonjour');
app.run();
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
CDK template
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
class BonjourFargate extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 });
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
new ecs.LoadBalancedFargateService(
this, "FargateService", {
cluster,
image: ecs.DockerHub.image("amazon/amazon-ecs-sample"),
});
}
}
const app = new cdk.App();
new BonjourFargate(app, 'Bonjour');
app.run();
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Model pipelines with AWS CDK
• Minimize copy-and-paste by using object-oriented language
• Define microservice pipeline “shape” in one class, then re-use it across many
pipelines
• CDK includes many high-level constructs for modeling a CodePipeline pipeline,
including automatically configuring IAM role policies
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
CDK pipelines: Construct
export class MyMicroservicePipeline extends cdk.Construct {
constructor(parent: cdk.Construct, name: string, props: MyMicroservicePipelineProps) {
super(parent, name);
const pipeline = new codepipeline.Pipeline(this, 'Pipeline', {
pipelineName: props.serviceName,
});
const githubAccessToken = new cdk.SecretParameter(this, 'GitHubToken’,
{ ssmParameter: 'GitHubToken' });
new codepipeline.GitHubSourceAction(this, 'GitHubSource', {
stage: pipeline.addStage('Source’),
owner: 'myorg’,
repo: props.serviceName,
oauthToken: githubAccessToken.value
});
…
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
CDK pipelines: Stack
import cdk = require('@aws-cdk/cdk');
import { MyMicroservicePipeline } from './pipeline';
class MyMicroservicePipelinesStack extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
new MyMicroservicePipeline(this, 'Pipeline1', { 'serviceName': 'Microservice1' });
new MyMicroservicePipeline(this, 'Pipeline2', { 'serviceName': 'Microservice2' });
new MyMicroservicePipeline(this, 'Pipeline3', { 'serviceName': 'Microservice3' });
new MyMicroservicePipeline(this, 'Pipeline4', { 'serviceName': 'Microservice4' });
}
}
const app = new cdk.App();
new MyMicroservicePipelinesStack(app, 'MyMicroservicePipelines');
app.run();
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Use CDK CLI to synthesize and deploy CDK templates
Install:
npm install -g aws-cdk
Commands:
cdk init app --language typescript
cdk synth
cdk deploy
CodePipeline
Jenkins
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What matters?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Modern Application Development
Greater agility
Less overhead
Better focus
Increased scale
More flexibility
Pay for value
What matters?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Modern Application Development
As Developers, what we should be focusing on is what we’re seeing to
be the new way of doing modern application development
• Greatly reduced operational burden
• Tighter alignment to costs w/ usage
• Developers can/could/should be able to do almost anything
• Opinionated platforms that allow for multiple use-cases
• Opinionated platforms that bake in true best of breed practices, security, scale,
performance, cost aspects for you
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Thank you!
Go Build! Go Serverless!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Aileen Gemma Smith, CEO
@aileengemma aileen@vizalytics.com
March, 2019
Vizalytics Technology:
Serverless Trains: TrainLink and Sydney Trains
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
High Level View of the Customer Problem
• Disparate data
• Too much data
• Inconsistent metadata
• Customer teams don’t have necessary skill sets
• Desire for rapid prototyping
• Want to move from being reactive to being proactive
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Our Approach – Quick Start Pilot
• Data audit – help customer understand the potential of their data
• High degree of customer interaction
• Iterative rapid prototyping
• Guide customer to understand value of automated data and
analytics architectures
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless in Production
• Dashboards:
• Amazon S3,
• Amazon APIGateway,
• AWS Lambda
• Ingest:
• Amazon S3,
• AWS Lambda,
• Amazon Kinesis
• Source to Graph Pipeline:
• Amazon S3,
• AWS Lambda,
• Vizalytics proprietary → Amazon SageMaker
• Training:
• Amazon S3,
• AWS Lambda,
• Vizalytics proprietary → Amazon SageMaker
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Sample Architecture
ALB
Vizalytics Sample Architecture
©2019
WEB
VIZ KG PLATFORM
Customer data center
generic database
Periodic Triggers
Visualization
Server
s3-served dashboard UX
Visualization
Server
API Gateway
API Gateway
SQS
RDS
Kinesis Data Stream
S3
S3
EC2 EC2
Sim Cluster
EMR
AWS CloudTrail
Cloudwatch
Spot Fleet
Step Functions
Amazon
Elasticsearch
Service
EC2
SageMaker
Generic Stream
Push
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Quick Segue – Graph Concepts
The Rat Graph
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Min Hour Day
1st
Ave
8th St
1st
Ave
1st
Ave
8th St
9th St
7th St
9th St
7th St
2nd
Ave
2nd
Ave
2nd
Ave
Diane's
Deli
Alice's
Apothecary
Carl's
Cleaners
Bob's
Bodega
Eric's
Enchiladas
Flora's
Flowers
Greg's
Groceries
Helen's
Heros
Spatial Subgraph Temporal Subgraph
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Min Hour Day
1st
Ave
8th St
1st
Ave
1st
Ave
8th St
9th St
7th St
9th St
7th St
2nd
Ave
2nd
Ave
2nd
Ave
Diane's
Deli
Alice's
Apothecary
Carl's
Cleaners
Bob's
Bodega
Eric's
Enchiladas
Flora's
Flowers
Greg's
Groceries
Helen's
Heros
Spatial Subgraph Temporal SubgraphEvent Subgraph
Day
+1
Rat
Infestation
Report
:OCCURRED
:OCCURRED
Day
+7
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Min Hour Day
1st
Ave
8th St
1st
Ave
1st
Ave
8th St
9th St
7th St
9th St
7th St
2nd
Ave
2nd
Ave
2nd
Ave
Diane's
Deli
Alice's
Apothecary
Carl's
Cleaners
Bob's
Bodega
Eric's
Enchiladas
Flora's
Flowers
Greg's
Groceries
Helen's
Heros
Spatial Subgraph Temporal SubgraphEvent Subgraph
Day
+1
Rat
Infestation
Report
:OCCURRED
:OCCURRED
Day
+7
Rat
Infestation
Impact
Event
:IMPACT
:IMPACT
{weight:0.5}
:IMPACT
{weight:1.0}
:IMPACT
{weight:0.8}
:IMPACT
{weight:0.5}
*Note: NO
IMPACT
HERE
:TRIGGERED
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Min Hour Day
1st
Ave
8th St
1st
Ave
1st
Ave
8th St
9th St
7th St
9th St
7th St
2nd
Ave
2nd
Ave
2nd
Ave
Diane's
Deli
Alice's
Apothecary
Carl's
Cleaners
Bob's
Bodega
Eric's
Enchiladas
Flora's
Flowers
Greg's
Groceries
Helen's
Heros
Spatial Subgraph Temporal SubgraphEvent Subgraph
Day
+1
Rat
Infestation
Report
:OCCURRED
:OCCURRED
Day
+7
:IMPACT
Rat
Infestation
Impact
Event
:TRIGGERED
:IMPACT
{weight:0.4}
:IMPACT
{weight:1.0}
:IMPACT
{weight:0.7}
:IMPACT
{weight:0.4}
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Min Hour Day
1st
Ave
8th St
1st
Ave
1st
Ave
8th St
9th St
7th St
9th St
7th St
2nd
Ave
2nd
Ave
2nd
Ave
Diane's
Deli
Alice's
Apothecary
Carl's
Cleaners
Bob's
Bodega
Eric's
Enchiladas
Flora's
Flowers
Greg's
Groceries
Helen's
Heros
Spatial Subgraph Temporal SubgraphEvent Subgraph
Day
+1
Rat
Infestation
Report
:OCCURRED
:OCCURRED
Day
+7
:IMPACT
{weight:0.5}
:IMPACT
{weight:0.1}
:TRIGGERED
Rat
Infestation
Impact
Event
:IMPACT*Note: NO
IMPACT
HERE
*Note: NO
IMPACT
HERE
Day
-1
Day
-7
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Back to Serverless Trains…
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Sample Architecture
ALB
Vizalytics Sample Architecture
©2019
WEB
VIZ KG PLATFORM
Customer data center
generic database
Periodic Triggers
Visualization
Server
s3-served dashboard UX
Visualization
Server
API Gateway
API Gateway
SQS
RDS
Kinesis Data Stream
S3
S3
EC2 EC2
Sim Cluster
EMR
AWS CloudTrail
Cloudwatch
Spot Fleet
Step Functions
Amazon
Elasticsearch
Service
EC2
SageMaker
Generic Stream
Push
Real Time
Vehicle Position
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless Processes – Real Time Position Data
Raw Data SQS Training DataRaw CaptureStep FunctionCloudWatch Graph Import Create Training DataViz KG
1 Minute Event
15 Second Trigger
15 Second Trigger
Request API Update
VehPos Response
Serialized VehPos
Data
Data Available Trigger
VehPos Data Insert
Augmented Data Insert
foreach
complete trip
trip_id
Complete Trip
Available Message
Query KG
Training Vectors
…
RT Position System
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Example - Delay Pattern Recognition
What kind of delays are we classifying?
Why is it important to the user?
• Is it track-segment related?
• Is it equipment related?
• Is it likely to impact future trips on these tracks?
• Will there be knock on delays to other trips (on other tracks)?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Sample Architecture
ALB
Vizalytics Sample Architecture
©2019
WEB
VIZ KG PLATFORM
Customer data center
generic database
Periodic Triggers
Visualization
Server
s3-served dashboard UX
Visualization
Server
API Gateway
API Gateway
SQS
RDS
Kinesis Data Stream
S3
S3
EC2 EC2
Sim Cluster
EMR
AWS CloudTrail
Cloudwatch
Spot Fleet
Step Functions
Amazon
Elasticsearch
Service
EC2
SageMaker
Generic Stream
Push
D
elay
C
haracterization
Training
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless Processes – Training/Retraining
Housekeeping
Check Data Start Training
Check Training Progress
Wait
Deploy Model
Cloudwatch
Step Functions
START
END
New Data
Available
Training Period Trigger
e.g. 24 hours
Training
Complete
Training
Not CompleteNo Data
Available
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Model Training
• Rolling window of scheduled vs actual performance (e.g., last 12 months)
• Why continually retrain?
• Equipment and infrastructure changes and evolves
• Ridership is not constant
• Data sets evolve
• At simplest level, use only the delay data (In practice, particularly for
classification/regression-type models, context is important (weather,
events, day of week, time of day, season, etc.)
• 2 Vectors of data:
• Delay Profile – the deviation at each reporting point
!"#$%&$'0 − *+ℎ$'-.$'0 , (!"#$%&$'1 − *+ℎ$'-.$'1 , … (!"#$%&$'3 − *+ℎ$'-.$'3)]
• Delay Change – the difference in delay at each reporting point
6$.781 − 6$.780 , (6$.782 − 6$.781 , … (6$.783 − 6$.783 − 1)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Delay Calculation
!"#$%&$'0 − *+ℎ$'-.$'0 , (!"#$%&$'1 − *+ℎ$'-.$'1 , … (!"#$%&$'3 − *+ℎ$'-.$'3)]
[30, 30, 45, 30, 36, 42, 480, 480, 430, 430, 435, 430, 450, 480, 470, 480, 500, 460, 480]
6$.781 − 6$.780 , (6$.782 − 6$.781 , … (6$.783 − 6$.783 − 1)]
[30, 0, 15, -15, 6, 6, 438, 0, -50, 20, -20, 0, 5, -5, 20, 30, -10, 10, 20, -40, 20]
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda – Start a Training Run
import os
import boto3
CONTAINER = '712309505854.dkr.ecr.ap-southeast-2.amazonaws.com’
REGISTRY_PATH = '{}/kmeans:1'.format(CONTAINER)
SAGEMAKER_ROLE = os.environ['SAGEMAKER_ROLE']
TRAINING_INSTANCE_TYPE = os.environ['TRAINING_INSANCE_TYPE']
MANIFEST_TEMPLATE = 's3://{training_bucket}/training_data_{training_date}.manifest’
sagemaker = boto3.client('sagemaker')
def lambda_handler(event, context):
try:
k = event['k'] # number of clusters
output_bucket = event['output_bucket']
name = event['name']
route = event['route']
training_bucket = event['training_bucket']
training_date = event['training_date']
manifest = MANIFEST_TEMPLATE.format(training_bucket=training_bucket, training_date=training_date)
s3_output_path = 's3://{output_bucket}/{route}/training_output_{training_date}'.format(output_bucket=output_bucket,
route=route,
training_date=training_date)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda – Start a Training Run (cont’d)
response = sagemaker.create_training_job(
TrainingJobName=name,
HyperParameters={
'k': k,
'init_method': 'kmeans++',
},
AlgorithmSpecification={
'TrainingImage': CONTAINER,
'TrainingInputMode': 'File’
},
RoleArn=SAGEMAKER_ROLE,
InputDataConfig=[
{
'ChannelName': 'train',
'DataSource': {
'S3DataSource': {
'S3DataType': 'ManifestFile',
'S3Uri': manifest
}
},
'ContentType': 'text/csv',
'CompressionType': 'None'
}
],
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda – Start a Training Run (cont’d)
OutputDataConfig={
'S3OutputPath': s3_output_path
},
ResourceConfig={
‘InstanceType': TRAINING_INSTANCE_TYPE,
'InstanceCount': 1,
'VolumeSizeInGB': 50
},
StoppingCondition={
'MaxRuntimeInSeconds': 86400
}
)
print('Successfully created training job: response = {}'.format(response))
except Exception as e:
print(e)
print('Unable to create training job.')
raise(e)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda – Deploy the Model
sagemaker = boto3.client('sagemaker')
model_name = event['model_name']
endpoint = event['endpoint']
try:
sagemaker.create_endpoint_config(
EndpointConfigName=name,
ProductionVariants=[
{
'VariantName': 'PROD',
'ModelName': name,
'InitialInstanceCount': 1,
'InstanceType': INSTANCE_TYPE
}
]
)
sagemaker.create_endpoint(
EndpointName=endpoint_name,
EndpointConfigName=config_name
)
except Exception as e:
print(e)
print('Unable to create endpoint configuration.')
raise(e)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda – Invoke the Model
import os
import io
import boto3
import json
ENDPOINT_NAME = os.environ['ENDPOINT_NAME']
runtime= boto3.client('runtime.sagemaker')
DELAY_CLUSTER_NAMES = [ 'SPOT', 'INCREASING', '...']
def lambda_handler(event, context):
data = json.loads(json.dumps(event))
payload = data['data']
##
## e.g.
## [30, 30, 45, 30, 36, 42, 480, 480, 430, 430, 435, 430, 450, 480, 470, 480, 500, 460, 480]
##
response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME,
ContentType='text/csv',
Body=payload)
result = json.loads(response['Body'].read().decode())
cluster = int(result['predictions'][0]['closest_cluster'])
distance = result['predictions'][0]['distance_to_cluster'])
cluster_name = DELAY_CLUSTER_NAMES[cluster]
return json.dumps({"cluster_name": cluster_name})
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Dashboard in Action
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
• K-means *
• K-pod †
• DBSCAN †
• EM Clustering †
• Random Forest * †
• XG Boost †
• FPGrowth †
• Association Rules †
• Linear Learning †
• Deep AR *
• Page Rank †
• Triangle Counting †
• Collaborative
Filtering †
Content
AnalyticsGraph Analytics
• Named Entity
Extraction †
• Amazon
Comprehend
• Amazon
Rekognition
• Amazon Translate
• Neural Topic
Modeling *
Behind the scenes – Machine Learning
Clustering
Classifiers /
Regression
Sequence / Time
Series
*Amazon Sagemaker Implementation
†Vizalytics Implementation
Built on AWS EC2 and AWS Serverless Technologies
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
• Customer volume
prediction
• Historical insights
• Operational planning
• Marketing support
• Operational support
• Route planning
• Real time insights
• Site selection
• Zoning
• Urban planning
Intelligent Decision
Support
• Contextual decision
support
• Recommendations
• Historical data retrieval
Transit Schedules · Live Transit · People Movement · Weather · Permits · Point of Sale
Events · Traffic · Business Listings · GIS · Open Government Data · Zoning · After Action Reports
Internal Company Data · Unstructured Content · Operations Archives · News Feeds
TransitTourism
Economic
Development
Vizalytics Knowledge Graph Platform
Built on AWS EC2 and AWS Serverless Technologies
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Thank You! Let’s keep talking.
Aileen Gemma Smith, CEO Vizalytics Technology –
Email: aileen@vizalytics.com
Twitter: @aileengemma
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Cloud Conformity
27 March 2019
Scaling Serverless
How serverless scales to perform over 200
million well-architected checks a day
@MikeRahmati @PaulSecurityAWS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless at Scale – Cloud Conformity by Numbers
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Step Functions Lambda
Collect AWS metadata
information
DynamoDB
SQS
SNS
S3
Elasticsearch
Customer AWS Account
Update Inventory
Rule Engine
Notify UserUser
AWS Resources
Encrypt data at rest, data in transit and data in use
Cloud Conformity – Reference Architecture for Serverless
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Conformity Bot V1 (Monolithic)
Collect AWS metadata information
Update Inventory
Run Well Architected
Notify User
AWS Step Functions Lambda
Collect AWS metadata
information
Update Inventory Run Well Architected Notify User
Conformity Bot V2 (Single purpose functions)
Evolution of Serverless – Monolithic vs Single Purpose Functions
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless Monitoring
Charts reflect, over 5 minute intervals duration, errors, number of invocations and
memory used vs memory provisioned for Lambda functions at scale. Memory usage is
an essential metric for cost optimization.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless Best Practice
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Enhanced CI/CD Pipeline for Serverless
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
DynamoDB Scaling Challenges
Note actual reads exceed provisioned reads leading to throttling. Not too that scaling
happens after burst event and not immediately.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Securing Serverless
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
The Cost of Serverless
Legend: Percentage of cost by service for the Cloud Conformity Serverless stack
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
References
Cloud Conformity - https://www.cloudconformity.com/
AWS Well-Architected Framework - https://aws.amazon.com/architecture/well-
architected/
AWS Lens for Serverless - https://d1.awsstatic.com/whitepapers/architecture/AWS-
Serverless-Applications-Lens.pdf
Cloud Conformity Knowledge Base -
https://www.cloudconformity.com/conformity-rules/
Cloud Formation Template Scanning - https://blog.cloudconformity.com/cloud-
conformitys-cloudformation-template-scanner-how-it-works-278d1209f2a9
Open source auto-remediation project -
https://github.com/cloudconformity/auto-remediate
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Q&A
Mike Rahmati CTO
Paul Hortop Head of Security
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Thank you!

Contenu connexe

Tendances

Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019AWS Summits
 
Resiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the CloudResiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the CloudAmazon Web Services
 
Deriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML ArchitecturesDeriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML ArchitecturesAmazon Web Services
 
Architecting Security & Governance Across Your AWS Landing Zone
Architecting Security & Governance Across Your AWS Landing ZoneArchitecting Security & Governance Across Your AWS Landing Zone
Architecting Security & Governance Across Your AWS Landing ZoneAmazon Web Services
 
Scalable serverless architectures using event-driven design - MAD301 - Atlant...
Scalable serverless architectures using event-driven design - MAD301 - Atlant...Scalable serverless architectures using event-driven design - MAD301 - Atlant...
Scalable serverless architectures using event-driven design - MAD301 - Atlant...Amazon Web Services
 
From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019AWS Summits
 
從業人員指南-如何像技術專家一樣守護您的雲端安全
從業人員指南-如何像技術專家一樣守護您的雲端安全從業人員指南-如何像技術專家一樣守護您的雲端安全
從業人員指南-如何像技術專家一樣守護您的雲端安全Amazon Web Services
 
AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程Amazon Web Services
 
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019Amazon Web Services
 
Programming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKProgramming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKDonnie Prakoso
 
Simplify Your Front End Apps with Serverless Backend in the Cloud.
Simplify Your Front End Apps with Serverless Backend in the Cloud.Simplify Your Front End Apps with Serverless Backend in the Cloud.
Simplify Your Front End Apps with Serverless Backend in the Cloud.Amazon Web Services
 
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...AWS Summits
 
Building-Modern-Distributed-Applications
Building-Modern-Distributed-ApplicationsBuilding-Modern-Distributed-Applications
Building-Modern-Distributed-ApplicationsAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSCobus Bernard
 
Breaking down monoliths - DEM04 - Atlanta AWS Summit
Breaking down monoliths - DEM04 - Atlanta AWS SummitBreaking down monoliths - DEM04 - Atlanta AWS Summit
Breaking down monoliths - DEM04 - Atlanta AWS SummitAmazon Web Services
 
Essential capabilities behind Microservices
Essential capabilities behind MicroservicesEssential capabilities behind Microservices
Essential capabilities behind MicroservicesAmazon Web Services
 

Tendances (19)

Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 
Resiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the CloudResiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the Cloud
 
Breaking down the Monowhat
Breaking down the MonowhatBreaking down the Monowhat
Breaking down the Monowhat
 
Deriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML ArchitecturesDeriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML Architectures
 
Architecting Security & Governance Across Your AWS Landing Zone
Architecting Security & Governance Across Your AWS Landing ZoneArchitecting Security & Governance Across Your AWS Landing Zone
Architecting Security & Governance Across Your AWS Landing Zone
 
Scalable serverless architectures using event-driven design - MAD301 - Atlant...
Scalable serverless architectures using event-driven design - MAD301 - Atlant...Scalable serverless architectures using event-driven design - MAD301 - Atlant...
Scalable serverless architectures using event-driven design - MAD301 - Atlant...
 
From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019
 
從業人員指南-如何像技術專家一樣守護您的雲端安全
從業人員指南-如何像技術專家一樣守護您的雲端安全從業人員指南-如何像技術專家一樣守護您的雲端安全
從業人員指南-如何像技術專家一樣守護您的雲端安全
 
AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程
 
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
 
Programming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKProgramming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDK
 
Simplify Your Front End Apps with Serverless Backend in the Cloud.
Simplify Your Front End Apps with Serverless Backend in the Cloud.Simplify Your Front End Apps with Serverless Backend in the Cloud.
Simplify Your Front End Apps with Serverless Backend in the Cloud.
 
Deep Dive - CI/CD on AWS
Deep Dive - CI/CD on AWSDeep Dive - CI/CD on AWS
Deep Dive - CI/CD on AWS
 
.NET on AWS
.NET on AWS.NET on AWS
.NET on AWS
 
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
 
Building-Modern-Distributed-Applications
Building-Modern-Distributed-ApplicationsBuilding-Modern-Distributed-Applications
Building-Modern-Distributed-Applications
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
Breaking down monoliths - DEM04 - Atlanta AWS Summit
Breaking down monoliths - DEM04 - Atlanta AWS SummitBreaking down monoliths - DEM04 - Atlanta AWS Summit
Breaking down monoliths - DEM04 - Atlanta AWS Summit
 
Essential capabilities behind Microservices
Essential capabilities behind MicroservicesEssential capabilities behind Microservices
Essential capabilities behind Microservices
 

Similaire à AWS Serverless Webinar- Unleash Innovation & Build Modern Application

Hosting .NET Applications on AWS - AWS Federal Pop-Up Loft
Hosting .NET Applications on AWS  - AWS Federal Pop-Up LoftHosting .NET Applications on AWS  - AWS Federal Pop-Up Loft
Hosting .NET Applications on AWS - AWS Federal Pop-Up LoftAmazon Web Services
 
DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayAmazon Web Services
 
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...Amazon Web Services
 
AWS Lambda updates from re:Invent
AWS Lambda updates from re:InventAWS Lambda updates from re:Invent
AWS Lambda updates from re:InventBoaz Ziniman
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API GatewayAmazon Web Services
 
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...Amazon Web Services
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Amazon Web Services
 
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...Amazon Web Services
 
Microsoft Workloads on AWS
Microsoft Workloads on AWSMicrosoft Workloads on AWS
Microsoft Workloads on AWSSourceFuse
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...AWS Germany
 
Solution-Lab-Serverless-Web-Application
Solution-Lab-Serverless-Web-ApplicationSolution-Lab-Serverless-Web-Application
Solution-Lab-Serverless-Web-ApplicationAmazon Web Services
 
Cloud Migration Insights Forum, Sydney
Cloud Migration Insights Forum, SydneyCloud Migration Insights Forum, Sydney
Cloud Migration Insights Forum, SydneyAmazon Web Services
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWSAmazon Web Services
 
Improve productivity with Continuous Integration & Delivery
Improve productivity with Continuous Integration & DeliveryImprove productivity with Continuous Integration & Delivery
Improve productivity with Continuous Integration & DeliveryAmazon Web Services
 
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...Amazon Web Services
 
Modern Application Development for Startups
Modern Application Development for StartupsModern Application Development for Startups
Modern Application Development for StartupsDonnie Prakoso
 
How to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStarHow to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStarAmazon Web Services
 
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019Amazon Web Services
 

Similaire à AWS Serverless Webinar- Unleash Innovation & Build Modern Application (20)

Hosting .NET Applications on AWS - AWS Federal Pop-Up Loft
Hosting .NET Applications on AWS  - AWS Federal Pop-Up LoftHosting .NET Applications on AWS  - AWS Federal Pop-Up Loft
Hosting .NET Applications on AWS - AWS Federal Pop-Up Loft
 
DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon Way
 
Re cap2018
Re cap2018Re cap2018
Re cap2018
 
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
 
AWS Lambda updates from re:Invent
AWS Lambda updates from re:InventAWS Lambda updates from re:Invent
AWS Lambda updates from re:Invent
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API Gateway
 
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
 
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
 
Microsoft Workloads on AWS
Microsoft Workloads on AWSMicrosoft Workloads on AWS
Microsoft Workloads on AWS
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
 
Solution-Lab-Serverless-Web-Application
Solution-Lab-Serverless-Web-ApplicationSolution-Lab-Serverless-Web-Application
Solution-Lab-Serverless-Web-Application
 
Cloud Migration Insights Forum, Sydney
Cloud Migration Insights Forum, SydneyCloud Migration Insights Forum, Sydney
Cloud Migration Insights Forum, Sydney
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWS
 
Improve productivity with Continuous Integration & Delivery
Improve productivity with Continuous Integration & DeliveryImprove productivity with Continuous Integration & Delivery
Improve productivity with Continuous Integration & Delivery
 
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
 
Modern Application Development for Startups
Modern Application Development for StartupsModern Application Development for Startups
Modern Application Development for Startups
 
How to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStarHow to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStar
 
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 
Microservices for Startups
Microservices for StartupsMicroservices for Startups
Microservices for Startups
 

Plus de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Plus de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

AWS Serverless Webinar- Unleash Innovation & Build Modern Application

  • 1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What's new with Serverless Speaker: Stephen Liedig (AWS) Application Modernisation in a Serverless World Speaker: Stephen Liedig (AWS) Serverless Trains: TrainLink and Sydney Trains Speaker: Aileen Gemma Smith (Vizalytics) How serverless scales to perform over 200 million well-architected checks a day Speaker: Paul Hortop and Mike Rahmati (Cloud Conformity) AWS Serverless Webinar: Unleash Innovation & Build Modern Applications
  • 2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Stephen Liedig, Senior Solutions Architect, AWS March 2019 What’s new with Serverless @sliedigaws
  • 3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Table of contents • Compute • IDE • Languages • Programming Model • Workflows • Databases
  • 4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark The broadest and deepest cloud platform
  • 5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Compute
  • 6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Running Containers & Serverless at scale Different security boundaries than instances Inefficient resource utilization
  • 7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Firecracker MicroVM • Firecracker microVMs have the same security as KVM VMs • Designed for low overhead, high density, and fast start times • Built-in fair sharing
  • 8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark IDEs Languages WorkflowsProgramming Model Everyone wants to just focus on business logic in Serverless
  • 9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark IDEs
  • 10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark New IDE Support G E N E R A L L Y A V A I L A B L E A W S C l o u d 9 AWS Toolkit for PyCharm G E N E R A L L Y A V A I L A B L E AWS Toolkit for IntelliJ I N D E V E L O P E R P R E V I E W AWS Toolkit for VS Code I N D E V E L O P E R P R E V I E W O p e n s o u r c e t o o l k i t s m e e t i n g y o u w h e r e a n d h o w y o u l i k e t o w o r k AWS Toolkits for popular IDEs + Cloud IDEs
  • 11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Languages
  • 12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Lambda release history *As of October 2018, does not include region launches LambdaPreviewAnnouncement re:Invent2014 Python2.7Support JavaSupport Node4.2Support C#.NetSupport Python3.6 Node.js6.10 .NetCorev2.0 GoSupportNode.jsv8 .Net2.1Support 2015 2016 2017 2018 ?
  • 13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Managed Runtimes + Lambda support for Ruby 2.5 Node.js 6.10 Node.js 8.10 Python 2.7 Python 3.6 Python 3.7 Go 1.x .Net Core 1.0 (C#) .Net Core 2.0 (C#) .Net Core 2.1 (C#/PowerShell) Java 8
  • 14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Programming Model
  • 15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Custom Runtimes • Bring any Linux compatible language runtime • Powered by new Runtime API - Codifies the runtime calling conventions and integration points • Same technology powering Ruby support in AWS Lambda o f f e r e d b y o f f e r e d b y o f f e r e d b y o f f e r e d b y Partner Sponsored Partner Sponsored
  • 16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Lambda Layers BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B Before Extend the Lambda execution environment with any binaries, dependencies, or runtimes BUSINESS LOGIC BUSINESS LOGIC BUSINESS LOGIC BUSINESS LOGIC LIB A LIB B After
  • 17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Lambda Layers – AWS SAM Support Serverless Application Model (SAM) AWS::Serverless::LayerVersion resource creates new Lambda Layer from local filesystem or S3 URI Layers can also be restricted to certain Runtimes (CompatibleRuntimes property) SAM CLI 0.8.1+ supports Layers locally and remotely (ARN) BashRuntime: Type: AWS::Serverless::LayerVersion Properties: LayerName: bash-sam Description: Bash Runtime FWIW ContentUri: bash_runtime LicenseInfo: 'MIT-0 license’ RetentionPolicy: Retain CompatibleRuntimes: [List] HelloBashFunction: Type: AWS::Serverless::Function Properties: CodeUri: bash_hello Handler: hello.handler Runtime: provided Layers: - !Ref BashRuntime - <LayerTwoArn>
  • 18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Application Repository Benefits • Managed artefact repository for serverless applications with support for AWS Serverless Application Model (SAM) and semantic versioning • Lightweight cross-account sharing and ability to make application public for anyone’s use • Reduce deduplication of effort across teams and foster organisational best practises Features • Full application lifecycle APIs via the AWS SDK and AWS CLI • Works with AWS SAM and AWS CloudFormation to publish and deploy apps • Supports AWS Route53, Amazon CloudFront, AWS Step Functions, AWS AppSync, Amazon IAM. • Use AWS resource policies to privately share apps or make them public • Embedded in the AWS Lambda console for easy discovery
  • 19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Nested Applications using SAR Compose application architectures from reusable building blocks • Deploy new architectures as a set of serverless apps (nesting) • Foster best organizational practices and reduce duplication of effort • Share components, modules and full applications privately with teams or publicly with others to improve agility
  • 20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Nested Applications support for the SAM Resources: TweetLoggerFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: app.process_tweets Runtime: python3.6 MemorySize: 128 Timeout: 10 CodeUri: src/ TwitterEventSourceApp: Type: 'AWS::Serverless::Application' Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/aws-serverless-twitter-event-source SemanticVersion: 1.1.0 Parameters: # Using default value for PollingFrequencyInMinutes (1) TweetProcessorFunctionName: !Ref TweetLoggerFunction BatchSize: 20 DecryptionKeyName: !Ref DecryptionKeyName EncryptedAccessToken: !Ref EncryptedAccessToken EncryptedAccessTokenSecret: !Ref EncryptedAccessTokenSecret EncryptedConsumerKey: !Ref EncryptedConsumerKey EncryptedConsumerSecret: !Ref EncryptedConsumerSecret SearchText: !Sub '${SearchText} -filter:nativeretweets' # filter out retweet records from search results TimeoutInMinutes: 20 Your function Nested SAR App SAR App Parameters
  • 21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon API Gateway Manage APIs with API Gateway Mobile Apps Websites Services API Gateway Cache Public Endpoints on Amazon EC2 Amazon CloudWatch Monitoring All publicly accessible endpoints Lambda Functions Any other AWS service Fully-managed CloudFront Distribution Customer-managed CloudFront Distribution HTTPS Corporate data center AWS Direct Connect VPC Endpoints in VPC VPC Applications & Services in VPC Region Applications & Services in the same AWS Region Amazon API Gateway Edge-OptimizedRegionalPrivate
  • 22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon API Gateway Manage APIs with API Gateway Mobile Apps Websites Services Public Endpoints on Amazon EC2 All publicly accessible endpoints Lambda Functions Any other AWS service Amazon API Gateway WebSocketAPI Chat Dashboards AWS IoT Devices This new type of API will enable customers to build real-time two way communication applications backed by Lambda functions or other API Gateway integrations.
  • 23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark https://www.youtube.com/watch?v=3SCdzzD0PdQ
  • 24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ALB Support for Lambda Enables easier transition from existing compute stacks to Lambda Mix and match compute options to build your backends Robust load balancer controls (health checks, programmable rules engine, and traffic shaping) AWS Fargate Amazon EC2 AWS Lambda Application Load Balancing (ALB) If you need: • AuthN/Z, • request validation • rate limiting • SDK generation • direct AWS service backend… use Amazon API Gateway.
  • 25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ALB Support for Lambda
  • 26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Workflows
  • 27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Step Functions • Coordinate the components of distributed applications and microservices using visual workflows • Keeps the orchestration out of the code! • Automatically triggers and tracks each step, and retries when there are errors • Logs the state of each step, so when things do go wrong, you can diagnose and debug problems quickly “Serverless” workflow management with zero administration
  • 28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Step Functions A B C A ? CBA BA “I want to retry failed tasks”“I want to sequence tasks” “I want try/catch/finally” “I want to select tasks based on data” “I want to run tasks in parallel”
  • 29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Step Functions API Connectors Glue AWS services together without writing code + AWS Batch AWS Fargate AWS GlueECS Amazon DynamoDB Amazon SNS Amazon SQS Amazon SageMaker
  • 30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Databases
  • 31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Provisioning capacity for DynamoDB • Sometimes it’s hard to know what’s best • Estimating how much throughput capacity to provision can be guesswork • Not enough experience with app can cause unexpected extreme app usage • Spikey traffic can be costly to maintain availability and performance • Auto-scaling can cause lag time apps can’t afford HIGH-SCALE APPLICATIONS
  • 32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon DynamoDB Read/Write Capacity On Demand No more capacity planning – pay only for what you use N o c a p a c i t y p l a n n i n g N o n e e d t o s p e c i f y h o w m u c h r e a d / w r i t e t h r o u g h p u t y o u e x p e c t t o u s e P a y o n l y f o r w h a t y o u u s e P a y - p e r - r e q u e s t p r i c i n g I d e a l f o r u n p r e d i c t a b l e w o r k l o a d s R a m p f r o m z e r o t o t e n s o f t h o u s a n d s o f r e q u e s t s p e r s e c o n d o n d e m a n d
  • 33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark DynamoDB Transactional APIs • Any item, in any table, in any region • Simplify your code by executing multiple, all-or-nothing actions within and across tables with a single API call. • Simultaneous writes or updates to multiple items. • Check multiple conditions while executing actions. • Provides atomicity, consistency, isolation, and durability (ACID) in DynamoDB. • You can perform transactions both within and across multiple DynamoDB tables. • Native, server-side solution that provides better performance and lower costs than client-side libraries. Single API Call
  • 34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark In closing…
  • 35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Here are all of new launches! https://aws.amazon.com/new/reinvent
  • 36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Join the conversation bit.ly/aws-dev-slack
  • 37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank you! Go Build, Go Serverless!
  • 38. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Stephen Liedig, Senior Solutions Architect, AWS March 2019 Application Modernization in a Serverless World @sliedigaws
  • 39. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What is Modern Application Development?
  • 40. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Modern Application Development Assess and prioritize, app by app Pick path to modernization Lift & shift: data center → EC2 Re-platform: VMs → containers Refactor: monolith → microservices Re-invent: host fleets → serverless A journey with many paths
  • 41. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Approaches to Modern Application Development • Simplify environment management • Reduce the impact of code changes • Automate operations • Accelerate the delivery of new, high-quality services • Gain insight across resources and applications • Protect customers and the business
  • 42. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Approaches to Modern Application Development • Simplify environment management with serverless technologies • Reduce the impact of code changes with microservice architectures • Automate operations by modelling applications & infrastructure as code • Accelerate the delivery of new, high-quality services with CI/CD • Gain insight across resources and applications by enabling observability • Protect customers and the business with end-to-end security & compliance
  • 43. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Development transformation at Amazon: 2001+ 2001 2001+ monolithic application + teams microservices + 2 pizza teams
  • 44. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Monolith development lifecycle developers delivery pipelineapp monitorreleasetestbuild
  • 45. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Microservice development lifecycle monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild developers delivery pipelineservices
  • 46. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What changes do you need to make to adopt these best practices? Serverless No provisioning/management Automatic scaling Pay for value billing Availability and resiliency Microservices Componentization Business capabilities Products not projects Infrastructure automation DevOps Cultural philosophies Cross-disciplinary teams CI/CD Automation tools DEV OPS Architectural patterns Operational Model Software Delivery
  • 47. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless where possiblearchitectures Event Driven delivering business value Focus
  • 48. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  • 49. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Approaches to modern application development • Simplify environment management with serverless technologies • Reduce the impact of code changes with microservice architectures • Automate operations by modelling applications & infrastructure as code • Accelerate the delivery of new, high-quality services with CI/CD • Gain insight across resources and applications by enabling observability • Protect customers and the business with end-to-end security & compliance
  • 50. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What microservices are… “the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.” - Martin Fowler
  • 51. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What microservices are… “Independently deployable services that work together, modelled around a business domain.” - Sam Newman
  • 52. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What microservices are… “The technical authority for a business capability” - Udi Dahan
  • 53. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Balance # services with deployment effortCOSTOREFFORT NUMBER OF SERVICES Minimum Cost Cost to Integrate Cost per Service https://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/ARC201
  • 54. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Shipping Inventory Customer Service Accounts Returns Invoicing
  • 55. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Shipping Inventory Customer Service ?How?
  • 56. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Domain Driven Design
  • 57. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Domain Driven Design “Ubiquitous language” - Modelling the language of the business Provides guidance about model domains with entities, value objects, repositories ad services Top Tip! Start reading from chapter 11 - strategic design vs tactical design
  • 58. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Bounded Contexts • Bounded Contexts are an essential modeling tool in DDD and microservices • Identify explicit boundaries around our understanding of the ubiquitous language and the things people care about. • Multiple models for a business concept https://www.martinfowler.com/bliki/BoundedContext.html Customer Ticket Product Product Version Customer Product Territory Opportunity Pipeline Sales Person Defect Sales Context Support Context
  • 59. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Bounded Contexts Concept Contracting with authors Managing the book’s authorship and editorial process Designing the book layout & illustrations Source: Implementing Domain-Driven Design, Vaughn Vernon Publishing Example: Book model Translating the book Producing the physical print and/ or electronic editions Marketing the book Selling the book to resellers and/ or directly to consumers Shipping a physical book to resellers and consumer
  • 60. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Context Maps Bounded contexts alone don’t provide a global view of your domain. Context maps deal with mapping different, but related, Ubiquitous Languages, by integrating their Bounded Contexts. Evans and Vernon describe 7 patterns for integrating bounded contexts • Shared Kernel • Customer / Supplier • Conformist • Anticorruption Layer • Separate Ways • Open / Host Service • Published Language Sales Context Support Context Marketing Context
  • 61. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Domain Events • Objects in a domain that represent that something has happened • Immutable – cannot change the past • Should be represented as verbs in the past tense, e.g. “customer_created” • Light weight, correlated by properties that are common across bounded contexts “customer_id” • Pattern for bounded context integration - Publish / Subscribe • Consider adopting EventStorming as a modelling technique
  • 62. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Messaging & Integration Patterns
  • 63. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Managing Dependencies Loose Coupling / High Cohesion Encapsulation
  • 64. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Integration options from AWS Orchestration Sequencing Parallel execution State management AWS Step Functions Eventing Performance at scale Fully-managed Enterprise-ready Amazon SNS Messaging Durable and scalable Comprehensive security Query-in-place Amazon SQS
  • 65. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Using AWS Lambda with Amazon SQS 1. Scheduled time occurs 2. Lambda invoked CloudWatch Events (time-based) Queue 3. Pull messages from queue CloudWatch Events (time-based) 4. Pull message from queue 3. Lambda invoked n times 2. Execute Step Function every minute 1. Scheduled time occurs Queue Queue AWS Step Functions workflow AWS Lambda AWS Lambda
  • 66. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SQS as an Event Source (SQSaaES) • Lambda polls the queue and when it detects new messages, it invokes your Lambda function by passing the messages as a parameter. • Full control over the queue processing settings such as visibility timeouts, delay queues, redrive policy, etc. Supports batch processing. • Lambda will gradually increase the queue polling rate as long as queue polling result in fetching of new messages. • Supports Identity and Resource based policy 3. Lambda removes message from queue 2. Lambda polls queue and invokes function 1. Message inserted into to a queue Queue AWS Lambda Amazon Simple Queue Service Lambda function
  • 67. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Subscriber A Subscriber C Subscriber B Publish / Subscribe • One logical publisher for a given domain event. Fully enforces a consistent boundary. • Addresses multiple types of coupling • Each subscriber can react to domain events in their own bounded context • SNS supports multiple subscription channels – Lambda, SQS, HTTP/S, Email, SMS, Mobile Push Topic Publisher Dom ain event
  • 68. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Service A Service D Service C Subscriber B Mapping events to topics Grey Topic Blue Topic Blue Subscribers Grey Each message type is mapped to logical destination Blue Blue Grey Grey Lambda function Publisher
  • 69. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SNS Message Filters • Publishers do not need to route message • Subscribers do not need to filter for message of interest • Lowers cost Colour TopicPublisher Subscribers BlueGrey Attr= Grey Grey Attr= Blue Blue Filter Policy Attr=Grey Filter Policy Attr=Blue Service A Service B Service C
  • 70. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Message Filtering Operators Subscription filter policy {"sport": ["rugby"]} matches message attribute {"sport": "rugby"} Exact matching on string values (Whitelisting) Anything-but matching on string values (Blacklisting) Prefix matching on string values Exact matching on numeric values Range matching on numeric values Subscription filter policy {"sport": [{"anything-but": "rugby"}]} matches message attributes such as {"sport": "baseball"} and {"sport": "basketball"} and {"sport": "football"} but not {"sport": "rugby"} Subscription filter policy {"sport": [{"prefix": "bas"}]} matches message attributes such as {"sport": "baseball"} and {"sport": "basketball"} Subscription filter policy {"balance": [{"numeric": ["=", 301.5]}]} matches message attributes {"balance": 301.500} and {"balance": 3.015e2} Subscription filter policy {"balance": [{"numeric": ["<", 0]}]} matches negative numbers only, and {"balance": [{"numeric": [">", 0, "<=", 150]}]} matches any positive number up to 150.
  • 71. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Coordination by Function Chaining Lambda function Lambda function Lambda function Lambda function Lambda function Lambda function
  • 72. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Step Functions • Coordinate the components of distributed applications and microservices using visual workflows • Keeps the orchestration out of the code! • Ideal for long-running processes and implementing failure management patterns and distributed transaction processing • Automatically triggers and tracks each step, and retries when there are errors. Support execution logging • Logs the state of each step, so when things do go wrong, you can diagnose and debug problems quickly “Serverless” workflow management with zero administration "ProcessOrder": { "Comment": ”t1” "Type": "Task", "Resource": "${NewOrderFunction.Arn}", "TimeoutSeconds": 10, "Catch": [{ "ErrorEquals": ["ErrProcessOrder"], "ResultPath": "$.error", "Next": "UpdateOrderStatus" }], "Next": "ProcessPayment" },
  • 73. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Step Functions A B C A ? CBA BA “I want to retry failed tasks”“I want to sequence tasks” “I want try/catch/finally” “I want to select tasks based on data” “I want to run tasks in parallel”
  • 74. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Step Functions API Connectors Glue AWS services together without writing code + AWS Batch AWS Fargate AWS GlueECS Amazon DynamoDB Amazon SNS Amazon SQS Amazon SageMaker
  • 75. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Nested Apps using Serverless Application Repository Compose application architectures from reusable building blocks • Serverless architectures deployed as a set of nested applications • Foster best organizational practices and reduce duplication of effort • Share components, modules and full applications privately with teams or publicly with others to improve agility
  • 76. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Storage and backup (nested serverless application) Common Patterns Emerge Fork-pattern- backup-queue Fork-pattern- backup-function Fork-pattern- backup-bucket Search and analytics (nested serverless application) Fork-pattern- index-queue Fork-pattern- index-function Fork-pattern- index-table polls saves polls saves publishes publishes Serverless Application
  • 77. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Messaging and integration patterns Event Store (nested app) polls saves publisher Amazon SNS publishes Subscriber B AWS Step Functions workflow Domain Event Domain Event Domain Event Amazon SQS workerclient DLQ saves Command Decoupled Messaging Publish / Subscribe Service A (Bounded Context) publishes Domain Event queue
  • 78. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Approaches to Modern Application Development • Simplify environment management with serverless technologies • Reduce the impact of code changes with microservice architectures • Automate operations by modelling applications & infrastructure as code • Accelerate the delivery of new, high-quality services with CI/CD • Gain insight across resources and applications by enabling observability • Protect customers and the business with end-to-end security & compliance
  • 79. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Serverless Application Model (SAM) Model function environments with SAM • Open source framework for building serverless applications on AWS • Shorthand syntax to express functions, APIs, databases, and event source mappings • Transforms and expands SAM syntax into AWS CloudFormation syntax on deployment • Supports all AWS CloudFormation resource types https://aws.amazon.com/serverless/sam/
  • 80. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetFunction: Type: AWS::Serverless::Function Properties: Handler: index.get Runtime: nodejs8.10 CodeUri: src/ Policies: - DynamoDBReadPolicy: TableName: !Ref MyTable Events: GetResource: Type: Api Properties: Path: /resource/{resourceId} Method: get MyTable: Type: AWS::Serverless::SimpleTable Just 20 lines to create: • Lambda function • IAM role • API Gateway • DynamoDB table
  • 81. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Use SAM CLI to package and deploy SAM templates Install: pip install --user aws-sam-cli Commands: sam logs sam validate sam local [generate-event | invoke | start-api | start-lambda] sam init sam build sam package sam deploy sam publish New CodePipeline Jenkins
  • 82. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SAM CLI sample workflow sam init --name my-function --runtime python cd my-function/ sam build sam package --s3-bucket my-packages-bucket --output-template-file packaged.yaml sam deploy --template-file packaged.yaml --stack-name my-function-prod sam publish # To the AWS Serverless Application Repository
  • 83. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS CodeBuild • Fully managed build service that compiles source code, runs tests, and produces software packages • Scales continuously and processes multiple builds concurrently • No build servers to manage • Pay by the minute, only for the compute resources you use • Monitor builds through CloudWatch Events
  • 84. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS CodeBuild • Each build runs in a new Docker container for a consistent, immutable environment • Docker and AWS CLI are installed in every official CodeBuild image • Provide custom build environments suited to your needs through the use of Docker images
  • 85. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS CodeBuild: Lambda buildspec version: 0.2 phases: build: commands: - npm ci - npm test - > aws cloudformation package --template-file template.yml --output-template template-output.yml --s3_bucket $BUCKET artifacts: type: zip files: - template-output.yml
  • 86. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Cloud Development Kit (CDK) • Open source framework to define cloud infrastructure in C#/.NET, Java, JavaScript, or TypeScript • Provides library of higher-level resource types (“construct” classes) that have AWS best practices built in by default, packaged as npm modules • Provisions resources with CloudFormation • Supports all CloudFormation resource types Developer PreviewAWS CDK https://awslabs.github.io/aws-cdk
  • 87. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark CDK template import ec2 = require('@aws-cdk/aws-ec2'); import ecs = require('@aws-cdk/aws-ecs'); import cdk = require('@aws-cdk/cdk'); class BonjourFargate extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 }); const cluster = new ecs.Cluster(this, 'Cluster', { vpc }); new ecs.LoadBalancedFargateService( this, "FargateService", { cluster, image: ecs.DockerHub.image("amazon/amazon-ecs-sample"), }); } } const app = new cdk.App(); new BonjourFargate(app, 'Bonjour'); app.run();
  • 88. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark CDK template import ec2 = require('@aws-cdk/aws-ec2'); import ecs = require('@aws-cdk/aws-ecs'); import cdk = require('@aws-cdk/cdk'); class BonjourFargate extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 }); const cluster = new ecs.Cluster(this, 'Cluster', { vpc }); new ecs.LoadBalancedFargateService( this, "FargateService", { cluster, image: ecs.DockerHub.image("amazon/amazon-ecs-sample"), }); } } const app = new cdk.App(); new BonjourFargate(app, 'Bonjour'); app.run();
  • 89. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark CDK template import ec2 = require('@aws-cdk/aws-ec2'); import ecs = require('@aws-cdk/aws-ecs'); import cdk = require('@aws-cdk/cdk'); class BonjourFargate extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 }); const cluster = new ecs.Cluster(this, 'Cluster', { vpc }); new ecs.LoadBalancedFargateService( this, "FargateService", { cluster, image: ecs.DockerHub.image("amazon/amazon-ecs-sample"), }); } } const app = new cdk.App(); new BonjourFargate(app, 'Bonjour'); app.run();
  • 90. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Model pipelines with AWS CDK • Minimize copy-and-paste by using object-oriented language • Define microservice pipeline “shape” in one class, then re-use it across many pipelines • CDK includes many high-level constructs for modeling a CodePipeline pipeline, including automatically configuring IAM role policies
  • 91. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark CDK pipelines: Construct export class MyMicroservicePipeline extends cdk.Construct { constructor(parent: cdk.Construct, name: string, props: MyMicroservicePipelineProps) { super(parent, name); const pipeline = new codepipeline.Pipeline(this, 'Pipeline', { pipelineName: props.serviceName, }); const githubAccessToken = new cdk.SecretParameter(this, 'GitHubToken’, { ssmParameter: 'GitHubToken' }); new codepipeline.GitHubSourceAction(this, 'GitHubSource', { stage: pipeline.addStage('Source’), owner: 'myorg’, repo: props.serviceName, oauthToken: githubAccessToken.value }); …
  • 92. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark CDK pipelines: Stack import cdk = require('@aws-cdk/cdk'); import { MyMicroservicePipeline } from './pipeline'; class MyMicroservicePipelinesStack extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); new MyMicroservicePipeline(this, 'Pipeline1', { 'serviceName': 'Microservice1' }); new MyMicroservicePipeline(this, 'Pipeline2', { 'serviceName': 'Microservice2' }); new MyMicroservicePipeline(this, 'Pipeline3', { 'serviceName': 'Microservice3' }); new MyMicroservicePipeline(this, 'Pipeline4', { 'serviceName': 'Microservice4' }); } } const app = new cdk.App(); new MyMicroservicePipelinesStack(app, 'MyMicroservicePipelines'); app.run();
  • 93. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Use CDK CLI to synthesize and deploy CDK templates Install: npm install -g aws-cdk Commands: cdk init app --language typescript cdk synth cdk deploy CodePipeline Jenkins
  • 94. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What matters?
  • 95. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Modern Application Development Greater agility Less overhead Better focus Increased scale More flexibility Pay for value What matters?
  • 96. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Modern Application Development As Developers, what we should be focusing on is what we’re seeing to be the new way of doing modern application development • Greatly reduced operational burden • Tighter alignment to costs w/ usage • Developers can/could/should be able to do almost anything • Opinionated platforms that allow for multiple use-cases • Opinionated platforms that bake in true best of breed practices, security, scale, performance, cost aspects for you
  • 97. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank you! Go Build! Go Serverless!
  • 98. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Aileen Gemma Smith, CEO @aileengemma aileen@vizalytics.com March, 2019 Vizalytics Technology: Serverless Trains: TrainLink and Sydney Trains
  • 99. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark High Level View of the Customer Problem • Disparate data • Too much data • Inconsistent metadata • Customer teams don’t have necessary skill sets • Desire for rapid prototyping • Want to move from being reactive to being proactive
  • 100. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Our Approach – Quick Start Pilot • Data audit – help customer understand the potential of their data • High degree of customer interaction • Iterative rapid prototyping • Guide customer to understand value of automated data and analytics architectures
  • 101. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless in Production • Dashboards: • Amazon S3, • Amazon APIGateway, • AWS Lambda • Ingest: • Amazon S3, • AWS Lambda, • Amazon Kinesis • Source to Graph Pipeline: • Amazon S3, • AWS Lambda, • Vizalytics proprietary → Amazon SageMaker • Training: • Amazon S3, • AWS Lambda, • Vizalytics proprietary → Amazon SageMaker
  • 102. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Sample Architecture ALB Vizalytics Sample Architecture ©2019 WEB VIZ KG PLATFORM Customer data center generic database Periodic Triggers Visualization Server s3-served dashboard UX Visualization Server API Gateway API Gateway SQS RDS Kinesis Data Stream S3 S3 EC2 EC2 Sim Cluster EMR AWS CloudTrail Cloudwatch Spot Fleet Step Functions Amazon Elasticsearch Service EC2 SageMaker Generic Stream Push
  • 103. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Quick Segue – Graph Concepts The Rat Graph
  • 104. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Min Hour Day 1st Ave 8th St 1st Ave 1st Ave 8th St 9th St 7th St 9th St 7th St 2nd Ave 2nd Ave 2nd Ave Diane's Deli Alice's Apothecary Carl's Cleaners Bob's Bodega Eric's Enchiladas Flora's Flowers Greg's Groceries Helen's Heros Spatial Subgraph Temporal Subgraph
  • 105. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Min Hour Day 1st Ave 8th St 1st Ave 1st Ave 8th St 9th St 7th St 9th St 7th St 2nd Ave 2nd Ave 2nd Ave Diane's Deli Alice's Apothecary Carl's Cleaners Bob's Bodega Eric's Enchiladas Flora's Flowers Greg's Groceries Helen's Heros Spatial Subgraph Temporal SubgraphEvent Subgraph Day +1 Rat Infestation Report :OCCURRED :OCCURRED Day +7
  • 106. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Min Hour Day 1st Ave 8th St 1st Ave 1st Ave 8th St 9th St 7th St 9th St 7th St 2nd Ave 2nd Ave 2nd Ave Diane's Deli Alice's Apothecary Carl's Cleaners Bob's Bodega Eric's Enchiladas Flora's Flowers Greg's Groceries Helen's Heros Spatial Subgraph Temporal SubgraphEvent Subgraph Day +1 Rat Infestation Report :OCCURRED :OCCURRED Day +7 Rat Infestation Impact Event :IMPACT :IMPACT {weight:0.5} :IMPACT {weight:1.0} :IMPACT {weight:0.8} :IMPACT {weight:0.5} *Note: NO IMPACT HERE :TRIGGERED
  • 107. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Min Hour Day 1st Ave 8th St 1st Ave 1st Ave 8th St 9th St 7th St 9th St 7th St 2nd Ave 2nd Ave 2nd Ave Diane's Deli Alice's Apothecary Carl's Cleaners Bob's Bodega Eric's Enchiladas Flora's Flowers Greg's Groceries Helen's Heros Spatial Subgraph Temporal SubgraphEvent Subgraph Day +1 Rat Infestation Report :OCCURRED :OCCURRED Day +7 :IMPACT Rat Infestation Impact Event :TRIGGERED :IMPACT {weight:0.4} :IMPACT {weight:1.0} :IMPACT {weight:0.7} :IMPACT {weight:0.4}
  • 108. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Min Hour Day 1st Ave 8th St 1st Ave 1st Ave 8th St 9th St 7th St 9th St 7th St 2nd Ave 2nd Ave 2nd Ave Diane's Deli Alice's Apothecary Carl's Cleaners Bob's Bodega Eric's Enchiladas Flora's Flowers Greg's Groceries Helen's Heros Spatial Subgraph Temporal SubgraphEvent Subgraph Day +1 Rat Infestation Report :OCCURRED :OCCURRED Day +7 :IMPACT {weight:0.5} :IMPACT {weight:0.1} :TRIGGERED Rat Infestation Impact Event :IMPACT*Note: NO IMPACT HERE *Note: NO IMPACT HERE Day -1 Day -7
  • 109. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Back to Serverless Trains…
  • 110. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Sample Architecture ALB Vizalytics Sample Architecture ©2019 WEB VIZ KG PLATFORM Customer data center generic database Periodic Triggers Visualization Server s3-served dashboard UX Visualization Server API Gateway API Gateway SQS RDS Kinesis Data Stream S3 S3 EC2 EC2 Sim Cluster EMR AWS CloudTrail Cloudwatch Spot Fleet Step Functions Amazon Elasticsearch Service EC2 SageMaker Generic Stream Push Real Time Vehicle Position
  • 111. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Processes – Real Time Position Data Raw Data SQS Training DataRaw CaptureStep FunctionCloudWatch Graph Import Create Training DataViz KG 1 Minute Event 15 Second Trigger 15 Second Trigger Request API Update VehPos Response Serialized VehPos Data Data Available Trigger VehPos Data Insert Augmented Data Insert foreach complete trip trip_id Complete Trip Available Message Query KG Training Vectors … RT Position System
  • 112. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Example - Delay Pattern Recognition What kind of delays are we classifying? Why is it important to the user? • Is it track-segment related? • Is it equipment related? • Is it likely to impact future trips on these tracks? • Will there be knock on delays to other trips (on other tracks)?
  • 113. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Sample Architecture ALB Vizalytics Sample Architecture ©2019 WEB VIZ KG PLATFORM Customer data center generic database Periodic Triggers Visualization Server s3-served dashboard UX Visualization Server API Gateway API Gateway SQS RDS Kinesis Data Stream S3 S3 EC2 EC2 Sim Cluster EMR AWS CloudTrail Cloudwatch Spot Fleet Step Functions Amazon Elasticsearch Service EC2 SageMaker Generic Stream Push D elay C haracterization Training
  • 114. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Processes – Training/Retraining Housekeeping Check Data Start Training Check Training Progress Wait Deploy Model Cloudwatch Step Functions START END New Data Available Training Period Trigger e.g. 24 hours Training Complete Training Not CompleteNo Data Available
  • 115. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Model Training • Rolling window of scheduled vs actual performance (e.g., last 12 months) • Why continually retrain? • Equipment and infrastructure changes and evolves • Ridership is not constant • Data sets evolve • At simplest level, use only the delay data (In practice, particularly for classification/regression-type models, context is important (weather, events, day of week, time of day, season, etc.) • 2 Vectors of data: • Delay Profile – the deviation at each reporting point !"#$%&$'0 − *+ℎ$'-.$'0 , (!"#$%&$'1 − *+ℎ$'-.$'1 , … (!"#$%&$'3 − *+ℎ$'-.$'3)] • Delay Change – the difference in delay at each reporting point 6$.781 − 6$.780 , (6$.782 − 6$.781 , … (6$.783 − 6$.783 − 1)
  • 116. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Delay Calculation !"#$%&$'0 − *+ℎ$'-.$'0 , (!"#$%&$'1 − *+ℎ$'-.$'1 , … (!"#$%&$'3 − *+ℎ$'-.$'3)] [30, 30, 45, 30, 36, 42, 480, 480, 430, 430, 435, 430, 450, 480, 470, 480, 500, 460, 480] 6$.781 − 6$.780 , (6$.782 − 6$.781 , … (6$.783 − 6$.783 − 1)] [30, 0, 15, -15, 6, 6, 438, 0, -50, 20, -20, 0, 5, -5, 20, 30, -10, 10, 20, -40, 20]
  • 117. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda – Start a Training Run import os import boto3 CONTAINER = '712309505854.dkr.ecr.ap-southeast-2.amazonaws.com’ REGISTRY_PATH = '{}/kmeans:1'.format(CONTAINER) SAGEMAKER_ROLE = os.environ['SAGEMAKER_ROLE'] TRAINING_INSTANCE_TYPE = os.environ['TRAINING_INSANCE_TYPE'] MANIFEST_TEMPLATE = 's3://{training_bucket}/training_data_{training_date}.manifest’ sagemaker = boto3.client('sagemaker') def lambda_handler(event, context): try: k = event['k'] # number of clusters output_bucket = event['output_bucket'] name = event['name'] route = event['route'] training_bucket = event['training_bucket'] training_date = event['training_date'] manifest = MANIFEST_TEMPLATE.format(training_bucket=training_bucket, training_date=training_date) s3_output_path = 's3://{output_bucket}/{route}/training_output_{training_date}'.format(output_bucket=output_bucket, route=route, training_date=training_date)
  • 118. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda – Start a Training Run (cont’d) response = sagemaker.create_training_job( TrainingJobName=name, HyperParameters={ 'k': k, 'init_method': 'kmeans++', }, AlgorithmSpecification={ 'TrainingImage': CONTAINER, 'TrainingInputMode': 'File’ }, RoleArn=SAGEMAKER_ROLE, InputDataConfig=[ { 'ChannelName': 'train', 'DataSource': { 'S3DataSource': { 'S3DataType': 'ManifestFile', 'S3Uri': manifest } }, 'ContentType': 'text/csv', 'CompressionType': 'None' } ],
  • 119. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda – Start a Training Run (cont’d) OutputDataConfig={ 'S3OutputPath': s3_output_path }, ResourceConfig={ ‘InstanceType': TRAINING_INSTANCE_TYPE, 'InstanceCount': 1, 'VolumeSizeInGB': 50 }, StoppingCondition={ 'MaxRuntimeInSeconds': 86400 } ) print('Successfully created training job: response = {}'.format(response)) except Exception as e: print(e) print('Unable to create training job.') raise(e)
  • 120. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda – Deploy the Model sagemaker = boto3.client('sagemaker') model_name = event['model_name'] endpoint = event['endpoint'] try: sagemaker.create_endpoint_config( EndpointConfigName=name, ProductionVariants=[ { 'VariantName': 'PROD', 'ModelName': name, 'InitialInstanceCount': 1, 'InstanceType': INSTANCE_TYPE } ] ) sagemaker.create_endpoint( EndpointName=endpoint_name, EndpointConfigName=config_name ) except Exception as e: print(e) print('Unable to create endpoint configuration.') raise(e)
  • 121. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda – Invoke the Model import os import io import boto3 import json ENDPOINT_NAME = os.environ['ENDPOINT_NAME'] runtime= boto3.client('runtime.sagemaker') DELAY_CLUSTER_NAMES = [ 'SPOT', 'INCREASING', '...'] def lambda_handler(event, context): data = json.loads(json.dumps(event)) payload = data['data'] ## ## e.g. ## [30, 30, 45, 30, 36, 42, 480, 480, 430, 430, 435, 430, 450, 480, 470, 480, 500, 460, 480] ## response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME, ContentType='text/csv', Body=payload) result = json.loads(response['Body'].read().decode()) cluster = int(result['predictions'][0]['closest_cluster']) distance = result['predictions'][0]['distance_to_cluster']) cluster_name = DELAY_CLUSTER_NAMES[cluster] return json.dumps({"cluster_name": cluster_name})
  • 122. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Dashboard in Action
  • 123. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • K-means * • K-pod † • DBSCAN † • EM Clustering † • Random Forest * † • XG Boost † • FPGrowth † • Association Rules † • Linear Learning † • Deep AR * • Page Rank † • Triangle Counting † • Collaborative Filtering † Content AnalyticsGraph Analytics • Named Entity Extraction † • Amazon Comprehend • Amazon Rekognition • Amazon Translate • Neural Topic Modeling * Behind the scenes – Machine Learning Clustering Classifiers / Regression Sequence / Time Series *Amazon Sagemaker Implementation †Vizalytics Implementation Built on AWS EC2 and AWS Serverless Technologies
  • 124. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • Customer volume prediction • Historical insights • Operational planning • Marketing support • Operational support • Route planning • Real time insights • Site selection • Zoning • Urban planning Intelligent Decision Support • Contextual decision support • Recommendations • Historical data retrieval Transit Schedules · Live Transit · People Movement · Weather · Permits · Point of Sale Events · Traffic · Business Listings · GIS · Open Government Data · Zoning · After Action Reports Internal Company Data · Unstructured Content · Operations Archives · News Feeds TransitTourism Economic Development Vizalytics Knowledge Graph Platform Built on AWS EC2 and AWS Serverless Technologies
  • 125. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank You! Let’s keep talking. Aileen Gemma Smith, CEO Vizalytics Technology – Email: aileen@vizalytics.com Twitter: @aileengemma
  • 126. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Cloud Conformity 27 March 2019 Scaling Serverless How serverless scales to perform over 200 million well-architected checks a day @MikeRahmati @PaulSecurityAWS
  • 127. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless at Scale – Cloud Conformity by Numbers
  • 128. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Step Functions Lambda Collect AWS metadata information DynamoDB SQS SNS S3 Elasticsearch Customer AWS Account Update Inventory Rule Engine Notify UserUser AWS Resources Encrypt data at rest, data in transit and data in use Cloud Conformity – Reference Architecture for Serverless
  • 129. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Conformity Bot V1 (Monolithic) Collect AWS metadata information Update Inventory Run Well Architected Notify User AWS Step Functions Lambda Collect AWS metadata information Update Inventory Run Well Architected Notify User Conformity Bot V2 (Single purpose functions) Evolution of Serverless – Monolithic vs Single Purpose Functions
  • 130. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Monitoring Charts reflect, over 5 minute intervals duration, errors, number of invocations and memory used vs memory provisioned for Lambda functions at scale. Memory usage is an essential metric for cost optimization.
  • 131. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Best Practice
  • 132. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Enhanced CI/CD Pipeline for Serverless
  • 133. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark DynamoDB Scaling Challenges Note actual reads exceed provisioned reads leading to throttling. Not too that scaling happens after burst event and not immediately.
  • 134. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Securing Serverless
  • 135. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark The Cost of Serverless Legend: Percentage of cost by service for the Cloud Conformity Serverless stack
  • 136. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark References Cloud Conformity - https://www.cloudconformity.com/ AWS Well-Architected Framework - https://aws.amazon.com/architecture/well- architected/ AWS Lens for Serverless - https://d1.awsstatic.com/whitepapers/architecture/AWS- Serverless-Applications-Lens.pdf Cloud Conformity Knowledge Base - https://www.cloudconformity.com/conformity-rules/ Cloud Formation Template Scanning - https://blog.cloudconformity.com/cloud- conformitys-cloudformation-template-scanner-how-it-works-278d1209f2a9 Open source auto-remediation project - https://github.com/cloudconformity/auto-remediate
  • 137. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Q&A Mike Rahmati CTO Paul Hortop Head of Security
  • 138. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank you!