gpt4 book ai didi

amazon-web-services - 如何在 AWS CDK 中引用现有的 VPC 终端节点?

转载 作者:行者123 更新时间:2023-12-05 02:48:45 26 4
gpt4 key购买 nike

我如何在我的堆栈中查找和引用现有的 VPC 端点,以便我可以将它传递给 API Gateway RestApi() 以获得私有(private) API?

最佳答案

msshenke 的回答返回 Ivpc 我需要的是 vpc 端点引用。

这是我发现的

https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.InterfaceVpcEndpoint.html#static-from-wbr-interface-wbr-vpc-wbr-endpoint-wbr-attributesscope-id-attrs

需要提供现有的vpce id和安全组。

const ivpc = Vpc.InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes(this, "VPC", {
port: 443,
vpcEndpointId: "vpce-1234567890",
securityGroups: ["https-sg"] // or whatever you are using
});

关于amazon-web-services - 如何在 AWS CDK 中引用现有的 VPC 终端节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64346701/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com