Help us understand the problem. What is going on with this article?

AWS api gatewayでstagesごとにIP制限をかける

More than 1 year has passed since last update.

やりたいこと

API Gateway のstages ごとにIP許諾の設定をする。

やったこと

Resource Policyで各stagesにIPを指定する。

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "execute-api:Invoke",
            "Resource": "arn:aws:execute-api:region:account-id:api-id/stage-name1/*",
            "Condition": {
                "IpAddress": {
                    "aws:SourceIp": "hogehoge"
                }
            }
        },
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "execute-api:Invoke",
            "Resource": "arn:aws:execute-api:region:account-id:api-id/stage-name2/*",
            "Condition": {
                "IpAddress": {
                    "aws:SourceIp": "fugafuga"
                }
            }
        }
    ]
}

参照:Amazon API Gateway : API を呼び出すためのアクセスの制御

h_kamada
ozvision
購買プラットフォーム「ハピタス」を開発・運営するベンチャー企業
https://www.oz-vision.co.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away