서버리스(serverless)를 위한 zombie microservices workshop 실습 가이드 :: 윤석찬...

19
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 윤석찬 AW6 코리아 테크 에반젤리스트 (&1+/1&/14 Zombie Apocalypse Workshop 서버 없는 마이크w서비스 구성하기

Upload: amazon-web-services-korea

Post on 16-Apr-2017

952 views

Category:

Technology


3 download

TRANSCRIPT

© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

윤석찬AW6 코리아 테크 에반젤리스트(&1+/1&/14

Zombie Apocalypse Workshop서버 없는 마이크w서비스 구성하기

Zombie Microservices Workshop 소개

• 서버리스 아키텍처를 구성하는 실습 행사• 재미 있는 컨셉의 직접 참여하여 배우는 이벤트• AW6 클s우n 서비스를 실습할 수 있는 기회

• AmazBA /BgAitB• AW6 3am:da• AmazBA A42 1atewaI• AmazBA 0IAamB0.• AAd mBDeL

• AW6 전문가와의 i움까지!

행사 진행 시간표

(,&&Cm – 행사 소Q 및 진행 방법 안내(,)&Cm – 휴식 및 Q&A),&&Cm – Q별 실습 진행 실습 가이n 활용!+,&&Cm – 피n백 제출 및 기a품 수v

ZOMBIE가 나타났다!

전 세U적으w 좀비 P염이 시작l고, 많은 gi시o이 점v 당하고 있습de. P염이 더확산l기 전에 AW6 3am:da 기반 P시 시스템을 구축하여 P염l지 않은 살아있는생존자간 소통이 필요한 시점입de.

이벤트 기반의 마이크w서비스를 Q발하기 위한 플t폼으w서 AW6 3amda를 배우고, 이를 빠zS 배포, 운영 및 생존자의 접속에 따른 확장성을 b여야 합de. 본 워크샵은AW6 3am:da, AmazBA A42 1atewaI, AmazBA 0IAamB0.와 기타 AW6 서비스를기반으w 서버 없는 6eDGeDless! 애플리케이션을 구축해 보는 실습 행사입de.

팀을 이y어 몇 Q의 실습 코스를 진행할 수 있습de. 각 실습 코스는 독립적으w구성l어 있기 r문에 Ws서 하거나, 전부 e 하실 수i 있습de. 실습 코n를 모m완수하신 분o은 추가적으w 음료 및 식수 공급, 카카오톡 연동, 알렉사 연동을 통한홈네트워크 구성 p을 해 보실 수 있습de!

“좀비가 전 세계 도시를 점령하고 있다…”

2016 AWS Zombie Microservices Roadshow

• 전 세U 1)Q 지역에서 진행 중인 행사• 1&&&+ Q발자 및 고급 사용자가 참여 중• 스타트업 부터 엔터프s이즈 기업 Q발자 중 e양• 서버리스 아키텍처를 배울 수 있는 종합 실습 가이n

서버리스 마이크로서비스 아키텍처

Amazon S3정적 웹 사이트

AWS Lambda백엔드 로직

클라이언트

Amazon API GatewayREST API 인터페이스

Amazon Cognito인증 기능

Amazon DynamoDB데이터 스토어

좀비 생존자를 위한 채팅창

Zombie 채팅창 구현 요소

S3A new S3 bucket with single-page HTML5 web app

API Gateway/zombie/messages API with GET and POST methods

LambdaFunctions GetMessagesFromDynamoDB and WriteMessagesToDynamoDB

DynamoDBA ‘user, ‘talker’, ‘messages’ table to track channel, timestamp, message, and name

Zombie 서버리스 워크샵 기본 아키텍처

Internet

Activity Indicator

Chat Service

Activity

Messages

Search Service

DynamoDB Streams

ElasticsearchService

S3 Web HostingTwilio

Slack Chat

API Gateway

IoT Device

IoT Processing

Website

AWS IoT or Amazon

SNS

CognitoUserpools

CloudFormation

실습 소개What you’ll build today!

실습 전 인증 기능 세팅

Amazon Cognito Userpools 기능 활용• UseDCBBl 생성• 사용자 가입 항목 설정• 사용자 가입 시, 인증 방법 설정• 가입 후, w그인 후의 처리 방법 설정

3am:da 함수 연결!

Cognito Federated Identity 기능 설정• 인증 제공자w서 설정• 클s이언트에서 인증 제공자 설정

Lab 1: 생존자 채팅 기능

Internet Typing Indicator Service

talkers/talkers

Continuous GET Request polling of Typing Indicator Service to display current ‘talkers’

Single reusable service with DynamoDB PutItem implementation

POST from Zombie chat to /talkers with Name, Channel, Timestamp when survivor types message

Zombie Chat

Lab 2: Twilio 기반 SMS 연동

Internet Twilio Processing

Mobile/SMS

/message Chat Service messagesTwilio Phone

Number/twilio

Integration Response:Apache Velocity Template Language (VTL) to transform response to XML for Twilio

• Pre-process Twilio message• Convert/standardize incoming

parameters for Chat Service• HTTPS POST to Chat Service

• Design Principle: Service re-use• Single implementation of

DynamoDB PutItem

Integration Request:Apache Velocity Template Language (VTL) to transform POST parameters into JSON.

Lab 3: Elasticsearch 기반 채팅 메시지 검색

Search Service

Dynamo Streams

ElasticsearchService

messages

Kibana plugin with AmazonElasticsearch Service providesreal-time UI to search messages

Lambda function processes eventsand indexes them in AmazonElasticsearch Service

DynamoDB Streams provides atime-ordered flow of events(incoming survivor messages)

Amazon Elasticsearch Serviceprovides a managed service forsearch and analytics

Lab 4: Slack 메시지 연동

Chat Service

Slack Service

messagesSlack Chat Internet

Pre-process Slack message before sending message to Chat Service

• Design Principle: Service re-use• Single implementation of

DynamoDB PutItem

/slack /message

Lab 5: Intel Edison 좀비 모션 센서 연동

InternetZombie

Sensor Data

Zombie Sensor

Amazon SNS

/message

Chat Service messages

• Lambda subscribes to SNS Topic• Pre-process message• HTTPS POST to Chat Service

Node.js on Edison sends sensorevents to Amazon SNS

• Design Principle: Service re-use• Single implementation of

DynamoDB PutItem

도전 과제

기본 도전 과제1. 인증설정완료및채팅프로그램설정완료2. Twillo 및 Slack 연동3. Elasticsearch를통한메시지검색

추가 도전 과제1. Intel Edison 기반의 IoT 센서앱연동 (Lab 4를마치신분)2. 다중채팅방및비밀채팅방만들기 (개발도전과제)3. 카카오옐로 ID를통한메신저연동 (개발도전과제)4. Amazon SNS 서비스를이용한모바일노티보내기등등…

실습 시작하기

• 수준별실습룸이동및실습진행• 주의! 실습문서를정확하게따라가지않으면오류발생• 실수를줄이려면, 2-3명이한팀으로만들어보기• 새로코드짜는건없습니다… 다른사람을도와주세요!•

한국어실습문서http://bit.ly/awskr-zombie-lab

https://github.com/awslabs/aws-lambda-zombie-workshop

참고. 총 소요 비용 – 1달러 미만!Cost estimate to run this 3 hour workshop!

• Lambda: FREE• 1st 1m requests are free each month! Duration pricing will be sub-1penny!

• DynamoDB: $0.0585• $0.0065/hr for every 10 read units provisioned - 75 units provisioned/hr• $0.0065/hr for every 50 write units provisioned – 75 units provisioned/hr• DynamoDB Streams: 2.5m reads free per month

• ElasticSearch Service: $0.282• M3.medium with instance storage - $0.094/hr

• API Gateway: $0.035• $3.50/million API calls. Assume 10,000 calls made per hour during lab

• CloudWatch Logs: $0.25• $0.50 per GB/month ingested. Super high end estimate of 500MB of log data during workshop

• S3: $0.03• $0.03 per GB for first 1TB a month.

• Data Transfer: FREE• First 1GB/month out is free. Data transfer in is free!