SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Serverless Brewing IPAs
WoodWing
Wednesday, March 11, 2020
AWS MeetUp @ Bestseller, Amsterdam
2000
Established
170+
Employees
100+
Countries
1000+
Customers
60+
Business Partners
49,000
Users
2
WoodWing
The Architecture
API Integration
3
• Validate model at API Gateway
• Queue all requests
• Process the request
• Confirm processing
Ingredients
Malt
Yeast
Hop
Brewery love
Hygiene
You need to keep your
workplace as clean as
possible
Tools
Brew pan
Pan with rinse water
Sieve
Thermometer
Hydrometer
!
Brewing beer at home
4
5
The process
6
Depen
Fermentation process
iSpindel
An ESP8266 based free-floating
sensor for brewers who want a
real-time update about the
brewing process via Wifi.
7
Thanks to Hen Peretz
iSpindel as a client
Metrics every 15 seconds
8
iSpindel as a client
Metrics every 15 seconds
9
10
BrewAPI
Demo
IPA 5%
11
Lessons Learned
12
Split your API definition from your CloudFormation template
See: https://github.com/OAI/OpenAPI-Specification (also known as Swagger)
Api:
Type: AWS::Serverless::Api
Properties:
…
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: resources/openapi.yaml
$ sam package
$ sam deploy
13
Refs and GetAtt will work in your included API
Only not the shorthand version, that will fail (cfn-lint will not catch it!)
paths:
iSpindel:
post:
x-amazon-apigateway-integration:
credentials: !GetAtt APIGatewayRole.Arn
paths:
iSpindel:
post:
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt: APIGatewayRole.Arn
14
iSpindelPayload:
type: object
required: [name, ID, token, angle, temperature, temp_units, battery, gravity, interval ]
properties:
name: { type: string }
ID: { type: integer, format: int32 }
token: { type: string }
angle: { type: number, format: float }
temperature: { type: number, format: float }
temp_units: { type: string }
battery: { type: number, format: float }
gravity: { type: number, format: float }
interval: { type: integer, format: int32 }
API Model Validation
15
Usage of Usage plans
Limit the amount of calls made by a client or device:
• Use the X-API-Key header to send the API key
• Use a custom authoriser to return a API key
16
SAM Deploy vs AWS Console deploy
When you add AddDefaultAuthorizerToCorsPreflight to the AWS::Serverless::Api resource it will
remove the AWS_IAM authorization defined in the OpenAPI?
Auth:
AddDefaultAuthorizerToCorsPreflight: true
ApiKeyRequired: true
Adding the “DefaultAuthorizer” or removing the “AddDefaultAuthorizerToCorsPreflight” will solve
that.
Auth:
AddDefaultAuthorizerToCorsPreflight: true
DefaultAuthorizer: AWS_IAM
ApiKeyRequired: true
17
Lambda Destinations
Lambda destinations only work with asynchronous invocations and not with synchronous
invocations, this means destinations will not work when:
• When you test a Lambda from the AWS Console
• You have a SQS Trigger on your AWS::Serverless::Function resource
Placing a SNS Topic in between would make it asynchronous again…
18
Amazon SQS and AWS X-Ray
https://docs.aws.amazon.com/xray/latest/devguide/xray-services-sqs.html
19
Send the AWSTraceHeader from the API Gateway to SQS
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:sqs:path/${AWS::AccountId}/${IncomingMeasurementQueue.QueueName}
httpMethod: POST
type: aws
requestParameters:
integration.request.header.Content-Type: "'application/x-www-form-urlencoded'"
requestTemplates:
application/json: |
&Action=SendMessage##
&MessageSystemAttribute.1.Name=AWSTraceHeader##
&MessageSystemAttribute.1.Value.DataType=String##
&MessageSystemAttribute.1.Value.StringValue=$util.urlEncode($method.request.header.X-Amzn-Trace-Id)##
&MessageBody=$util.urlEncode($input.json('$'))##
20
SQS and Encryption
When you send a message to an encrypted SQS Queue the role needs to have
the following IAM policies:
• kms:Decrypt
• kms:GenerateDataKey
Thank you!
Questions?
Are you looking for a new challenge? https://www.woodwing.com/jobs

Contenu connexe

Tendances

