やりたいこと
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"
}
}
}
]
}