SlideShare a Scribd company logo
1 of 44
Download to read offline
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Angelo Carvalho, Solutions Architect, AWS
22 de Setembro de 2016
Como construir suas aplicações
escaláveis sem servidores
Agenda
§ Overview of Serverless Architecture
§ Anatomy of a Web Application
§ Securing the Web Application
§ Demo
§ Other Options
Overview of Serverless
Architectures
Serverless? What’s that mean?
What is Serverless?
Provisioning
and Utilization
Operations
and Management
Scaling Availability and
Fault Tolerance
Removes the need for….
Benefits of Serverless?
Provisioning
and Utilization
Operations
and Management
Scaling Availability and
Fault Tolerance
Which leads to….
Low Cost Simple Low Latency Scalable Reliable
Platform of Serverless Products
Storage DatabaseCompute
Messaging and QueuesGateways
User Management
Internet of Things
Machine LearningStreaming Analytics
Real-time Processing
Streams
Files
ETL
IoT Backends
Web Application Serverless Architecture
Anatomy of a Web Application
What makes up a web application?
Let’s break it down…
What makes up a web application?
What makes up a web application?
What makes up a web application?
Serverless Web Application
Where did all the servers go?
Static Website Hosting on S3 - refresher
§ Specify an index document (i.e. index.html)
§ Specify an error document
§ Objects publicly readable
§ Supports redirects
§ All Requests
§ Conditional
bucket with
objects
API Gateway - refresher
Create Configure Publish
Maintain Monitor Secure
API Gateway – Stage Variables
§ Key/Value pairs used for configuration
§ Used for different stages of API
§ Specify a Lambda function name
§ Pass to backend
Lambda
§ Serverless, event-driven compute
§ Code is: NodeJS, Python, JVM based
§ Specify memory allocated
§ Determine what invokes the functions
§ API Gateway, S3, DynamoDB, Kinesis, SNS, SES, Cognito,
Cloudwatch Logs, Cloudwatch Events, CloudFormation,
Config, Scheduled Events
Lambda – Versioning and Aliases
Versioning
§ ARN for each one (immutable)
§ Versions of functions for Dev, Staging, Prod
Aliases
§ Point to a version
§ Have an ARN also
§ Event sources point to Alias ARNs
Lambda – Dynamic Configuration
One option:
§ Pull Configs from DDB
§ Write values to global vars
§ Code uses global vars
Lambda
Function
Amazon
DynamoDB
DynamoDB - refresher
§ NoSQL database
§ Keys: Hash Key and (optional) Range Key
§ Tips:
§ Plan your keys
§ Think about your queries
Serverless Web Application
…..but what’s missing from this
architecture?
Authentication/Authorization
Securing your Serverless
Web Application
AWS IAM and AWS STS
temporary
security
credential
AWS STS
AWS cloud
client
1
2
permissionsrole
AWS IAM
OR
Amazon API
Gateway
Action: [‘s3:*’,’sts:Get*’]
Effect: Allow
Resource: *
Securing API Gateway
Cognito and STS
Authentication Options with Cognito
Federated Identity Providers
• Amazon
• Facebook
• Google
Custom Developed Authentication System
Cognito Identity User Pools (Preview)
Unauthenticated vs Authenticated roles
§ Ability to define both in Cognito
§ Start out unauthenticated switch to authenticated!
§ browsing a blogging site then log in to post or comment
Example IAM Policy for API Gateway
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"execute-api:Invoke"
],
"Resource": [
"arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts",
"arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts/*",
"arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts/*/comments",
"arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts/*/comments/*",
"arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/POST/users",
"arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/POST/login"
]
}
]
}
Cognito – Authentication Flow
Amazon API
Gateway
AWS
Lambda
Other Security Features
§ IAM Roles for Lambda Functions
§ Client-side Encryption library using KMS for DynamoDB
Demo
Demo App Architecture
AWS Lambda
Functions
web browser
Amazon S3
Call Unauthenticated
APIs methods
StaticContent
Amazon
DynamoDB
Amazon
Cognito
Obtain
User Credentials
Amazon API
Gateway
encrypted
user data
AWS Lambda
Functions
Amazon
DynamoDB
Amazon API
Gateway
Authentication APIs
Obtain Authenticated
User Credentials
AWS STS
AWS Lambda
Functions –
Logic for POST
Functions
Amazon
DynamoDB
Amazon API
Gateway –
POST Functions
Call Authenticated
APIs methods
3
2
4
5
6
1
AWS KMS
Other Options
Authentication Options
Cognito:
• Federated Identity Providers (Amazon, Facebook, Google)
• Cognito Identity User Pools
Federated Web Identities
• Interact directly with STS and 3rd party identity providers
Authorization Options with API Gateway
API Gateway
Lambda Auth
function
Client
Request w/ a
bearer token
Policy is cached
Policy is
evaluated
AWS Lambda
functions
Endpoints on
Amazon EC2
Context + Token
Principal + Policy
403 Denied
Allowed
Any other publicly
accessible endpoint
Some Tidbits
§ Authorization failures to API Gateway get returned as a
CORS error
§ Lambda Functions as stage variable values = manual
permissions configuration
Architect to be Serverless
Fully Managed
§ No provisioning
§ Zero administration
§ High availability
Developer Productivity
§ Focus on the code that
matters
§ Innovate rapidly
§ Reduce time to market
Continuous Scaling
§ Automatically
§ Scale up and scale down
Q&A

