Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Adrian Hornsby, Technical Evangelist
Serverless ...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Technical Evangelist, Developer Advocate,
… So...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless key concepts
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
No servers to provision
or manage
Scales with us...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Event driven
A B CEvent on B by A triggers C
Inv...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How Lambda works
S3 event
notifications
DynamoDB...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Event-driven using Lambda
AWS Lambda:
Resize Ima...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How does a Lambda function looks like?
def handl...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Anatomy of a Lambda function
Handler() function
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Using AWS Lambda
Bring your own code
• Node.js, ...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Using AWS Lambda
Programming model
• AWS SDK bui...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda execution model
Synchronous (push) Asynch...
Chalice
awslabs/aws-serverless-express
awslabs/aws-serverless-java-container
Serverless Frameworks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Example usage of
frameworks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless in action
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliat...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Event-driven actions
AWS Lambda:
Resize Images
U...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Source data
Source data
Source data
Source data
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliat...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Auto tagging resources as they start
AWS Lambda:...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CapitalOne Cloud Custodian
AWS Lambda:
Policy & ...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scheduled backup operation
AWS Lambda:
Backup Ru...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliat...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Web application
Data stored in
Amazon
DynamoDB
D...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS SAM:
Serverless
Application
Model
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
index.handler
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SAM Local:
Local Serverless testing with Docker
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SAM package + deploy
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless template
xxxxxxxx
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
gets.hello
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
posts.create
Deploy
Call
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliat...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Polly: Text In, Life-like Speech Out
Amazon Poll...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
<API>
Amazon Polly
</API>
aws polly synthesize-s...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
<demo>
PollyCast
</demo>
* Initial project by Ja...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Pollycast:
Serverless Template
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliat...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon
Rekognition
Object and scene detection
Fa...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
<API>
Amazon Rekognition
</API>
aws rekognition ...
https://github.com/awslabs/lambda-refarch-imagerecognition
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Step Functions:
Orchestrate a Serverless pro...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
<demo>
Image Recognition and Processing Backend
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliat...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS
Lambda
Notifications:
Amazon SNS
DynamoDB
AW...
AWS IoT IoT
shadow
Amazon
Cognito
MQTT over WebSockets
AWS
LambdaAlexa
Amazon
S3
Interactive Serverless applications
http://bit.ly/adhornlightbulb
Cloud Powered Lightbulb
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliat...
Real-time analytics
Amazon
Kinesis
Stream
Amazon
Kinesis
Analytics
Amazon
Cognito
Amazon
Kinesis
Stream
Amazon
DynamoDB
Am...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Real-time Analytics Demo
http://quad.adhorn.me
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
More info:
https://aws.amazon.com/serverless/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thanks you!
Serverless in Action on AWS
Prochain SlideShare
Chargement dans…5
×

Serverless in Action on AWS

630 vues

Publié le

The slides from my talk on Serverless - more geared towards developers and architects, or innovators. Well actually to anyone interested really :)

Publié dans : Technologie
  • Soyez le premier à commenter

