【发布时间】:2020-08-25 03:59:52
【问题描述】:
我在 AWS VPC(10.0.0.0/16) 中有我的内部网络,我想在这个私有网络中创建 AWS API 网关,因此没有公共主机名/ips。
这是我尝试过的
service: apollo-lambda1
provider:
name: aws
runtime: nodejs8.10
role: arn:aws:iam::xxx:role/admin-api-lambda-role
region: ap-southeast-1
private: true
vpc:
securityGroupIds:
- sg-xxxxx
subnetIds:
- subnet-xxx
sg-xxxxx 是一个安全组,只允许来自 10.0.0.0/16 的 ips。它没有帮助。
我也尝试添加,但它仍然向世界公开了一个公共 IP...
resourcePolicy:
- Effect: Allow
Principal: "*"
Action: execute-api:Invoke
Resource:
- execute-api:/*/*/*
Condition:
IpAddress:
aws:SourceIp:
- "10.0.0.0/16"
UPD:尝试了这种组合,但没有成功。现在无法解析 dns 名称
endpointType: PRIVATE
resourcePolicy:
- Effect: Allow
Principal: '*'
Action: execute-api:Invoke
Resource:
- execute-api:/*/*/*
Condition:
IpAddress:
aws:SourceIp:
- some ip here
【问题讨论】:
标签: amazon-web-services aws-api-gateway serverless-framework