错误:在此VPC中没有名为“Deprecated_Private_NAT”的子网组。可用类型:公共

huangapple go评论56阅读模式
英文:

Error: There are no 'Deprecated_Private_NAT' subnet groups in this VPC. Available types: Public

问题

为什么在我尝试调用的子网类型是PRIVATE_WITH_NAT时,我会得到这个错误?

vpc_subnets = aws_ec2.SubnetSelection(
    subnets=vpc.select_subnets(subnet_type=aws_ec2.SubnetType(aws_ec2.SubnetType.PRIVATE_WITH_NAT)).subnets
),

错误 错误: 在此VPC中没有'Deprecated_Private_NAT'子网组。可用类型: Public

我尝试打印子网类型的值,但没有deprecated_private_NAT

print([t.value for t in aws_ec2.SubnetType])
['PRIVATE_ISOLATED', 'PRIVATE_WITH_EGRESS', 'PRIVATE_WITH_NAT', 'PUBLIC']
英文:

Why am I getting this error when the subnet type that I'm trying to call is PRIVATE_WITH_NAT?

vpc_subnets = aws_ec2.SubnetSelection(
    subnets=vpc.select_subnets(subnet_type=aws_ec2.SubnetType(aws_ec2.SubnetType.PRIVATE_WITH_NAT)).subnets
),

Error Error: There are no 'Deprecated_Private_NAT' subnet groups in this VPC. Available types: Public

I tried to print the value of subnet type, but no deprecated_private_NAT.

print([t.value for t in aws_ec2.SubnetType])
['PRIVATE_ISOLATED', 'PRIVATE_WITH_EGRESS', 'PRIVATE_WITH_NAT', 'PUBLIC']

答案1

得分: 2

在CDK的(Typescript)源代码中,SubnetType.PRIVATE_WITH_NAT 枚举的字符串值为 Deprecated_Private_NAT。我不知道jsii如何将其转换为Python。

无论如何,PRIVATE_WITH_NAT 已被弃用。请改用 PRIVATE_WITH_EGRESS

请注意,错误消息表明您的VPC只有公共子网可用。

英文:

In the CDK's (Typescript) source code, the string value of the SubnetType.PRIVATE_WITH_NAT enum is Deprecated_Private_NAT. I don't know how jsii converts this to Python.

In any case, PRIVATE_WITH_NAT is deprecated. Use PRIVATE_WITH_EGRESS instead.

Note, though, that the error message suggests your VPC only has Public subnets available.

huangapple
  • 本文由 发表于 2023年2月24日 14:51:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75553386.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定