Serverless in Action on AWS

  1. 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Adrian Hornsby, Technical Evangelist Serverless Applications in Action on AWS @adhorn
  2. 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Technical Evangelist, Developer Advocate, … Software Engineer • Own bed in Finland • Previously: • Solutions Architect @AWS • Lead Cloud Architect @Dreambroker • Director of Engineering, Software Engineer, DevOps, Manager, ... @Hdm • Researcher @Nokia Research Center • and a bunch of other stuff. • Climber, like Ginger shots. @adhorn
  3. 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless key concepts
  4. 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. No servers to provision or manage Scales with usage Never pay for idle Availability and fault tolerance built in Serverless means…
  5. 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Event driven A B CEvent on B by A triggers C Invocation Lambda functions Action
  6. 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How Lambda works S3 event notifications DynamoDB Streams Kinesis events Cognito events SNS events Custom events CloudTrail events LambdaDynamoDB Kinesis S3 Any custom Invoked in response to events - Changes in data - Changes in state Redshift SNS Access any service, including your own Such as… Lambda functions CloudWatch events
  7. 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Event-driven using Lambda AWS Lambda: Resize Images Users upload photos S3: Source Bucket S3: Destination Bucket Triggered on PUTs
  8. 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How does a Lambda function looks like? def handler(event, context): return { "message": ”Hello World!", "event": event } 'use strict'; exports.handler = (event, context, callback) => { console.log('LOG: Name is ' + event.name); callback(null, "Hello " + event.name); }
  9. 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Anatomy of a Lambda function Handler() function Function to be executed upon invocation Event object Data sent during Lambda Function Invocation Context object Methods available to interact with runtime information (request ID, log group, etc.) def handler(event, context): return { "message": ”Hello World!", "event": event }
  10. 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Using AWS Lambda Bring your own code • Node.js, Java, Python, C# • Bring your own libraries (even native ones) Simple resource model • Select power rating from 128 MB to 1.5 GB • CPU and network allocated proportionately • Reports actual usage Flexible authorization • Securely grant access to resources, including VPCs • Fine-grained control over who can call your functions Flexible use • Call or send events • Integrated with other AWS services • Build whole serverless ecosystems
  11. 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Using AWS Lambda Programming model • AWS SDK built in (Python and Node.js) • Lambda is the front end • Use processes, threads, /tmp, sockets normally Stateless • Persist data using Amazon DynamoDB, S3, or ElastiCache • No affinity to infrastructure (can’t “log in to the box”) Authoring functions • Author directly using the console WYSIWYG editor • Package code as a .zip and upload to Lambda or S3 • Plugins for Eclipse and Visual Studio • Command line tools Monitoring and logging • Built-in metrics for requests, errors, latency, and throttles • Built-in logs in Amazon CloudWatch Logs
  12. 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda execution model Synchronous (push) Asynchronous (event) Stream-based Amazon API Gateway AWS Lambda function Amazon DynamoDB Amazon SNS /api/hello AWS Lambda function Amazon S3 reqs Amazon Kinesis changes AWS Lambda service function
  13. 13. Chalice awslabs/aws-serverless-express awslabs/aws-serverless-java-container Serverless Frameworks
  14. 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Example usage of frameworks
  15. 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless in action
  16. 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Event processing applications
  17. 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Event-driven actions AWS Lambda: Resize Images Users upload photos S3: Source Bucket S3: Destination Bucket Triggered on PUTs
  18. 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Source data Source data Source data Source data Data Staging Layer /data/source-raw Data Staging Layer /data/source-validated Input Validation and Conversion layer Input Tracking layer State Management Store Event-driven controls
  19. 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. (scheduled) Automation applications
  20. 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Auto tagging resources as they start AWS Lambda: Update Tag Amazon CloudWatch Events: Rule Triggered Amazon EC2 Instance State Changes Amazon DynamoDB: EC2 Instance Properties Tag: N/A Amazon EC2 Instance State Changes Tag: Owner=userName PrincipalID=aws:userid • AMI • Instances • Snapshot • Volume
  21. 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CapitalOne Cloud Custodian AWS Lambda: Policy & Compliance Rules Amazon CloudWatch Events: Rules Triggered AWS CloudTrail: Events Amazon SNS: Alert Notifications Amazon CloudWatch Logs: Logs Read more here: http://www.capitalone.io/cloud-custodian/docs/index.html
  22. 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Scheduled backup operation AWS Lambda: Backup Rules Amazon CloudWatch Events: Scheduled Trigger Amazon Redshift Cluster XYZ Snapshot
  23. 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Web applications
  24. 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Web application Data stored in Amazon DynamoDB Dynamic content in AWS Lambda Amazon API Gateway Browser Amazon CloudFront Amazon S3
  25. 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS SAM: Serverless Application Model
  26. 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. index.handler
  27. 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SAM Local: Local Serverless testing with Docker
  28. 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SAM package + deploy
  29. 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless template xxxxxxxx
  30. 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. gets.hello
  31. 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. posts.create
  32. 32. Deploy
  33. 33. Call
  34. 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Voice enabled applications
  35. 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Polly: Text In, Life-like Speech Out Amazon Polly “Today in Seattle, WA it’s 11°F” “Today in Seattle Washington it’s 11 degrees Fahrenheit”
  36. 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. <API> Amazon Polly </API> aws polly synthesize-speech --text "It was nice to live such a wonderful live show" --output-format mp3 --voice-id Joanna --text-type text johanna.mp3
  37. 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. <demo> PollyCast </demo> * Initial project by James Siri, Piotr Lewalski https://github.com/adhorn/pollycast
  38. 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Pollycast: Serverless Template
  39. 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Computer vision powered applications
  40. 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Rekognition Object and scene detection Facial analysis Face comparison Celebrity recognition Image moderation Text in pictures Faces in crowd Rekognition: Images In, Rich Metadata Out NEW!!!
  41. 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. <API> Amazon Rekognition </API> aws rekognition detect-faces --image '{"S3Object":{"Bucket":"adhorn-reko","Name":"horse.jpg"}}' --attributes "ALL" aws rekognition detect-labels --image '{"S3Object":{"Bucket":"adhorn-reko","Name":"horse.jpg"}}'
  42. 42. https://github.com/awslabs/lambda-refarch-imagerecognition
  43. 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Step Functions: Orchestrate a Serverless processing workflow using AWS Lambda
  44. 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. <demo> Image Recognition and Processing Backend Step Functions </demo> https://github.com/awslabs/lambda-refarch-imagerecognition
  45. 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IoT powered applications
  46. 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda Notifications: Amazon SNS DynamoDB AWS IoTSensors Control System Anomaly Detection Using AWS Lambda
  47. 47. AWS IoT IoT shadow Amazon Cognito MQTT over WebSockets AWS LambdaAlexa Amazon S3 Interactive Serverless applications
  48. 48. http://bit.ly/adhornlightbulb Cloud Powered Lightbulb
  49. 49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Real-time streaming applications
  50. 50. Real-time analytics Amazon Kinesis Stream Amazon Kinesis Analytics Amazon Cognito Amazon Kinesis Stream Amazon DynamoDB Amazon Lambda Amazon S3 JavaScript SDK
  51. 51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Real-time Analytics Demo http://quad.adhorn.me
  52. 52. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. More info: https://aws.amazon.com/serverless/
  53. 53. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thanks you!

×