【问题标题】:Creating security groups from Cloud Formation template fails with "group already exists"从 Cloud Formation 模板创建安全组失败并显示“组已存在”
【发布时间】:2014-07-06 05:50:06
【问题描述】:

我已经设置了一个创建组和 SQS 队列的 CF 文件,但是当我推送它时它总是失败,说我正在创建的安全组已经存在(这没有任何意义):

"ApiSecurityGroupProduction": {
    "Type": "AWS::EC2::SecurityGroup",
    "Properties": {
        "GroupDescription": "Group for the api instances",
        "GroupName": "api_production",
        "SecurityGroupIngress": [
            {
                "IpProtocol": "tcp",
                "FromPort": "8000",
                "ToPort": "8000",
                "SourceSecurityGroupId": "sg-843f59ed"
            },
            {
                "IpProtocol": "tcp",
                "FromPort": "22",
                "ToPort": "22",
                "SourceSecurityGroupName": "chef_server"
            }
        ]
    }
}

它失败了:

14:20:38 UTC-0300   CREATE_FAILED   AWS::EC2::SecurityGroup ApiSecurityGroupProduction  api_production already exists

此事件是在同一组创建之后生成的。为什么会在这里发生?我必须在这里设置一些其他配置才能使其正常工作吗?

【问题讨论】:

  • 您能粘贴或链接到更多您的 CF 模板吗?尤其是任何其他安全组。
  • 您的模板看起来不错。如果您在同一个 AWS 账户中确实没有同名的 SG,那么如果您有支持,我会开票。
  • 谢谢,我会这么做的!

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


【解决方案1】:

最后问题出在GroupName 属性上,一旦它被删除,组就被正确创建了。

【讨论】:

    猜你喜欢
    • 2021-08-25
    • 2016-10-30
    • 1970-01-01
    • 1970-01-01
    • 2018-12-07
    • 2018-09-15
    • 2019-01-11
    • 1970-01-01
    • 2019-05-05
    相关资源
    最近更新 更多