More Related Content

What's hot

React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017
React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017
React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017
Amazon Web Services
 

What's hot (20)

Serverless Applications on AWS
Serverless Applications on AWSServerless Applications on AWS
Serverless Applications on AWS
 
AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)
AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)
AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)
 
React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017
React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017
React Fast by Processing Streaming Data - AWS Summit Tel Aviv 2017
 
Advanced Techniques for Federation of the AWS Management Console and Command ...
Advanced Techniques for Federation of the AWS Management Console and Command ...Advanced Techniques for Federation of the AWS Management Console and Command ...
Advanced Techniques for Federation of the AWS Management Console and Command ...
 
Let's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS LambdaLet's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS Lambda
 
使用 Serverless 技術打造支援 Alexa 的物聯網服務
使用 Serverless 技術打造支援 Alexa 的物聯網服務使用 Serverless 技術打造支援 Alexa 的物聯網服務
使用 Serverless 技術打造支援 Alexa 的物聯網服務
 
Azure web apps
Azure web appsAzure web apps
Azure web apps
 
Mobile App Development with Amazon Web Services Mobile Hub
Mobile App Development with Amazon Web Services Mobile HubMobile App Development with Amazon Web Services Mobile Hub
Mobile App Development with Amazon Web Services Mobile Hub
 
Delegating Access to your AWS Environment (SEC303) | AWS re:Invent 2013
Delegating Access to your AWS Environment (SEC303) | AWS re:Invent 2013Delegating Access to your AWS Environment (SEC303) | AWS re:Invent 2013
Delegating Access to your AWS Environment (SEC303) | AWS re:Invent 2013
 
