英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论