SlideShare a Scribd company logo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
+ 9NJ
+ KG
+ ~
5GEu ENX NXSN $
p u
- ~
. /,, . ” m %
/ ~
0 h bUccBJ m %
1 ~ ”
,) f
­
x
E edUc JUS Tc E cUS TcNUU c
~ e
4
.,-0 -- 9NJ D RT
(
x
’
”
5GE JT MJ f
SERVICES (ANYTHING)EVENT SOURCE FUNCTION
5GE JT MJ u
5GE JT MJ
Amazon
S3
Amazon
DynamoDB
Amazon
Kinesis
Amazon
Cognito
DATA STORES ENDPOINTS
CONFIGURATION REPOSITORIES EVENT/MESSAGE SERVICES
AWS AWS AWS Amazon Amazon Amazon Cron
CloudFormation CloudTrail CodeCommit CloudWatch SES SNS events
Amazon
API Gateway
Amazon
Alexa
AWS
IoT
AWS Step
Functions
$ 5GE JT MJ u u
t 9 j J/
u 9NJ D RT
s
v ”
w
( 5GE
AWS Lambda
Amazon
DynamoDB
Amazon SNS
Amazon API
Gateway
Amazon SQS Amazon
Kinesis
Amazon S3
Orchestration & State Management
API Proxy Messaging and Queues Analytics
Monitoring and Debugging
Compute Storage Database
AWS X-Ray
AWS Step
Functions
Edge Compute
AWS Greengrass
Lambda@Edge
g
9NJ !
l
•
• 9 Uh J c V b
9 j SX
•
•
• F TUBJ ”
•
­
•
•
• A K
5+65+6
* s
•
• z
• E IUTeSU
• : dSX
5TJ 5 :JZN J f
x 9HA
”
5TJ 5 :JZN J u
Internet
Mobile
apps
AWS
Lambda
functions
API Gateway
DyanamoDB
Update
$ 5 :JZN J … e 5 u
s 9HA ? dUg i
t D RT
u 9HA 9HA
v <i <:
g
Amazon
Cognito
Amazon API
Gateway
AWS
Lambda
Amazon
DynamoDB
Amazon
ElastiCache
Amazon
RDS
View Blog Posts
(GETs)
Manage/edit blog posts
(POSTs)
Web-federated identity
& Cognito User Pools AWS
Lambda
Triggers for sign-ups
Amazon
SES
Mailers
Amazon
CloudFront
Amazon S3 S3 Events
On AWS Lambda
Static
Contents
Mobile
Apps
Websites
Partner
Services
https://aws.amazon.com/ko/solutions/case-studies/bustle/
” 1
-) .++ - u
+ KG
f TX b S Ud e SX S
y lf
§ .,-/ -1, ~ ( + +” +
-,
§ -,, - z A K
§ …~
-(,,,(,,,(,,,
x
(
(
(
§ ” n ox
§ xx (
x x
9NJ D RT 9HA ? dUg i
b
§ ” <Z W ­
Ø ” ( 9HA ? dUg i x
§ HidX
Ø x
§ 9NJ D RT S T cd bd
Ø S eTg dSX ”
D RT IJWWJ
IJWWJ
"name": {
"s3_bucket": "bucket-name",
"aws_region": "ap-northeast-2",
"app_function": "app.app",
"django_settings": "your_project.settings”
"environment_variables": {"your_key": "your_value"},
"keep_warm": true,
"memory_size": 128,
"timeout_seconds": 30,
"vpc_config": { "SubnetIds": ["subnet-12345678"] }
}
” ~ ( x
b hm
~ ”z .
z ,2. IUaeUcd +),2 %9HA ? dUg i #2 31
b
US.
”
‘ l
w v 4
f TX b S Ud e SX S
NU bU @ b W!
~
Chalice
Framework
~ ”
o
ENX NXSN 5WN 6SJ MRJ E 6QJSRLN IJWWJ
” …
~ F TUBJ
”
~
9NJ ~
x
<Z W > c
F TUBJ
HidX
B f
? W
F TUBJ
HidX
B f
F TUBJ HidX HidX
DA G G G G G
G r
%KUbb V b
O O O
G O O O O
‘ G r %LcUb)TUV UT
X T Ub
r %/bT bdi
Re TUbc
O O
O O r %H bd e d)
dUcd
O O
.) f
E dX E Sb cUbf SUc >e Sd c
n e
서버리스(Serverless) 웹 애플리케이션 구축하기
N AW f f
EVENT DRIVEN ONE LAMBDA PER HTTP METHOD
GET /pets
PUT /pets
DELETE /pets
GET /describe/pet/$id
PUT /describe/pet/$id
p
n u
l
/(,,,~
E9L 1,,
2,,
z HM /
KI -,$ https://www.youtube.com/watch?v=CM47-1UpgOc
cd S
D T : SUb
9NJ G cg b c
.
<: + SXU
.
.
u p
NUR cUbfUb +
: S Wb e T N b Ub +
I JK 9HA +
GIE +
:ec Ucc W S
l
>UUT
JU bSX
bT Nb d W
9T
J
l
ggg f W U Ud
f W U Ud
• ” ~ ( x
• ” ­ ~
API Gateway Lambda DynamoDB
(List of spam keywords)
POST /api/validates
Body: {
url: “goo.gl/xxx”
}
u ( $
• ” ) JX bdLID ”
• ~ ( ~ ­
• y ” x
( 1f a
§ ., ~
~ + +
§ 9HA
~
I JK @KKH”
§ z <U U TU Si
f … ( N AW R ENX NXSN
• D RT ~
­ ­
• D RT ‘(
• D RT
­
Write
code
Deploy to
customer
Build
and test
Receive
feedback
• 9NJ eT> b d ”
• D RT J9E
• x
• …~ ” %9 SXU . ,
Xdd c4++W dXeR S + gc Rc+cUbfUb Ucc)
S d ) TU
OXJ ZX LZ XN J 6 MN
5GE ENX NXSN 5WWSRLJZR ? MNS E5?$
E5?
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetHtmlFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri:
Handler:
Runtime:
s3://sam-demo-bucket/todo_list.zip
index.gethtml
nodejs4.3
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
ListTable:
Type: AWS::Serverless::SimpleTable
eT> b d
pdb cV b q J9E x
A9E D RT (
( PAH ( (
x
9HA ? dUg i
<i <: y 9NJ
</>
GitHub
Amazon S3
AWS CodeCommit
AWS CodeBuild
AWS CodeBuild
Third-party tools
AWS CloudFormation
Commit
Build
Test
Deploy
to Prod
( E5? 5GE 6 MN
AWS Lambda Functions
5GE 6 MNEZJX ( n
NT 3 5GE 6 MNEZJX u
/) J ( NX NXSN (N WXN u
+ ~
f i
• 5 TJPN 6 NXZNX y 4 9NJ D RT 9HA
? dUg i R bi bUc cU ) F TU BJ% Ki UcSb d
• D QZTS-WMO y 4 9NJ D RT 9HA ? dUg i
R bi bUc cU ) F TU BJ% Ki UcSb d
• EC - LNS 4 9NJ D RT 9HA ? dUg i R bi
bUc cU ) HidX
• 5E ) F 5 ENX NX4 JUbfUb Ucc 9HA %9NJ D RT )
F TU BJ% Ki UcSb d
ENX NXSN 5 p
CloudFront
distribution
API
Gateway
LambdaRDS
LambdaS3 Bucket
J ( NX NXSN (N WXN f
• F TU Zc h bUcc 9NJ
D RT 9 j 9HA ? dUg i JUbfUb Ucc
I JK 9HA
• 9NJ D RT Uh bUcc …
” x
https://github.com/awslabs/aws-serverless-express
y ENX NXSN 5 p
• 9NJ D RT 9HA
gc)cUbfUb Ucc)Uh bUcc
• ~ cUbfUb Ucc 9HA gc)cUbfUb Ucc)
Uh bUcc ”
J ( NX NXSN (N WXN ,$
§ app.local.ts
) ” app.ts app.listen()
) D S %D RT
h bUcc
( x
f c x!
• lambda.ts
) h bUcc aws-serverless-express
) 9NJ D RT X T Ub
J ( NX NXSN (N WXN -$
h bUcc
J ( NX NXSN (N WXN .$
9NJ D RT
x
J ( NX NXSN (N WXN /$
h bUcc
” x
Xdd c4++W dXeR S + UUb S +
b ed W)S db Ubc
• ” D RT gc)cUbfUb Ucc)Uh bUcc
b ed W)S db Ub ”
• 9 9HAc be W . cd S :U cd ” 9HA
J 9NJ D RT 9HA ? dUg i
• △ J
9NJ D RT 9HA ? dUg i
0) f u
5GE ? RSN ( f
- 9NJ
x
. GJ+ +
E R U J<C x
/ ­
p
q
AWS
IDENTITY & ACCESS
MANAGEMENT
AMAZON
S3 AMAZON
CLOUDFRONT
AMAZON
COGNITO
AMAZON
PINPOINT
AMAZON
SNS
AWS
DEVICE FARM
AMAZON
DYNAMODB
AWS
LAMBDA
f ­ u!
• ~
• Xdd c4++W dXeR S + gc Rc+ gc) R U)bU Sd)c U
• Xdd c4++W dXeR S + gc Rc+ gc) R UXeR)U RUb
• Xdd c4++W dXeR S + gc Rc+ gc) R U) S)c U
• Xdd c4++W dXeR S + gc Rc+ gc) R U) We b)S W d )c U
Trace Requests Record Traces View Service Map Analyze Issues
5GE H(DJ 3 JT MJ
5GE H(DJ 3 JT MJ
5GE EZNW 9 LZR
d JT MJ
p n
• y
x
•
y ‘ …
• y ” (
x
$ 5TJ 5 u
https://github.com/awslabs/lambda-refarch-imagerecognition
상태 머신
실행
사a 메타
데이터 추e
사a 메타
데이터 저장
이미지 인식
서비스 호e
f ( ­ z
MonitoringDeploymentIntegrationsCode Libraries
5
Xdd c4++ gc j S + +R Wc+S edU+WU Ub
dU)i eb) g ) )W dUg i)TUfU Ub) bd +
Xdd c4++ gc j S + +R Wc+S edU+ Ud jU
)i eb) c) ) gc) b Ud SU)ec W) )W dUg i+
API Gateway Developer Portal
JUbfUb Ucc 9 S d E TU %J9E ”
“
API Monetization in Marketplace
9NJ E b Ud SU 9HA
x
• a
• ” ” !
• ( ( … k
• p !
• 9NJ J9E %JUbfUb Ucc 9 S d E TU
• ~
• 9NJ O)I i( JdU >e Sd c
• 9NJ TUJd b( E R U@eR z ”
• rt
• 9NJCIL? cUbfUb Ucc !

More Related Content

서버리스(Serverless) 웹 애플리케이션 구축하기

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. + 9NJ + KG + ~ 5GEu ENX NXSN $ p u
  • 2. - ~ . /,, . ” m % / ~ 0 h bUccBJ m % 1 ~ ”
  • 4. ­ x E edUc JUS Tc E cUS TcNUU c ~ e
  • 7. 5GE JT MJ f SERVICES (ANYTHING)EVENT SOURCE FUNCTION
  • 9. 5GE JT MJ Amazon S3 Amazon DynamoDB Amazon Kinesis Amazon Cognito DATA STORES ENDPOINTS CONFIGURATION REPOSITORIES EVENT/MESSAGE SERVICES AWS AWS AWS Amazon Amazon Amazon Cron CloudFormation CloudTrail CodeCommit CloudWatch SES SNS events Amazon API Gateway Amazon Alexa AWS IoT AWS Step Functions
  • 10. $ 5GE JT MJ u u t 9 j J/ u 9NJ D RT s v ” w
  • 11. ( 5GE AWS Lambda Amazon DynamoDB Amazon SNS Amazon API Gateway Amazon SQS Amazon Kinesis Amazon S3 Orchestration & State Management API Proxy Messaging and Queues Analytics Monitoring and Debugging Compute Storage Database AWS X-Ray AWS Step Functions Edge Compute AWS Greengrass Lambda@Edge
  • 13. l • • 9 Uh J c V b 9 j SX • • • F TUBJ ” • ­ • • • A K 5+65+6 * s • • z • E IUTeSU • : dSX
  • 14. 5TJ 5 :JZN J f x 9HA ”
  • 15. 5TJ 5 :JZN J u
  • 16. Internet Mobile apps AWS Lambda functions API Gateway DyanamoDB Update $ 5 :JZN J … e 5 u s 9HA ? dUg i t D RT u 9HA 9HA v <i <:
  • 17. g Amazon Cognito Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon ElastiCache Amazon RDS View Blog Posts (GETs) Manage/edit blog posts (POSTs) Web-federated identity & Cognito User Pools AWS Lambda Triggers for sign-ups Amazon SES Mailers Amazon CloudFront Amazon S3 S3 Events On AWS Lambda Static Contents Mobile Apps Websites Partner Services https://aws.amazon.com/ko/solutions/case-studies/bustle/ ” 1
  • 18. -) .++ - u + KG f TX b S Ud e SX S
  • 19. y lf § .,-/ -1, ~ ( + +” + -, § -,, - z A K § …~ -(,,,(,,,(,,, x
  • 20. (
  • 21. (
  • 22. (
  • 23. § ” n ox § xx ( x x
  • 24. 9NJ D RT 9HA ? dUg i
  • 25. b § ” <Z W ­ Ø ” ( 9HA ? dUg i x § HidX Ø x § 9NJ D RT S T cd bd Ø S eTg dSX ” D RT IJWWJ
  • 26. IJWWJ "name": { "s3_bucket": "bucket-name", "aws_region": "ap-northeast-2", "app_function": "app.app", "django_settings": "your_project.settings” "environment_variables": {"your_key": "your_value"}, "keep_warm": true, "memory_size": 128, "timeout_seconds": 30, "vpc_config": { "SubnetIds": ["subnet-12345678"] } } ” ~ ( x
  • 27. b hm ~ ”z . z ,2. IUaeUcd +),2 %9HA ? dUg i #2 31
  • 29. w v 4 f TX b S Ud e SX S NU bU @ b W! ~
  • 31. o ENX NXSN 5WN 6SJ MRJ E 6QJSRLN IJWWJ ” … ~ F TUBJ ” ~ 9NJ ~ x <Z W > c F TUBJ HidX B f ? W F TUBJ HidX B f F TUBJ HidX HidX DA G G G G G G r %KUbb V b O O O G O O O O ‘ G r %LcUb)TUV UT X T Ub r %/bT bdi Re TUbc O O O O r %H bd e d) dUcd O O
  • 32. .) f
  • 33. E dX E Sb cUbf SUc >e Sd c n e
  • 35. N AW f f
  • 36. EVENT DRIVEN ONE LAMBDA PER HTTP METHOD GET /pets PUT /pets DELETE /pets GET /describe/pet/$id PUT /describe/pet/$id
  • 37. p n u l /(,,,~ E9L 1,, 2,, z HM / KI -,$ https://www.youtube.com/watch?v=CM47-1UpgOc
  • 38. cd S D T : SUb 9NJ G cg b c . <: + SXU . . u p NUR cUbfUb + : S Wb e T N b Ub + I JK 9HA + GIE + :ec Ucc W S l >UUT JU bSX bT Nb d W 9T J l ggg f W U Ud f W U Ud • ” ~ ( x • ” ­ ~
  • 39. API Gateway Lambda DynamoDB (List of spam keywords) POST /api/validates Body: { url: “goo.gl/xxx” } u ( $ • ” ) JX bdLID ” • ~ ( ~ ­ • y ” x
  • 40. ( 1f a § ., ~ ~ + + § 9HA ~ I JK @KKH” § z <U U TU Si
  • 41. f … ( N AW R ENX NXSN • D RT ~ ­ ­ • D RT ‘( • D RT ­ Write code Deploy to customer Build and test Receive feedback
  • 42. • 9NJ eT> b d ” • D RT J9E • x • …~ ” %9 SXU . , Xdd c4++W dXeR S + gc Rc+cUbfUb Ucc) S d ) TU OXJ ZX LZ XN J 6 MN 5GE ENX NXSN 5WWSRLJZR ? MNS E5?$
  • 43. E5? AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetHtmlFunction: Type: AWS::Serverless::Function Properties: CodeUri: Handler: Runtime: s3://sam-demo-bucket/todo_list.zip index.gethtml nodejs4.3 Policies: AmazonDynamoDBReadOnlyAccess Events: GetHtml: Type: Api Properties: Path: /{proxy+} Method: ANY ListTable: Type: AWS::Serverless::SimpleTable eT> b d pdb cV b q J9E x A9E D RT ( ( PAH ( ( x 9HA ? dUg i <i <: y 9NJ
  • 44. </> GitHub Amazon S3 AWS CodeCommit AWS CodeBuild AWS CodeBuild Third-party tools AWS CloudFormation Commit Build Test Deploy to Prod ( E5? 5GE 6 MN AWS Lambda Functions
  • 46. NT 3 5GE 6 MNEZJX u
  • 47. /) J ( NX NXSN (N WXN u + ~
  • 48. f i • 5 TJPN 6 NXZNX y 4 9NJ D RT 9HA ? dUg i R bi bUc cU ) F TU BJ% Ki UcSb d • D QZTS-WMO y 4 9NJ D RT 9HA ? dUg i R bi bUc cU ) F TU BJ% Ki UcSb d • EC - LNS 4 9NJ D RT 9HA ? dUg i R bi bUc cU ) HidX • 5E ) F 5 ENX NX4 JUbfUb Ucc 9HA %9NJ D RT ) F TU BJ% Ki UcSb d
  • 49. ENX NXSN 5 p CloudFront distribution API Gateway LambdaRDS LambdaS3 Bucket
  • 50. J ( NX NXSN (N WXN f • F TU Zc h bUcc 9NJ D RT 9 j 9HA ? dUg i JUbfUb Ucc I JK 9HA • 9NJ D RT Uh bUcc … ” x https://github.com/awslabs/aws-serverless-express
  • 51. y ENX NXSN 5 p • 9NJ D RT 9HA gc)cUbfUb Ucc)Uh bUcc • ~ cUbfUb Ucc 9HA gc)cUbfUb Ucc) Uh bUcc ”
  • 52. J ( NX NXSN (N WXN ,$ § app.local.ts ) ” app.ts app.listen() ) D S %D RT h bUcc ( x f c x!
  • 53. • lambda.ts ) h bUcc aws-serverless-express ) 9NJ D RT X T Ub
  • 54. J ( NX NXSN (N WXN -$ h bUcc
  • 55. J ( NX NXSN (N WXN .$ 9NJ D RT x
  • 56. J ( NX NXSN (N WXN /$ h bUcc ” x Xdd c4++W dXeR S + UUb S + b ed W)S db Ubc
  • 57. • ” D RT gc)cUbfUb Ucc)Uh bUcc b ed W)S db Ub ” • 9 9HAc be W . cd S :U cd ” 9HA J 9NJ D RT 9HA ? dUg i • △ J 9NJ D RT 9HA ? dUg i
  • 59. 5GE ? RSN ( f - 9NJ x . GJ+ + E R U J<C x / ­ p q
  • 60. AWS IDENTITY & ACCESS MANAGEMENT AMAZON S3 AMAZON CLOUDFRONT AMAZON COGNITO AMAZON PINPOINT AMAZON SNS AWS DEVICE FARM AMAZON DYNAMODB AWS LAMBDA
  • 61. f ­ u! • ~ • Xdd c4++W dXeR S + gc Rc+ gc) R U)bU Sd)c U • Xdd c4++W dXeR S + gc Rc+ gc) R UXeR)U RUb • Xdd c4++W dXeR S + gc Rc+ gc) R U) S)c U • Xdd c4++W dXeR S + gc Rc+ gc) R U) We b)S W d )c U
  • 62. Trace Requests Record Traces View Service Map Analyze Issues 5GE H(DJ 3 JT MJ
  • 63. 5GE H(DJ 3 JT MJ
  • 64. 5GE EZNW 9 LZR d JT MJ p n • y x • y ‘ … • y ” ( x
  • 65. $ 5TJ 5 u https://github.com/awslabs/lambda-refarch-imagerecognition 상태 머신 실행 사a 메타 데이터 추e 사a 메타 데이터 저장 이미지 인식 서비스 호e
  • 66. f ( ­ z MonitoringDeploymentIntegrationsCode Libraries
  • 67. 5 Xdd c4++ gc j S + +R Wc+S edU+WU Ub dU)i eb) g ) )W dUg i)TUfU Ub) bd + Xdd c4++ gc j S + +R Wc+S edU+ Ud jU )i eb) c) ) gc) b Ud SU)ec W) )W dUg i+ API Gateway Developer Portal JUbfUb Ucc 9 S d E TU %J9E ” “ API Monetization in Marketplace 9NJ E b Ud SU 9HA x
  • 68. • a • ” ” ! • ( ( … k • p ! • 9NJ J9E %JUbfUb Ucc 9 S d E TU • ~ • 9NJ O)I i( JdU >e Sd c • 9NJ TUJd b( E R U@eR z ” • rt • 9NJCIL? cUbfUb Ucc !