首先创建个API,然后进入API配置,点击左边的资源配置,加入以下配置:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "execute-api:Invoke", "Resource": "REPLACE_ME_WITH_METHOD_ARN", "Condition": { "IpAddress": { "aws:SourceIp": [ "REPLACE_ME_WITH_YOUR_IP" ] } } } ] }
最后重新部署API即可生效。
参考:
https://lobster1234.github.io/2018/04/14/amazon-api-gateway-ip-whitelisting/
https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-resource-policy-access/
https://beabetterdev.com/2021/09/29/api-gateway-allow-ip-tutorial/
标签:API,IP,AWS,WhileList,api,https,gateway From: https://www.cnblogs.com/colder/p/16737373.html