-
heroku info
でRegionを調べる- 例えば以下のように表示される
Region: us
-
heroku regions --json
でHerokuの各Regionの詳細を表示し、name欄が上記のRegionである要素を探す- 例えば「us」であれば以下
{
"country": "United States",
"created_at": "2012-11-21T20:44:16Z",
"description": "United States",
"id": "59accabd-516d-4f0e-83e6-6e3757701145",
"locale": "Virginia",
"name": "us",
"private_capable": false,
"provider": {
"name": "amazon-web-services",
"region": "us-east-1"
},
"updated_at": "2016-08-09T22:03:28Z"
},
-
当該要素のproviderのregionの値を取得する
- 上記例だと「us-east-1」
-
ブラウザで https://ip-ranges.amazonaws.com/ip-ranges.json をダウンロードし、その中からregionが対象regionかつserviceがAMAZONである要素群全てのip_prefix/ipv6_prefixが「ありえるIPアドレス範囲」となる
- 例えば「us-east-1」だとip_prefixだけで140個くらいありそう
- しかも変更可能性もある
- 詳細は https://docs.aws.amazon.com/ja_jp/general/latest/gr/aws-ip-ranges.html#subscribe-notifications
{
"ip_prefix": "18.208.0.0/13",
"region": "us-east-1",
"service": "AMAZON"
},
もしもWhitelistに登録するためにHerokuのIPアドレスを知りたいのなら、「多数」「変更可能性あり」なので非現実的、どうしてもと言うなら https://devcenter.heroku.com/articles/quotaguardstatic 等のInbound IP Address固定アドオンを検討すべき
ちなみにQuotaGuard Staticは「a62b1d0b4983db763450411fd393b3ce-eu-west-1.getstatica.com」等の覚えにくいドメインのURLを許容するか、それが嫌ならカスタムドメインを適用する必要あり