SlideShare a Scribd company logo
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

More Related Content

PDF
Pretenders talk at PyconUK 2012
PDF
Emulators as an Emerging Best Practice for API providers
PDF
Frail & Cast Iron tools - a Postman Case Study
PDF
Pratical eff
PDF
Pratical eff monad at Scaladays Chicago
PPTX
Pratical eff-scalaitaly-2017
PPTX
Kimono sharing
PDF
AppSyncをReactで使ってみた
Pretenders talk at PyconUK 2012
Emulators as an Emerging Best Practice for API providers
Frail & Cast Iron tools - a Postman Case Study
Pratical eff
Pratical eff monad at Scaladays Chicago
Pratical eff-scalaitaly-2017
Kimono sharing
AppSyncをReactで使ってみた

What's hot (19)

PDF
Building Cloud-agnostic Serverless APIs
PDF
Terraform Testing with InSpec Demo
PPTX
API Test Automation Tips and Tricks
PDF
Alon Fliess: APM – What Is It, and Why Do I Need It? - Architecture Next 20
PPTX
Building strong foundations apex enterprise patterns
PDF
What's new in Rails 5 - API Mode & Action Cable overview
PDF
Spca2014 debugging remote event receivers van hunen
PPTX
PowerShell: Automation for everyone
PPTX
AWS API Gateway
PDF
PayPal's History of Microservices Architecture
PDF
Continuous delivery in AWS
PDF
Getting Ahead of Engineering
PDF
Five Ways to Scale your API Without Touching Your Code
PDF
Why your next serverless project should use AWS AppSync
PPTX
Belajar Postman test runner
PDF
Rails 5 – most effective features for apps upgradation
PDF
StackSets: Simplifying application management in Kubernetes - Scale Up 360°
PDF
Automation testing API in Java
PPTX
Next level of Appium
Building Cloud-agnostic Serverless APIs
Terraform Testing with InSpec Demo
API Test Automation Tips and Tricks
Alon Fliess: APM – What Is It, and Why Do I Need It? - Architecture Next 20
Building strong foundations apex enterprise patterns
What's new in Rails 5 - API Mode & Action Cable overview
Spca2014 debugging remote event receivers van hunen
PowerShell: Automation for everyone
AWS API Gateway
PayPal's History of Microservices Architecture
Continuous delivery in AWS
Getting Ahead of Engineering
Five Ways to Scale your API Without Touching Your Code
Why your next serverless project should use AWS AppSync
Belajar Postman test runner
Rails 5 – most effective features for apps upgradation
StackSets: Simplifying application management in Kubernetes - Scale Up 360°
Automation testing API in Java
Next level of Appium
Ad

Similar to AWS MeetUp - Serverless Brewing IPAs (12)

PPTX
Ovations AWS pop-up loft 2019 Technical presentation
PPTX
The anypoint platform for API's
PDF
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
PDF
Building serverless backends - Tech talk 5 May 2017
PDF
Lambdaless and AWS CDK
PPTX
PDF
AWS 6월 웨비나 | AWS CodeStar를 통한 DevOps 기반 프로젝트 운영 (윤석찬 테크에반젤리스트)
PDF
Building serverless applications (April 2018)
PDF
An introduction to serverless architectures (February 2017)
PPTX
Powering your Apps via Google Cloud Platform
PDF
How LEGO.com Accelerates With Serverless
PPTX
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
Ovations AWS pop-up loft 2019 Technical presentation
The anypoint platform for API's
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Building serverless backends - Tech talk 5 May 2017
Lambdaless and AWS CDK
AWS 6월 웨비나 | AWS CodeStar를 통한 DevOps 기반 프로젝트 운영 (윤석찬 테크에반젤리스트)
Building serverless applications (April 2018)
An introduction to serverless architectures (February 2017)
Powering your Apps via Google Cloud Platform
How LEGO.com Accelerates With Serverless
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
Ad

Recently uploaded (20)

PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
Teaching material agriculture food technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
August Patch Tuesday
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
1. Introduction to Computer Programming.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Tartificialntelligence_presentation.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Teaching material agriculture food technology
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Digital-Transformation-Roadmap-for-Companies.pptx
OMC Textile Division Presentation 2021.pptx
August Patch Tuesday
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mushroom cultivation and it's methods.pdf
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
1. Introduction to Computer Programming.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
Spectral efficient network and resource selection model in 5G networks
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

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