gpt4 book ai didi

amazon-web-services - Cloudformation "AWS::EC2::SecurityGroup"对象,原因为 "No default VPC for this user"

转载 作者:行者123 更新时间:2023-12-03 07:32:43 24 4
gpt4 key购买 nike

我正在尝试在 Cloudformation 中创建堆栈 - 我正在使用此处的 Windows 角色和功能示例模板: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-applications-us-east-1.html

我一直在测试 cloudformation,看看它是否是我想尝试的东西。启动堆栈时,我在创建“AWS::EC2::SecurityGroup”对象时不断遇到错误,原因是“此用户没有默认 VPC”

我目前有 1 个带有许多不同子网的 VPC。我在 JSON 中添加了一个部分来指定 VPC 和子网,但在创建堆栈时仍然收到此错误。这是我添加的内容:

“VpcId”:{ “类型”:“字符串”, "Description": "您现有虚拟私有(private)云 (VPC) 的 VpcId" },

"Subnets" : {
"Type" : "CommaDelimitedList",
"Description" : "The list of SubnetIds, for at least two Availability Zones in the region in your Virtual Private Cloud (VPC)"
},

有人知道如何解决这个问题吗?或者我可能会错过什么。正如我所说,我实际上正在使用示例模板。谢谢

最佳答案

您需要提供 VPC ID:

  • 如果您有现有 VPC,请提供其 VPC ID,例如:"VpcId": "vpc-12345678"

  • 如果您在同一 CloudFormation 模板中创建 VPC,则需要引用它,例如 "VpcId": { "Ref": "myvpc"} myvpc 是您在模板中创建的 AWS::EC2::VPC 资源的资源名称。

关于amazon-web-services - Cloudformation "AWS::EC2::SecurityGroup"对象,原因为 "No default VPC for this user",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33400124/

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