vpcとvpc peeringのおはなし

Post on 13-Jul-2015

1.483 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

VPCとVPC Peeringのおはなし

JAWS-UG Tokyo #20 @ SAP

classmethod.jp 1

自己紹介

• 望月 政夫

• クラスメソッド所属

• 1988年生まれ

• I love

• お仕事 : AWS構築・運用のおてつだい

• 好きなAWSサービス : Route 53

classmethod.jp 2

Twitter:@Canelmo

昔話をします

• 私がAWSを使い始めたころ(2012/08)

– Default VPCなんてなかった

– EC2-Classicという呼称もなかった

– 当時のシステムはEC2-Classicで構築

• VPCに対応していないサービスもあった

– ElastiCacheとか(現在は対応済み)

classmethod.jp 3

EC2-Classicの頃は…

• Public/Private IPが起動のたび変わる

• Running中のSecurityGroup変更不可

• アウトバウンド通信を制限できない

• StopするとEIPが外れる

classmethod.jp 4

VPC

• VPCはそれぞれが独立したリソース

• CIDRの同じVPCを複数作成できる

• VPNをオンプレと張る場合はVPCの

CIDRに対する考慮が必要

classmethod.jp 5

VPC

• VPCはそれぞれが独立したリソース

• CIDRの同じVPCを複数作成できる

• VPNをオンプレと張る場合はVPCの

CIDRに対する考慮が必要

• ミスると・・・classmethod.jp 6

VPC

• VPCはそれぞれが独立したリソース

• CIDRの同じVPCを複数作成できる

• VPNをオンプレと張る場合はVPCの

CIDRに対する考慮が必要

• ミスると・・・classmethod.jp 7

VPCでできるようになった

• システム内でのPrivate通信

• SecurityGroupの動的変更

• EIPのつけ直しが必要ない

classmethod.jp 8

VPCでできなくなった

• 別アカウントのインスタンスとの

Private通信

• 以前は別アカウントのセキュリティグループ

を指定して通信を許可することが可能だった

classmethod.jp 9

VPC Peering実現の流れ

• VPC作成

• CreateVPCPeeringConnection

• AcceptVPCPeeringConnection

• RouteTable,SecurityGroupの設定

classmethod.jp 11

VPC Peering実現の流れ

classmethod.jp 12

http://dev.classmethod.jp/cloud/vpc-peering-restricts-and-

considerations/

Shared Server Pattern

• 共通の仕組みは一つのVPCに持たせる

• 各システムのVPCは、共通VPCに対してPeeringを張る

• 全てのVPCから一つのシステムを利用可

classmethod.jp 13

Shared Server Pattern

classmethod.jp 14

VPC Peeringの制限事項

• 通信できる範囲はVPC間のみ

– Peering先のVPCを経由した通信はNG

• 同時に張れるPeeringは50がLimit

• CIDRが同じVPC同士は通信不可

classmethod.jp 15

本編は以上

以下、おまけです

classmethod.jp 16

classmethod.jp 17

classmethod.jp 18

AWSのギーク話

なのに、コードが一行も出てこない話をしていいのか・・・?

※個人の感想です

classmethod.jp 19

AWSのギーク話

なのに、コードが一行も出てこない話をしていいのか・・・?

※個人の感想です

なにか書かないと!※あくまでも個人の感想です

classmethod.jp 20

VPC Peering実現の流れ

• VPC作成

• CreateVPCPeeringConnection

• AcceptVPCPeeringConnection

• RouteTable,SecurityGroupの設定

classmethod.jp 21

VPC Peering実現の流れ

• VPC作成

• CreateVPCPeeringConnection

• AcceptVPCPeeringConnection

• RouteTable,SecurityGroupの設定

classmethod.jp 22

CloudFormationで自動化できない!

classmethod.jp 23

CloudFormationで自動化できない!

classmethod.jp 24

自動化の仕組みがないなら

仕組みを作ればいいじゃない!

説明

• CloudFormation Custom Resourceを利用

• Stack作成時SNSから自前ApplicationにHTTP Notificationを飛ばす

• SinatraアプリがPeeringのRequestとAcceptを行う

classmethod.jp 25

classmethod.jp 26

①作成

②通知 ③通知

④Create/

Accept

VPC Peeringの作成

classmethod.jp 27

完了通知

classmethod.jp 28

まとめ

• VPC Peeringで異なるVPCの通信が可能

• もうEC2-Classicでなければできないことはない(?)

• CloudFormation Custom Resource使えばだいたい何でもできる!– https://github.com/classmethod-aws/cloudformationpeering

classmethod.jp 29

最後に

classmethod.jp 30

ご清聴ありがとうございました

classmethod.jp 31

classmethod.jp

top related