Spca2014 debugging remote event receivers van hunen
Spca2014 debugging remote event receivers van hunenSpca2014 debugging remote event receivers van hunen
Spca2014 debugging remote event receivers van hunen
NCCOMMS
 

Tendances (20)

AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
 
Building Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsBuilding Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIs
 
Terraform Testing with InSpec Demo
Terraform Testing with InSpec DemoTerraform Testing with InSpec Demo
Terraform Testing with InSpec Demo
 
API Test Automation Tips and Tricks
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Tricks
 
Alon Fliess: APM – What Is It, and Why Do I Need It? - Architecture Next 20
Alon Fliess: APM – What Is It, and Why Do I Need It? - Architecture Next 20Alon Fliess: APM – What Is It, and Why Do I Need It? - Architecture Next 20
Alon Fliess: APM – What Is It, and Why Do I Need It? - Architecture Next 20
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
 
Building Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS InfrastructureBuilding Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS Infrastructure
 
What's new in Rails 5 - API Mode & Action Cable overview
What's new in Rails 5 - API Mode & Action Cable overviewWhat's new in Rails 5 - API Mode & Action Cable overview
What's new in Rails 5 - API Mode & Action Cable overview
 
Spca2014 debugging remote event receivers van hunen
Spca2014 debugging remote event receivers van hunenSpca2014 debugging remote event receivers van hunen
Spca2014 debugging remote event receivers van hunen
 
PowerShell: Automation for everyone
PowerShell: Automation for everyonePowerShell: Automation for everyone
PowerShell: Automation for everyone
 
AWS API Gateway
AWS API GatewayAWS API Gateway
AWS API Gateway
 
PayPal's History of Microservices Architecture
PayPal's History of Microservices ArchitecturePayPal's History of Microservices Architecture
PayPal's History of Microservices Architecture
 
Continuous delivery in AWS
Continuous delivery in AWSContinuous delivery in AWS
Continuous delivery in AWS
 
Getting Ahead of Engineering
Getting Ahead of EngineeringGetting Ahead of Engineering
Getting Ahead of Engineering
 
Five Ways to Scale your API Without Touching Your Code
Five Ways to Scale your API Without Touching Your CodeFive Ways to Scale your API Without Touching Your Code
Five Ways to Scale your API Without Touching Your Code
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSync
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
 
Rails 5 – most effective features for apps upgradation
Rails 5 – most effective features for apps upgradationRails 5 – most effective features for apps upgradation
Rails 5 – most effective features for apps upgradation
 
StackSets: Simplifying application management in Kubernetes - Scale Up 360°
StackSets: Simplifying application management in Kubernetes - Scale Up 360°StackSets: Simplifying application management in Kubernetes - Scale Up 360°
StackSets: Simplifying application management in Kubernetes - Scale Up 360°
 
Automation testing API in Java
Automation testing API in JavaAutomation testing API in Java
Automation testing API in Java
 

Similaire à AWS MeetUp - Serverless Brewing IPAs

Similaire à AWS MeetUp - Serverless Brewing IPAs (20)

AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
 
Building Scalable Services with Amazon API Gateway - Technical 201
Building Scalable Services with Amazon API Gateway - Technical 201Building Scalable Services with Amazon API Gateway - Technical 201
Building Scalable Services with Amazon API Gateway - Technical 201
 
Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
 
What's New with AWS Lambda
What's New with AWS LambdaWhat's New with AWS Lambda
What's New with AWS Lambda
 
Build a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a RideBuild a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a Ride
 
Build a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a RideBuild a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a Ride
 
Ovations AWS pop-up loft 2019 Technical presentation
Ovations AWS pop-up loft 2019 Technical presentationOvations AWS pop-up loft 2019 Technical presentation
Ovations AWS pop-up loft 2019 Technical presentation
 
The anypoint platform for API's
The anypoint platform for API'sThe anypoint platform for API's
The anypoint platform for API's
 
AWS Serverless Development
AWS Serverless DevelopmentAWS Serverless Development
AWS Serverless Development
 
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar SeriesContinuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
 
Operating your Production API
Operating your Production APIOperating your Production API
Operating your Production API
 
What's New with AWS Lambda
What's New with AWS LambdaWhat's New with AWS Lambda
What's New with AWS Lambda
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017
 
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDK
 

Dernier

Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
Overkill Security
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 

