【问题标题】:AWS Cloudformation failing to acknowledge AutoScalingGroupAWS Cloudformation 未能确认 AutoScalingGroup
【发布时间】:2017-08-11 03:46:15
【问题描述】:

在使用 CloudFormation 创建 EC2 实例以及自动缩放组时,我遇到了以下错误: The following resource(s) failed to create: [WebsInstanceServerGroup].

image of CloudFormation Group output

在创建弹性伸缩组时看到失败,但是当我查看弹性伸缩组控制台时,它说创建“成功”。 (“进行中”删除发生在 CloudFormation 的 15 分钟超时值之后)。

image of AutoScaling output

CloudFormation 未确认 AutoScale 组已成功创建的原因可能是什么?

这个错误也提到了WebInstanceServerGroup,所以我检查了我的模板,但没有发现任何可疑之处。

"WebsInstanceServerGroup": {
  "Type": "AWS::AutoScaling::AutoScalingGroup",
  "Properties": {
    "AvailabilityZones": {
      "Fn::GetAZs": "AWS::Region"
    },
    "VPCZoneIdentifier": {
      "Ref": "WebsELBSubnetId"
    },
    "LoadBalancerNames": [
      {
        "Ref": "WebsELB"
      }
    ],
    "LaunchConfigurationName": {
      "Ref": "WebsEC2Instance"
    },
    "Cooldown": 300,
    "HealthCheckGracePeriod": 600,
    "HealthCheckType": "EC2",
    "Tags": [
      {
        "Key": "Name",
        "Value": {
          "Ref": "WebsInstanceName"
        },
        "PropagateAtLaunch": "true"
      },
      {
        "Key": "Service",
        "Value": {
          "Ref": "ServiceTag"
        },
        "PropagateAtLaunch": "true"
      }
    ],
    "MinSize": {
      "Ref": "ASGMin"
    },
    "DesiredCapacity": {
      "Ref": "ASGDesired"
    },
    "MaxSize": {
      "Ref": "ASGMax"
    }
  },
  "CreationPolicy": {
    "ResourceSignal": {
      "Count": {
        "Ref": "ASGMin"
      },
      "Timeout": "PT15M"
    }
  }
}

如果需要更多信息,请告诉我,提前致谢。

【问题讨论】:

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


    【解决方案1】:

    您的自动扩展组中的 EC2 实例似乎没有发送 the required success signals。

    CloudFormation 将等待您发送ASGMin 信号,然后再考虑成功创建您的WebsInstanceServerGroup。因此,如果 ASGMin 设置为 3,则您的 3 个 EC2 实例中的每一个都应该发送一个信号。

    要发送信号,您可以使用cfn-signal 助手或with the AWS CLI:

    aws cloudformation signal-resource \ 
      --stack-name {your stack name here} \
      --status SUCCESS \ 
      --logical-resource-id WebsInstanceServerGroup \ 
      --unique-id {the instance ID for the EC2 instance that is sending the signal}
    

    在您的 User Data 脚本末尾使用此命令,当您认为您的 EC2 实例已完全配置并准备就绪时。

    【讨论】:

      猜你喜欢
      • 2022-07-08
      • 2017-07-16
      • 2014-01-07
      • 2021-12-23
      • 2020-08-21
      • 2017-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多