15
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

社内限定サイトにCloudFrontを使う(EC2オリジン)

Last updated at Posted at 2016-04-26

例えば本番リリース前のAWS検証環境は、社内限定のアクセス制限をかけていることが多いと思いますが、
EC2のセキュリティグループを社内IPのみに制限していると、CloudFrontからのアクセスも遮断されてしまいます。

ですので、CloudFrontからのアクセスも許可しておく必要があります。

CloudFrontの送信元IPアドレスの範囲を以下のURLから確認します。
http://docs.aws.amazon.com/ja_jp/AmazonCloudFront/latest/DeveloperGuide/LocationsOfEdgeServers.html

※2017/4/27現在、以下のCIDRのみHTTP、HTTPSの通信を許可しています。

13.32.0.0/15
13.54.63.128/26
34.195.252.0/24
35.162.63.192/26
35.167.191.128/26
52.15.127.128/26
52.46.0.0/18
52.52.191.128/26
52.56.127.0/25
52.57.254.0/24
52.66.194.128/26
52.78.247.128/26
52.84.0.0/15
52.199.127.192/26
52.212.248.0/26
52.220.191.0/26
52.222.128.0/17
54.182.0.0/16
54.192.0.0/16
54.230.0.0/16
54.233.255.128/26
54.239.128.0/18
54.239.192.0/19
54.240.128.0/18
204.246.164.0/22
204.246.168.0/22
204.246.174.0/23
204.246.176.0/20
205.251.192.0/19
205.251.249.0/24
205.251.250.0/23
205.251.252.0/23
205.251.254.0/24
216.137.32.0/19

上記CIDRをHTTP、HTTPSに対して追加すると、34個分のルールが消費されてしまいます。
1セキュリティグループのルール設定上限値はデフォルトで50のため、このセキュリティグループはCloudFront専用とし、EC2個別のセキュリティ設定は、別途セキュリティグループを設定するのが良いと思います。

15
11
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?