Dernier (20)

Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 

AWS MeetUp - Serverless Brewing IPAs

  • 1. Serverless Brewing IPAs WoodWing Wednesday, March 11, 2020 AWS MeetUp @ Bestseller, Amsterdam
  • 3. The Architecture API Integration 3 • Validate model at API Gateway • Queue all requests • Process the request • Confirm processing
  • 4. Ingredients Malt Yeast Hop Brewery love Hygiene You need to keep your workplace as clean as possible Tools Brew pan Pan with rinse water Sieve Thermometer Hydrometer ! Brewing beer at home 4
  • 7. iSpindel An ESP8266 based free-floating sensor for brewers who want a real-time update about the brewing process via Wifi. 7 Thanks to Hen Peretz
  • 8. iSpindel as a client Metrics every 15 seconds 8
  • 9. iSpindel as a client Metrics every 15 seconds 9
  • 12. 12 Split your API definition from your CloudFormation template See: https://github.com/OAI/OpenAPI-Specification (also known as Swagger) Api: Type: AWS::Serverless::Api Properties: … DefinitionBody: Fn::Transform: Name: AWS::Include Parameters: Location: resources/openapi.yaml $ sam package $ sam deploy
  • 13. 13 Refs and GetAtt will work in your included API Only not the shorthand version, that will fail (cfn-lint will not catch it!) paths: iSpindel: post: x-amazon-apigateway-integration: credentials: !GetAtt APIGatewayRole.Arn paths: iSpindel: post: x-amazon-apigateway-integration: credentials: Fn::GetAtt: APIGatewayRole.Arn
  • 14. 14 iSpindelPayload: type: object required: [name, ID, token, angle, temperature, temp_units, battery, gravity, interval ] properties: name: { type: string } ID: { type: integer, format: int32 } token: { type: string } angle: { type: number, format: float } temperature: { type: number, format: float } temp_units: { type: string } battery: { type: number, format: float } gravity: { type: number, format: float } interval: { type: integer, format: int32 } API Model Validation
  • 15. 15 Usage of Usage plans Limit the amount of calls made by a client or device: • Use the X-API-Key header to send the API key • Use a custom authoriser to return a API key
  • 16. 16 SAM Deploy vs AWS Console deploy When you add AddDefaultAuthorizerToCorsPreflight to the AWS::Serverless::Api resource it will remove the AWS_IAM authorization defined in the OpenAPI? Auth: AddDefaultAuthorizerToCorsPreflight: true ApiKeyRequired: true Adding the “DefaultAuthorizer” or removing the “AddDefaultAuthorizerToCorsPreflight” will solve that. Auth: AddDefaultAuthorizerToCorsPreflight: true DefaultAuthorizer: AWS_IAM ApiKeyRequired: true
  • 17. 17 Lambda Destinations Lambda destinations only work with asynchronous invocations and not with synchronous invocations, this means destinations will not work when: • When you test a Lambda from the AWS Console • You have a SQS Trigger on your AWS::Serverless::Function resource Placing a SNS Topic in between would make it asynchronous again…
  • 18. 18 Amazon SQS and AWS X-Ray https://docs.aws.amazon.com/xray/latest/devguide/xray-services-sqs.html
  • 19. 19 Send the AWSTraceHeader from the API Gateway to SQS x-amazon-apigateway-integration: uri: Fn::Sub: arn:aws:apigateway:${AWS::Region}:sqs:path/${AWS::AccountId}/${IncomingMeasurementQueue.QueueName} httpMethod: POST type: aws requestParameters: integration.request.header.Content-Type: "'application/x-www-form-urlencoded'" requestTemplates: application/json: | &Action=SendMessage## &MessageSystemAttribute.1.Name=AWSTraceHeader## &MessageSystemAttribute.1.Value.DataType=String## &MessageSystemAttribute.1.Value.StringValue=$util.urlEncode($method.request.header.X-Amzn-Trace-Id)## &MessageBody=$util.urlEncode($input.json('$'))##
  • 20. 20 SQS and Encryption When you send a message to an encrypted SQS Queue the role needs to have the following IAM policies: • kms:Decrypt • kms:GenerateDataKey
  • 21. Thank you! Questions? Are you looking for a new challenge? https://www.woodwing.com/jobs