Seb*_*ebS 5 amazon-web-services aws-cdk
如何查找并引用堆栈中的现有 VPC 终端节点,以便将其传递给 API Gateway RestApi() 以获取私有 API?
msshenke 的答案返回 Ivpc 我需要的是 vpc 端点引用。
这就是我发现的
需要提供现有的 vpce id 和安全组。
const ivpc = Vpc.InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes(this, "VPC", {
port: 443,
vpcEndpointId: "vpce-1234567890",
securityGroups: ["https-sg"] // or whatever you are using
});
Run Code Online (Sandbox Code Playgroud)
securityGroups属性可选
const ivpc = ec2.InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes(this, `vpceLookup`, {
vpcEndpointId : `vpce-abcdefgh123456789`,
port : 443
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6989 次 |
| 最近记录: |