[AWSKRUG&JAWS-UG Meetup #1] Serverless Real-Time Analysis
[AWSKRUG&JAWS-UG Meetup #1]  Serverless  Real-Time Analysis[AWSKRUG&JAWS-UG Meetup #1]  Serverless  Real-Time Analysis
[AWSKRUG&JAWS-UG Meetup #1] Serverless Real-Time Analysis
 
ELB를 활용한 Socket.IO 멀티노드 구축사례
ELB를 활용한 Socket.IO 멀티노드 구축사례ELB를 활용한 Socket.IO 멀티노드 구축사례
ELB를 활용한 Socket.IO 멀티노드 구축사례
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
 
AWS Service Drill Downs
AWS Service Drill DownsAWS Service Drill Downs
AWS Service Drill Downs
 
Contruyendo tu primera aplicación con AWS
Contruyendo tu primera aplicación con AWSContruyendo tu primera aplicación con AWS
Contruyendo tu primera aplicación con AWS
 
IAM Federation - Pop-up Loft TLV 2017
IAM Federation - Pop-up Loft TLV 2017IAM Federation - Pop-up Loft TLV 2017
IAM Federation - Pop-up Loft TLV 2017
 
Azure Web Apps Advanced Security
Azure Web Apps Advanced SecurityAzure Web Apps Advanced Security
Azure Web Apps Advanced Security
 
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
 
Microservices Architecture for Web Applications using AWS Lambda and more
Microservices Architecture for Web Applications using AWS Lambda and moreMicroservices Architecture for Web Applications using AWS Lambda and more
Microservices Architecture for Web Applications using AWS Lambda and more
 
Real-time Chat Backend on AWS IoT 20160422
Real-time Chat Backend on AWS IoT 20160422Real-time Chat Backend on AWS IoT 20160422
Real-time Chat Backend on AWS IoT 20160422
 
TechTalk@Vingle - Serverless
TechTalk@Vingle - ServerlessTechTalk@Vingle - Serverless
TechTalk@Vingle - Serverless
 

Viewers also liked (15)

Training Sessions
Training SessionsTraining Sessions
Training Sessions
 
Wwf tissue ppt121211
Wwf tissue ppt121211Wwf tissue ppt121211
Wwf tissue ppt121211
 
Leon foucault
Leon foucaultLeon foucault
Leon foucault
 
Plemininary task
Plemininary taskPlemininary task
Plemininary task
 
Bombonera girasol en fomy
Bombonera girasol   en fomyBombonera girasol   en fomy
Bombonera girasol en fomy
 
Presentation1 001
Presentation1 001Presentation1 001
Presentation1 001
 
Hoja tutor
Hoja tutorHoja tutor
Hoja tutor
 
The KAL 'Nut Rage' Incident_Julianne Oh.Annals 2015
The KAL 'Nut Rage' Incident_Julianne Oh.Annals 2015The KAL 'Nut Rage' Incident_Julianne Oh.Annals 2015
The KAL 'Nut Rage' Incident_Julianne Oh.Annals 2015
 
SMA-T2-Code Mobility for UbiGames
SMA-T2-Code Mobility for UbiGamesSMA-T2-Code Mobility for UbiGames
SMA-T2-Code Mobility for UbiGames
 
Presentation1
Presentation1Presentation1
Presentation1
 
Mode board2
Mode board2Mode board2
Mode board2
 
Macklemore CRACK
Macklemore CRACKMacklemore CRACK
Macklemore CRACK
 
0
00
0
 
Ayam Goreng Suharti
Ayam Goreng SuhartiAyam Goreng Suharti
Ayam Goreng Suharti
 
Matrimonio y Divorcio y su influencia en la salud mental
Matrimonio y Divorcio y su influencia en la salud mentalMatrimonio y Divorcio y su influencia en la salud mental
Matrimonio y Divorcio y su influencia en la salud mental
 

Similar to Como construir suas aplicações escaláveis sem servidores

Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 

Similar to Como construir suas aplicações escaláveis sem servidores (20)

Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Primeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverlessPrimeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverless
 
Raleigh DevDay 2017: Build a serverless web application in one day workshop
Raleigh DevDay 2017: Build a serverless web application in one day workshopRaleigh DevDay 2017: Build a serverless web application in one day workshop
Raleigh DevDay 2017: Build a serverless web application in one day workshop
 
Raleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applicationsRaleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applications
 
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
AWS March 2016 Webinar Series   Getting Started with Serverless ArchitecturesAWS March 2016 Webinar Series   Getting Started with Serverless Architectures
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
 
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Serverless Architectures on AWS - Pop-up Loft Tel Aviv
Serverless Architectures on AWS - Pop-up Loft Tel AvivServerless Architectures on AWS - Pop-up Loft Tel Aviv
Serverless Architectures on AWS - Pop-up Loft Tel Aviv
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Build an App on AWS for Your First 10 Million Users
Build an App on AWS for Your First 10 Million UsersBuild an App on AWS for Your First 10 Million Users
Build an App on AWS for Your First 10 Million Users
 
Connect and Interconnect – The Mesh of Event-Driven Compute and Marvelous Vir...
Connect and Interconnect – The Mesh of Event-Driven Compute and Marvelous Vir...Connect and Interconnect – The Mesh of Event-Driven Compute and Marvelous Vir...
Connect and Interconnect – The Mesh of Event-Driven Compute and Marvelous Vir...
 
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Como construir suas aplicações escaláveis sem servidores

  • 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Angelo Carvalho, Solutions Architect, AWS 22 de Setembro de 2016 Como construir suas aplicações escaláveis sem servidores
  • 2. Agenda § Overview of Serverless Architecture § Anatomy of a Web Application § Securing the Web Application § Demo § Other Options
  • 4. What is Serverless? Provisioning and Utilization Operations and Management Scaling Availability and Fault Tolerance Removes the need for….
  • 5. Benefits of Serverless? Provisioning and Utilization Operations and Management Scaling Availability and Fault Tolerance Which leads to…. Low Cost Simple Low Latency Scalable Reliable
  • 6. Platform of Serverless Products Storage DatabaseCompute Messaging and QueuesGateways User Management Internet of Things Machine LearningStreaming Analytics
  • 8. ETL
  • 11. Anatomy of a Web Application
  • 12. What makes up a web application? Let’s break it down…
  • 13. What makes up a web application?
  • 14. What makes up a web application?
  • 15. What makes up a web application?
  • 17. Where did all the servers go?
  • 18. Static Website Hosting on S3 - refresher § Specify an index document (i.e. index.html) § Specify an error document § Objects publicly readable § Supports redirects § All Requests § Conditional bucket with objects
  • 19. API Gateway - refresher Create Configure Publish Maintain Monitor Secure
  • 20. API Gateway – Stage Variables § Key/Value pairs used for configuration § Used for different stages of API § Specify a Lambda function name § Pass to backend
  • 21. Lambda § Serverless, event-driven compute § Code is: NodeJS, Python, JVM based § Specify memory allocated § Determine what invokes the functions § API Gateway, S3, DynamoDB, Kinesis, SNS, SES, Cognito, Cloudwatch Logs, Cloudwatch Events, CloudFormation, Config, Scheduled Events
  • 22. Lambda – Versioning and Aliases Versioning § ARN for each one (immutable) § Versions of functions for Dev, Staging, Prod Aliases § Point to a version § Have an ARN also § Event sources point to Alias ARNs
  • 23. Lambda – Dynamic Configuration One option: § Pull Configs from DDB § Write values to global vars § Code uses global vars Lambda Function Amazon DynamoDB
  • 24. DynamoDB - refresher § NoSQL database § Keys: Hash Key and (optional) Range Key § Tips: § Plan your keys § Think about your queries
  • 26. …..but what’s missing from this architecture?
  • 29. AWS IAM and AWS STS temporary security credential AWS STS AWS cloud client 1 2 permissionsrole AWS IAM OR Amazon API Gateway Action: [‘s3:*’,’sts:Get*’] Effect: Allow Resource: *
  • 32. Authentication Options with Cognito Federated Identity Providers • Amazon • Facebook • Google Custom Developed Authentication System Cognito Identity User Pools (Preview)
  • 33. Unauthenticated vs Authenticated roles § Ability to define both in Cognito § Start out unauthenticated switch to authenticated! § browsing a blogging site then log in to post or comment
  • 34. Example IAM Policy for API Gateway { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "execute-api:Invoke" ], "Resource": [ "arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts", "arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts/*", "arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts/*/comments", "arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/GET/posts/*/comments/*", "arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/POST/users", "arn:aws:execute-api:us-east-1:acctId:apigatewayID/*/POST/login" ] } ] }
  • 35. Cognito – Authentication Flow Amazon API Gateway AWS Lambda
  • 36. Other Security Features § IAM Roles for Lambda Functions § Client-side Encryption library using KMS for DynamoDB
  • 37. Demo
  • 38. Demo App Architecture AWS Lambda Functions web browser Amazon S3 Call Unauthenticated APIs methods StaticContent Amazon DynamoDB Amazon Cognito Obtain User Credentials Amazon API Gateway encrypted user data AWS Lambda Functions Amazon DynamoDB Amazon API Gateway Authentication APIs Obtain Authenticated User Credentials AWS STS AWS Lambda Functions – Logic for POST Functions Amazon DynamoDB Amazon API Gateway – POST Functions Call Authenticated APIs methods 3 2 4 5 6 1 AWS KMS
  • 40. Authentication Options Cognito: • Federated Identity Providers (Amazon, Facebook, Google) • Cognito Identity User Pools Federated Web Identities • Interact directly with STS and 3rd party identity providers
  • 41. Authorization Options with API Gateway API Gateway Lambda Auth function Client Request w/ a bearer token Policy is cached Policy is evaluated AWS Lambda functions Endpoints on Amazon EC2 Context + Token Principal + Policy 403 Denied Allowed Any other publicly accessible endpoint
  • 42. Some Tidbits § Authorization failures to API Gateway get returned as a CORS error § Lambda Functions as stage variable values = manual permissions configuration
  • 43. Architect to be Serverless Fully Managed § No provisioning § Zero administration § High availability Developer Productivity § Focus on the code that matters § Innovate rapidly § Reduce time to market Continuous Scaling § Automatically § Scale up and scale down
  • 44. Q&A