SlideShare a Scribd company logo
AWS Lambdas with a Static Outgoing IP
2017. Mar. 8.
한종원 (addnull@hbsmith.io)
발표자 소개
• 한종원
• https://www.linkedin.com/in/addnull/
• Python과 Cloud Infra, Lean/Agile 방법론 그리고 애플의 제품을 사랑.
• 2012년 석사 학위를 마치고, 스타트업을 시작 (이때부터 AWS를 production level에서 사용)
• '의미가 있는 일을, 올바르게 하고 싶다.'
• 경력
• (현) DevOps 전문 스타트업 ‘HB Smith’ 대표 (https://hbsmith.io)
• (2016) 택시 O2O 서비스 스타트업 ‘Kanizsa Lab’의 backend server / infra devops 담당
• (2015) Cloud computing 전문 스타트업 'A2 company' co-founder (‘KINX’에 인수합병)
• (2012) Samsung Software Membership (대전)
• (2010) Samsung Software Membership (수원)
• (2007) NEXON 'MapleStory 국내 Live Team'에서 DBA, SA로 근무 (산업 기능 요원)
2
발표 내용
• Requirements
• System Architecture
• Live Demo
• Wrap Up
• QnA
• (예상 발표시간: 25~30분)
3
Requirements
Requirements
• IP whitelist가 적용된 서버에 요청을 보내야함
• 단, 이런 요청을 매우 낮은 빈도로 보냄
• 즉, EC2를 쓰기엔 비용이 아까우니, Lambda를 고려
• 그럼, Lambda가 실행되는 VM의 IP address를

특정 EIP로 고정할 수 있을까?
5
Requirements
• 그런데, Lambda 설정에 EIP 지정 옵션이 없음
6
Requirements
• 대신에 Lambda를 VPC 안에서 실행되게 만들 수 있음
• 오늘 발표는 Lambda를 가장한, VPC 발표
• [Reference]

http://techblog.financialengines.com/2016/09/26/aws-lambdas-with-a-static-outgoing-ip/
7
System Architecture
System Architecture
• VPC resources
• 1 public subnet
• private subnets
• NAT GW
• Internet GW
• EIP
• Route tables
• Security groups
• IAM resources
• 1 IAM role
• IAM role polices
9
System Architecture
• Network flow (녹색)
• Lambda (Private subnet)



-> Router



-> NAT GW(Public subnet)



-> Router



-> Internet GW
10
System Architecture
• Network flow (step by step)
• Step 1.
• 원하는 trigger로 Lambda 실행 요청
• private 1 또는 2에서 Lambda가 실행됨
• Lambda에서 VPC 외부(Internet)로 접근
11
System Architecture
• Step 2.
• 해당 Lambda의 private subnet의 route table에 의해서

NAT GW가 있는 public subnet으로 routing
12
System Architecture
• Step 3.
• NAT GW의 public subnet의 route table에 의해서

Internet GW으로 routing (즉, 외부 Internet 접근 성공)
• 이때, 외부 Internet 에 노출되는 IP address는

Lambda가 실행되는 VM의 IP address가 아니라 NAT GW의 EIP
13
Live Demo
Live Demo
• ‘자, 어디서 시작할까?’
15
Live Demo
• Project ‘Johanna’(‘Tiamat’의 CLI)의 수정 버전

(git branch ‘live-demo-20170308’)
• https://github.com/HardBoiledSmith/johanna/tree/live-demo-20170308
• Live demo resources
• ‘config.json.sample’
• run script (python3) for create/terminate VPC
• AWS IAM role and polices
• AWS Lambda sample code (print outgoing IP address)
16
Live Demo
• Step by step
• Step 1.
• ‘config.json’ 생성(‘config.json.sample’ 참고)
• https://github.com/HardBoiledSmith/johanna/blob/live-demo-20170308/config.json.sample
17
Live Demo
• Step by step
• Step 2.
• ‘./run.py create’
• 약 1~2분 후, VPC 와 필요한 AWS resource 생성 완료

(left: 생성 이전, right: 생성 이후)
18
Live Demo
• Step by step
• Step 3.
• ‘Lambda’ 생성(‘sample_lambda/get_ip_address.js’ 참고)
• https://github.com/HardBoiledSmith/johanna/blob/live-demo-20170308/sample_lambda/
get_ip_address.js
• NAT EIP 주소와 ‘Lambda’ 실행 결과 비교
19
Wrap Up
Wrap Up
• Requirements

EIP 지정할 수 없는 Lambda의 outgoing IP 주소를 고정하고 싶다
• System Architecture

VPC를 이용한 network flow
• Live Demo

‘Johanna’로 VPC 설정 및 실제 Lambda 실행 후 결과 확인
• Wrap Up
• QnA
21
Q n A
한종원
addnull@hbsmith.io
010-9166-6855

More Related Content

PDF
HB Smith에서는 AWS 이렇게 사용한다
PDF
AWS Summit - AWS를 통한 신뢰성 높은 지속적 배포 및 통합(CD, CI) ᄉ...
PDF
Daily Continuous Deployment를 위한 Custom CLI 개발 및
 AWS Elastic Beanstalk에 적용하기
PDF
AWSKRUG 소개 및 연혁 (정민영) - 4회 정기 세미나
PDF
Project TIMAT - infrastructure as code
PPTX
AWS Lambda를 이용한 CI/CD 기법
PDF
20181108 HBSmith에서는 이렇게 AWS IaC로 배포한다
PDF
20180915 HBSmith에서는 Django 이렇게 사용한다
HB Smith에서는 AWS 이렇게 사용한다
AWS Summit - AWS를 통한 신뢰성 높은 지속적 배포 및 통합(CD, CI) ᄉ...
Daily Continuous Deployment를 위한 Custom CLI 개발 및
 AWS Elastic Beanstalk에 적용하기
AWSKRUG 소개 및 연혁 (정민영) - 4회 정기 세미나
Project TIMAT - infrastructure as code
AWS Lambda를 이용한 CI/CD 기법
20181108 HBSmith에서는 이렇게 AWS IaC로 배포한다
20180915 HBSmith에서는 Django 이렇게 사용한다

What's hot (20)

PDF
20181126 AWS S3, SPA, 그리고 Vue.JS - HBSmith는 어떻게 Frontend를 Serverle...
PDF
Crawling with AWS Lambda
PPTX
DevOps (AWS, Docker, Ansible, Jenkins)
PDF
20180124 스타트업부터 대기업까지 aws와 함께한 7년
PDF
20170829 HB Smith에서는 AWS 이렇게 사용한다
PDF
20170718 hb smith에서는 aws 이렇게 사용한다
PDF
ALB+EC2 to API gateway + Lambda
PDF
Aws로 ci하기 안기욱
PDF
온라인 주문 서비스를 서버리스 아키텍쳐로 구축하기 - 김태우(Classmethod) :: AWS Community Day Online 2020
PDF
Elastic beanstalk - 판교 초급자 모임 - 안병학
PDF
Docker와 DevOps에서 Serverless와 NoOps로의 여정
PDF
클라우드 춘추전국시대 서버 개발자 생존기
PPTX
Serverless Architecture - 김현민
PDF
[Gaming on AWS] 넥슨 - AWS를 활용한 모바일 게임 서버 개발: 퍼즐 주주의 사례
PDF
20171013 데이터 분석가를 위한 데이터플랫폼 Seminar - Public Cloud 101
PDF
[Gaming on AWS] AWS 위에서의 Dev & Test, 그리고 비용 - 위메이드
PDF
PaaS를 이용한 No Ops 개발
PDF
DevOps와 자동화
PDF
Ansible과 CloudFormation을 이용한 배포 자동화
PDF
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
20181126 AWS S3, SPA, 그리고 Vue.JS - HBSmith는 어떻게 Frontend를 Serverle...
Crawling with AWS Lambda
DevOps (AWS, Docker, Ansible, Jenkins)
20180124 스타트업부터 대기업까지 aws와 함께한 7년
20170829 HB Smith에서는 AWS 이렇게 사용한다
20170718 hb smith에서는 aws 이렇게 사용한다
ALB+EC2 to API gateway + Lambda
Aws로 ci하기 안기욱
온라인 주문 서비스를 서버리스 아키텍쳐로 구축하기 - 김태우(Classmethod) :: AWS Community Day Online 2020
Elastic beanstalk - 판교 초급자 모임 - 안병학
Docker와 DevOps에서 Serverless와 NoOps로의 여정
클라우드 춘추전국시대 서버 개발자 생존기
Serverless Architecture - 김현민
[Gaming on AWS] 넥슨 - AWS를 활용한 모바일 게임 서버 개발: 퍼즐 주주의 사례
20171013 데이터 분석가를 위한 데이터플랫폼 Seminar - Public Cloud 101
[Gaming on AWS] AWS 위에서의 Dev & Test, 그리고 비용 - 위메이드
PaaS를 이용한 No Ops 개발
DevOps와 자동화
Ansible과 CloudFormation을 이용한 배포 자동화
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
Ad

Similar to AWS Lambdas with a Static Outgoing IP (20)

PDF
[2017 AWS Startup Day] 서버리스 마이크로서비스로 일당백 개발조직 만들기
PDF
20180124 naver labs aws network and security
PPTX
DevOps with AWS Edge
PPTX
Aws lambda 와 함께 서버리스 서비스 만들기
PDF
Meetup tools for-cloud_native_apps_meetup20180510-vs
PDF
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나- IBM Bluemix
PDF
[D2 COMMUNITY] Open Container Seoul Meetup - 마이크로 서비스 아키텍쳐와 Docker kubernetes
PPTX
마이크로서비스 아키텍처로 개발하기
PDF
SOSCON 2017 - Backend.AI
PDF
Openshift 활용을 위한 Application의 준비, Cloud Native
PPTX
Aws serverless services
PDF
EKS를 통한 차량 공유 서비스 '타다' 서비스 구축기 - 김태호, VCNC :: AWS Summit Seoul 2019
PDF
20190214 Startup의 한정된 자원(인력, 자금)에서 AWS를 효율적으로 사ᄋ...
PDF
[OpenStack Days Korea 2016] Innovating OpenStack Network with SDN solution
PDF
사례들로 알아보는 컨테이너, 언제 어떻게 쓰면 좋을까? – 김성수 AWS 솔루션즈 아키텍트, 허준 AWS 어카운트 매니저, 이창명 선데이토...
PPTX
Open standard open cloud engine (3)
PDF
AWS CLOUD 2018- 보다 강력한 Serverless, AWS Lambda 기능 확장(안효빈 솔루션즈 아키텍트)
PDF
AWS re:Invent 특집(1) – 파이선(Python) 개발자를 위한 AWS 활용 방법 (윤석찬)
PDF
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
PDF
designing, implementing and delivering microservices with event storming, spr...
[2017 AWS Startup Day] 서버리스 마이크로서비스로 일당백 개발조직 만들기
20180124 naver labs aws network and security
DevOps with AWS Edge
Aws lambda 와 함께 서버리스 서비스 만들기
Meetup tools for-cloud_native_apps_meetup20180510-vs
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나- IBM Bluemix
[D2 COMMUNITY] Open Container Seoul Meetup - 마이크로 서비스 아키텍쳐와 Docker kubernetes
마이크로서비스 아키텍처로 개발하기
SOSCON 2017 - Backend.AI
Openshift 활용을 위한 Application의 준비, Cloud Native
Aws serverless services
EKS를 통한 차량 공유 서비스 '타다' 서비스 구축기 - 김태호, VCNC :: AWS Summit Seoul 2019
20190214 Startup의 한정된 자원(인력, 자금)에서 AWS를 효율적으로 사ᄋ...
[OpenStack Days Korea 2016] Innovating OpenStack Network with SDN solution
사례들로 알아보는 컨테이너, 언제 어떻게 쓰면 좋을까? – 김성수 AWS 솔루션즈 아키텍트, 허준 AWS 어카운트 매니저, 이창명 선데이토...
Open standard open cloud engine (3)
AWS CLOUD 2018- 보다 강력한 Serverless, AWS Lambda 기능 확장(안효빈 솔루션즈 아키텍트)
AWS re:Invent 특집(1) – 파이선(Python) 개발자를 위한 AWS 활용 방법 (윤석찬)
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
designing, implementing and delivering microservices with event storming, spr...
Ad

More from Jongwon Han (13)

PDF
20191226 LEGACYLAND에서 살아남는 법
PDF
20190518 개발하기 좋은 날
PDF
20190418 Read Replicas and Django DB Router - AWS Summit Seoul 2019
PDF
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
PDF
20180609 BIT computer - AWS를 활용한 클라우드 기반 웹 개발 2주차
PDF
20180602 BIT computer - AWS를 활용한 클라우드 기반 웹 개발 1주차
PDF
20171221 naver labs aws 101
PDF
20170813 django api server unit test and remote debugging
PDF
20170422 HB Smith - Primer workshop
PDF
HB Smith - Primer workshop
PDF
HB Smith - business plan - live hero - public
PDF
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...
PDF
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)
20191226 LEGACYLAND에서 살아남는 법
20190518 개발하기 좋은 날
20190418 Read Replicas and Django DB Router - AWS Summit Seoul 2019
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
20180609 BIT computer - AWS를 활용한 클라우드 기반 웹 개발 2주차
20180602 BIT computer - AWS를 활용한 클라우드 기반 웹 개발 1주차
20171221 naver labs aws 101
20170813 django api server unit test and remote debugging
20170422 HB Smith - Primer workshop
HB Smith - Primer workshop
HB Smith - business plan - live hero - public
Backend server monitoring and alarm system (collectd, graphite, grafana, zabb...
DV 환경에서 PG 연동하기 ('우리 안의 소리', 2015-11-19)

AWS Lambdas with a Static Outgoing IP

  • 1. AWS Lambdas with a Static Outgoing IP 2017. Mar. 8. 한종원 (addnull@hbsmith.io)
  • 2. 발표자 소개 • 한종원 • https://www.linkedin.com/in/addnull/ • Python과 Cloud Infra, Lean/Agile 방법론 그리고 애플의 제품을 사랑. • 2012년 석사 학위를 마치고, 스타트업을 시작 (이때부터 AWS를 production level에서 사용) • '의미가 있는 일을, 올바르게 하고 싶다.' • 경력 • (현) DevOps 전문 스타트업 ‘HB Smith’ 대표 (https://hbsmith.io) • (2016) 택시 O2O 서비스 스타트업 ‘Kanizsa Lab’의 backend server / infra devops 담당 • (2015) Cloud computing 전문 스타트업 'A2 company' co-founder (‘KINX’에 인수합병) • (2012) Samsung Software Membership (대전) • (2010) Samsung Software Membership (수원) • (2007) NEXON 'MapleStory 국내 Live Team'에서 DBA, SA로 근무 (산업 기능 요원) 2
  • 3. 발표 내용 • Requirements • System Architecture • Live Demo • Wrap Up • QnA • (예상 발표시간: 25~30분) 3
  • 5. Requirements • IP whitelist가 적용된 서버에 요청을 보내야함 • 단, 이런 요청을 매우 낮은 빈도로 보냄 • 즉, EC2를 쓰기엔 비용이 아까우니, Lambda를 고려 • 그럼, Lambda가 실행되는 VM의 IP address를
 특정 EIP로 고정할 수 있을까? 5
  • 6. Requirements • 그런데, Lambda 설정에 EIP 지정 옵션이 없음 6
  • 7. Requirements • 대신에 Lambda를 VPC 안에서 실행되게 만들 수 있음 • 오늘 발표는 Lambda를 가장한, VPC 발표 • [Reference]
 http://techblog.financialengines.com/2016/09/26/aws-lambdas-with-a-static-outgoing-ip/ 7
  • 9. System Architecture • VPC resources • 1 public subnet • private subnets • NAT GW • Internet GW • EIP • Route tables • Security groups • IAM resources • 1 IAM role • IAM role polices 9
  • 10. System Architecture • Network flow (녹색) • Lambda (Private subnet)
 
 -> Router
 
 -> NAT GW(Public subnet)
 
 -> Router
 
 -> Internet GW 10
  • 11. System Architecture • Network flow (step by step) • Step 1. • 원하는 trigger로 Lambda 실행 요청 • private 1 또는 2에서 Lambda가 실행됨 • Lambda에서 VPC 외부(Internet)로 접근 11
  • 12. System Architecture • Step 2. • 해당 Lambda의 private subnet의 route table에 의해서
 NAT GW가 있는 public subnet으로 routing 12
  • 13. System Architecture • Step 3. • NAT GW의 public subnet의 route table에 의해서
 Internet GW으로 routing (즉, 외부 Internet 접근 성공) • 이때, 외부 Internet 에 노출되는 IP address는
 Lambda가 실행되는 VM의 IP address가 아니라 NAT GW의 EIP 13
  • 15. Live Demo • ‘자, 어디서 시작할까?’ 15
  • 16. Live Demo • Project ‘Johanna’(‘Tiamat’의 CLI)의 수정 버전
 (git branch ‘live-demo-20170308’) • https://github.com/HardBoiledSmith/johanna/tree/live-demo-20170308 • Live demo resources • ‘config.json.sample’ • run script (python3) for create/terminate VPC • AWS IAM role and polices • AWS Lambda sample code (print outgoing IP address) 16
  • 17. Live Demo • Step by step • Step 1. • ‘config.json’ 생성(‘config.json.sample’ 참고) • https://github.com/HardBoiledSmith/johanna/blob/live-demo-20170308/config.json.sample 17
  • 18. Live Demo • Step by step • Step 2. • ‘./run.py create’ • 약 1~2분 후, VPC 와 필요한 AWS resource 생성 완료
 (left: 생성 이전, right: 생성 이후) 18
  • 19. Live Demo • Step by step • Step 3. • ‘Lambda’ 생성(‘sample_lambda/get_ip_address.js’ 참고) • https://github.com/HardBoiledSmith/johanna/blob/live-demo-20170308/sample_lambda/ get_ip_address.js • NAT EIP 주소와 ‘Lambda’ 실행 결과 비교 19
  • 21. Wrap Up • Requirements
 EIP 지정할 수 없는 Lambda의 outgoing IP 주소를 고정하고 싶다 • System Architecture
 VPC를 이용한 network flow • Live Demo
 ‘Johanna’로 VPC 설정 및 실제 Lambda 실행 후 결과 확인 • Wrap Up • QnA 21