【问题标题】:Cloudformation "AWS::EC2::SecurityGroup" object with the Reason "No default VPC for this user"Cloudformation“AWS::EC2::SecurityGroup”对象,原因为“此用户没有默认 VPC”
【发布时间】:2015-10-29 09:59:02
【问题描述】:

我正在尝试在 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”:{ “类型”:“字符串”, “描述”:“您现有的虚拟私有云 (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)"
},

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

【问题讨论】:

    标签: amazon-web-services amazon-ec2 amazon-cloudformation


    【解决方案1】:

    您需要提供一个 VPC id:

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

    • 如果您在同一个 CloudFormation 模板中创建 VPC,则需要引用它,例如 "VpcId" : { "Ref" : "myvpc" } 是 myvpc 是您在模板。

    【讨论】:

    • 感谢您的帮助。我添加了一个参数来指定默认 VPC。我遇到的下一个问题是,在创建“AWS::EC2::Instance”时,我遇到了同样的错误。 “未找到此用户的默认 VPC” 在属性中添加“VpcId”引用后,我收到错误:“WindowsServer Encountered unsupported property VpcId” - 然后文档显示 VpcId 不是“EC2::实例”值。 " 那么如果我无法将 VpcId 项添加到我的实例中,我该如何指定使用哪个 VPC?
    • 实例(在 VPC 中)被启动到子网中。 VPC 包含一个或多个子网。您需要在启动实例时提供 SubnetId。见docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/…。
    猜你喜欢
    • 2022-09-30
    • 2015-12-14
    • 2018-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-28
    • 2020-01-31
    • 1970-01-01
    相关资源
    最近更新 更多