AWS Autoscaled EC2实例在使用CloudFormation时无法启动。

huangapple go评论73阅读模式
英文:

AWS Autoscaled EC2 instance failing to launch with cloudformation

问题

我正在尝试从CloudFormation启动自动扩展的EC2实例,以下是我的CloudFormation模板。我收到了以下错误:

> 收到 0 个成功信号中的 1 个。无法满足 100% MinSuccessfulInstancesPercent 要求。

一旦出现这个错误,堆栈就会回滚并删除所有资源。

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "AWS CloudFormation Sample Template AutoScalingRollingUpdates: Create a load balanced, Auto Scaled sample website. This example creates an Auto Scaling group behind a load balancer with a simple health check. The AutoScaling launch configuration includes an update policy that will keep 2 instances running while doing an autoscaling rolling upgrade. **WARNING** This template creates one or more Amazon EC2 instances and an Application Load Balancer. You will be billed for the AWS resources used if you create a stack from this template.",
  "Parameters": {
    "VpcId": {
      "Type": "AWS::EC2::VPC::Id",
      "Description": "VpcId of your existing Virtual Private Cloud (VPC)",
      "ConstraintDescription": "must be the VPC Id of an existing Virtual Private Cloud."
    },
    "Subnets": {
      "Type": "List<AWS::EC2::Subnet::Id>",
      "Description": "The list of SubnetIds in your Virtual Private Cloud (VPC)",
      "ConstraintDescription": "must be a list of at least two existing subnets associated with at least two different availability zones. They should be residing in the selected Virtual Private Cloud."
    },
    "InstanceType": {
      "Description": "WebServer EC2 instance type",
      "Type": "String",
      "Default": "t2.nano",
      "AllowedValues": ["t1.micro", "t2.nano", "t2.micro", "t2.small", "t2.medium", "t2.large", "m1.small", "m1.medium", "m1.large", "m1.xlarge", "m2.xlarge", "m2.2xlarge", "m2.4xlarge", "m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge", "m4.large", "m4.xlarge", "m4.2xlarge", "m4.4xlarge", "m4.10xlarge", "c1.medium", "c1.xlarge", "c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", "c3.8xlarge", "c4.large", "c4.xlarge", "c4.2xlarge", "c4.4xlarge", "c4.8xlarge", "g2.2xlarge", "g2.8xlarge", "r3.large", "r3.xlarge", "r3.2xlarge", "r3.4xlarge", "r3.8xlarge", "i2.xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge", "d2.xlarge", "d2.2xlarge", "d2.4xlarge", "d2.8xlarge", "hi1.4xlarge", "hs1.8xlarge", "cr1.8xlarge", "cc2.8xlarge", "cg1.4xlarge"],
      "ConstraintDescription": "must be a valid EC2 instance type."
    },
    "KeyName": {
      "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
      "Type": "AWS::EC2::KeyPair::KeyName",
      "ConstraintDescription": "must be the name of an existing EC2 KeyPair."
    },
    "SSHLocation": {
      "Description": "The IP address range that can be used to SSH to the EC2 instances",
      "Type": "String",
      "MinLength": "9",
      "MaxLength": "18",
      "Default": "0.0.0.0/0",
      "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
      "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
    }
  },
  "Mappings": {
    "Region2Examples": {
      "us-east-1": { "Examples": "https://s3.amazonaws.com/cloudformation-examples-us-east-1" },
      "us-west-2": { "Examples": "https://s3-us-west-2.amazonaws.com/cloudformation-examples-us-west-2"

<details>
<summary>英文:</summary>

I am trying to launch Autoscaling EC2 instance from cloudformation and below is my cloudformation. i am getting error as

&gt; Received 0 SUCCESS signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement.

and after i get this error stack is rolling back and deleting all the resources.

&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;

&lt;!-- language: lang-html --&gt;

    {
      &quot;AWSTemplateFormatVersion&quot;: &quot;2010-09-09&quot;,

      &quot;Description&quot;: &quot;AWS CloudFormation Sample Template AutoScalingRollingUpdates: Create a load balanced, Auto Scaled sample website. This example creates an Auto Scaling group behind a load balancer with a simple health check. The AutoScaling launch configuration includes an update policy that will keep 2 instances running while doing an autoscaling rolling upgrade. **WARNING** This template creates one or more Amazon EC2  instances and an Application Load Balancer. You will be billed for the AWS resources used if you create a stack from this template.&quot;,

      &quot;Parameters&quot;: {
        &quot;VpcId&quot; : {
          &quot;Type&quot; : &quot;AWS::EC2::VPC::Id&quot;,
          &quot;Description&quot; : &quot;VpcId of your existing Virtual Private Cloud (VPC)&quot;,
          &quot;ConstraintDescription&quot; : &quot;must be the VPC Id of an existing Virtual Private Cloud.&quot;
        },
      
        &quot;Subnets&quot; : {
          &quot;Type&quot; : &quot;List&lt;AWS::EC2::Subnet::Id&gt;&quot;,
          &quot;Description&quot; : &quot;The list of SubnetIds in your Virtual Private Cloud (VPC)&quot;,
          &quot;ConstraintDescription&quot; : &quot;must be a list of at least two existing subnets associated with at least two different availability zones. They should be residing in the selected Virtual Private Cloud.&quot;
        },

        &quot;InstanceType&quot;: {
          &quot;Description&quot;: &quot;WebServer EC2 instance type&quot;,
          &quot;Type&quot;: &quot;String&quot;,
          &quot;Default&quot;: &quot;t2.nano&quot;,
          &quot;AllowedValues&quot;: [ &quot;t1.micro&quot;, &quot;t2.nano&quot;, &quot;t2.micro&quot;, &quot;t2.small&quot;, &quot;t2.medium&quot;, &quot;t2.large&quot;, &quot;m1.small&quot;, &quot;m1.medium&quot;, &quot;m1.large&quot;, &quot;m1.xlarge&quot;, &quot;m2.xlarge&quot;, &quot;m2.2xlarge&quot;, &quot;m2.4xlarge&quot;, &quot;m3.medium&quot;, &quot;m3.large&quot;, &quot;m3.xlarge&quot;, &quot;m3.2xlarge&quot;, &quot;m4.large&quot;, &quot;m4.xlarge&quot;, &quot;m4.2xlarge&quot;, &quot;m4.4xlarge&quot;, &quot;m4.10xlarge&quot;, &quot;c1.medium&quot;, &quot;c1.xlarge&quot;, &quot;c3.large&quot;, &quot;c3.xlarge&quot;, &quot;c3.2xlarge&quot;, &quot;c3.4xlarge&quot;, &quot;c3.8xlarge&quot;, &quot;c4.large&quot;, &quot;c4.xlarge&quot;, &quot;c4.2xlarge&quot;, &quot;c4.4xlarge&quot;, &quot;c4.8xlarge&quot;, &quot;g2.2xlarge&quot;, &quot;g2.8xlarge&quot;, &quot;r3.large&quot;, &quot;r3.xlarge&quot;, &quot;r3.2xlarge&quot;, &quot;r3.4xlarge&quot;, &quot;r3.8xlarge&quot;, &quot;i2.xlarge&quot;, &quot;i2.2xlarge&quot;, &quot;i2.4xlarge&quot;, &quot;i2.8xlarge&quot;, &quot;d2.xlarge&quot;, &quot;d2.2xlarge&quot;, &quot;d2.4xlarge&quot;, &quot;d2.8xlarge&quot;, &quot;hi1.4xlarge&quot;, &quot;hs1.8xlarge&quot;, &quot;cr1.8xlarge&quot;, &quot;cc2.8xlarge&quot;, &quot;cg1.4xlarge&quot;]
    ,
          &quot;ConstraintDescription&quot;: &quot;must be a valid EC2 instance type.&quot;
        },

        &quot;KeyName&quot;: {
          &quot;Description&quot;: &quot;Name of an existing EC2 KeyPair to enable SSH access to the instances&quot;,
          &quot;Type&quot;: &quot;AWS::EC2::KeyPair::KeyName&quot;,
          &quot;ConstraintDescription&quot; : &quot;must be the name of an existing EC2 KeyPair.&quot;
        },

        &quot;SSHLocation&quot; : {
          &quot;Description&quot; : &quot;The IP address range that can be used to SSH to the EC2 instances&quot;,
          &quot;Type&quot;: &quot;String&quot;,
          &quot;MinLength&quot;: &quot;9&quot;,
          &quot;MaxLength&quot;: &quot;18&quot;,
          &quot;Default&quot;: &quot;0.0.0.0/0&quot;,
          &quot;AllowedPattern&quot;: &quot;(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})&quot;,
          &quot;ConstraintDescription&quot;: &quot;must be a valid IP CIDR range of the form x.x.x.x/x.&quot;
        }
      },

      &quot;Mappings&quot;: {
        &quot;Region2Examples&quot; : {
          &quot;us-east-1&quot;      : { &quot;Examples&quot; : &quot;https://s3.amazonaws.com/cloudformation-examples-us-east-1&quot; },
          &quot;us-west-2&quot;      : { &quot;Examples&quot; : &quot;https://s3-us-west-2.amazonaws.com/cloudformation-examples-us-west-2&quot; },
          &quot;us-west-1&quot;      : { &quot;Examples&quot; : &quot;https://s3-us-west-1.amazonaws.com/cloudformation-examples-us-west-1&quot; },
          &quot;eu-west-1&quot;      : { &quot;Examples&quot; : &quot;https://s3-eu-west-1.amazonaws.com/cloudformation-examples-eu-west-1&quot; },
          &quot;eu-west-2&quot;      : { &quot;Examples&quot; : &quot;https://s3-eu-west-2.amazonaws.com/cloudformation-examples-eu-west-2&quot; },
          &quot;eu-central-1&quot;   : { &quot;Examples&quot; : &quot;https://s3-eu-central-1.amazonaws.com/cloudformation-examples-eu-central-1&quot; },
          &quot;ap-southeast-1&quot; : { &quot;Examples&quot; : &quot;https://s3-ap-southeast-1.amazonaws.com/cloudformation-examples-ap-southeast-1&quot; },
          &quot;ap-northeast-1&quot; : { &quot;Examples&quot; : &quot;https://s3-ap-northeast-1.amazonaws.com/cloudformation-examples-ap-northeast-1&quot; },
          &quot;ap-northeast-2&quot; : { &quot;Examples&quot; : &quot;https://s3-ap-northeast-2.amazonaws.com/cloudformation-examples-ap-northeast-2&quot; },
          &quot;ap-southeast-2&quot; : { &quot;Examples&quot; : &quot;https://s3-ap-southeast-2.amazonaws.com/cloudformation-examples-ap-southeast-2&quot; },
          &quot;ap-south-1&quot;     : { &quot;Examples&quot; : &quot;https://s3-ap-south-1.amazonaws.com/cloudformation-examples-ap-south-1&quot; },
          &quot;us-east-2&quot;      : { &quot;Examples&quot; : &quot;https://s3-us-east-2.amazonaws.com/cloudformation-examples-us-east-2&quot; },
          &quot;ca-central-1&quot;   : { &quot;Examples&quot; : &quot;https://s3-ca-central-1.amazonaws.com/cloudformation-examples-ca-central-1&quot; },
          &quot;sa-east-1&quot;      : { &quot;Examples&quot; : &quot;https://s3-sa-east-1.amazonaws.com/cloudformation-examples-sa-east-1&quot; },
          &quot;cn-north-1&quot;     : { &quot;Examples&quot; : &quot;https://s3.cn-north-1.amazonaws.com.cn/cloudformation-examples-cn-north-1&quot; }
        }
    ,
        &quot;AWSInstanceType2Arch&quot; : {
          &quot;t1.micro&quot;    : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;t2.nano&quot;     : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;t2.micro&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;t2.small&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;t2.medium&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;t2.large&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m1.small&quot;    : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;m1.medium&quot;   : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;m1.large&quot;    : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;m1.xlarge&quot;   : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;m2.xlarge&quot;   : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;m2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;m2.4xlarge&quot;  : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;m3.medium&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m3.large&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m3.xlarge&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m3.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m4.large&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m4.xlarge&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m4.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m4.4xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;m4.10xlarge&quot; : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c1.medium&quot;   : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;c1.xlarge&quot;   : { &quot;Arch&quot; : &quot;PV64&quot;   },
          &quot;c3.large&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c3.xlarge&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c3.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c3.4xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c3.8xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c4.large&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c4.xlarge&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c4.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c4.4xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;c4.8xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;g2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVMG2&quot;  },
          &quot;g2.8xlarge&quot;  : { &quot;Arch&quot; : &quot;HVMG2&quot;  },
          &quot;r3.large&quot;    : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;r3.xlarge&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;r3.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;r3.4xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;r3.8xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;i2.xlarge&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;i2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;i2.4xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;i2.8xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;d2.xlarge&quot;   : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;d2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;d2.4xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;d2.8xlarge&quot;  : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;hi1.4xlarge&quot; : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;hs1.8xlarge&quot; : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;cr1.8xlarge&quot; : { &quot;Arch&quot; : &quot;HVM64&quot;  },
          &quot;cc2.8xlarge&quot; : { &quot;Arch&quot; : &quot;HVM64&quot;  }
        },

        &quot;AWSInstanceType2NATArch&quot; : {
          &quot;t1.micro&quot;    : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;t2.nano&quot;     : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;t2.micro&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;t2.small&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;t2.medium&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;t2.large&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m1.small&quot;    : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;m1.medium&quot;   : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;m1.large&quot;    : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;m1.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;m2.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;m2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;m2.4xlarge&quot;  : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;m3.medium&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m3.large&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m3.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m3.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m4.large&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m4.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m4.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m4.4xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;m4.10xlarge&quot; : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c1.medium&quot;   : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;c1.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATPV64&quot;   },
          &quot;c3.large&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c3.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c3.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c3.4xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c3.8xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c4.large&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c4.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c4.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c4.4xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;c4.8xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;g2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVMG2&quot;  },
          &quot;g2.8xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVMG2&quot;  },
          &quot;r3.large&quot;    : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;r3.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;r3.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;r3.4xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;r3.8xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;i2.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;i2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;i2.4xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;i2.8xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;d2.xlarge&quot;   : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;d2.2xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;d2.4xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;d2.8xlarge&quot;  : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;hi1.4xlarge&quot; : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;hs1.8xlarge&quot; : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;cr1.8xlarge&quot; : { &quot;Arch&quot; : &quot;NATHVM64&quot;  },
          &quot;cc2.8xlarge&quot; : { &quot;Arch&quot; : &quot;NATHVM64&quot;  }
        }
    ,
        &quot;AWSRegionArch2AMI&quot; : {
          &quot;us-east-1&quot;        : {&quot;PV64&quot; : &quot;ami-2a69aa47&quot;, &quot;HVM64&quot; : &quot;ami-00068cd7555f543d5&quot;, &quot;HVMG2&quot; : &quot;ami-035240afa793cddbb&quot;},
          &quot;us-west-2&quot;        : {&quot;PV64&quot; : &quot;ami-7f77b31f&quot;, &quot;HVM64&quot; : &quot;ami-7172b611&quot;, &quot;HVMG2&quot; : &quot;ami-60aa3700&quot;},
          &quot;us-west-1&quot;        : {&quot;PV64&quot; : &quot;ami-a2490dc2&quot;, &quot;HVM64&quot; : &quot;ami-31490d51&quot;, &quot;HVMG2&quot; : &quot;ami-4b694d2b&quot;},
          &quot;eu-west-1&quot;        : {&quot;PV64&quot; : &quot;ami-4cdd453f&quot;, &quot;HVM64&quot; : &quot;ami-f9dd458a&quot;, &quot;HVMG2&quot; : &quot;ami-2955524f&quot;},
          &quot;eu-west-2&quot;        : {&quot;PV64&quot; : &quot;NOT_SUPPORTED&quot;, &quot;HVM64&quot; : &quot;ami-886369ec&quot;, &quot;HVMG2&quot; : &quot;NOT_SUPPORTED&quot;},
          &quot;eu-central-1&quot;     : {&quot;PV64&quot; : &quot;ami-6527cf0a&quot;, &quot;HVM64&quot; : &quot;ami-ea26ce85&quot;, &quot;HVMG2&quot; : &quot;ami-81ac71ee&quot;},
          &quot;ap-northeast-1&quot;   : {&quot;PV64&quot; : &quot;ami-3e42b65f&quot;, &quot;HVM64&quot; : &quot;ami-374db956&quot;, &quot;HVMG2&quot; : &quot;ami-46220c21&quot;},
          &quot;ap-northeast-2&quot;   : {&quot;PV64&quot; : &quot;NOT_SUPPORTED&quot;, &quot;HVM64&quot; : &quot;ami-2b408b45&quot;, &quot;HVMG2&quot; : &quot;NOT_SUPPORTED&quot;},
          &quot;ap-southeast-1&quot;   : {&quot;PV64&quot; : &quot;ami-df9e4cbc&quot;, &quot;HVM64&quot; : &quot;ami-a59b49c6&quot;, &quot;HVMG2&quot; : &quot;ami-c212aba1&quot;},
          &quot;ap-southeast-2&quot;   : {&quot;PV64&quot; : &quot;ami-63351d00&quot;, &quot;HVM64&quot; : &quot;ami-dc361ebf&quot;, &quot;HVMG2&quot; : &quot;ami-0ad2db69&quot;},
          &quot;ap-south-1&quot;       : {&quot;PV64&quot; : &quot;NOT_SUPPORTED&quot;, &quot;HVM64&quot; : &quot;ami-ffbdd790&quot;, &quot;HVMG2&quot; : &quot;ami-ca3042a5&quot;},
          &quot;us-east-2&quot;        : {&quot;PV64&quot; : &quot;NOT_SUPPORTED&quot;, &quot;HVM64&quot; : &quot;ami-f6035893&quot;, &quot;HVMG2&quot; : &quot;NOT_SUPPORTED&quot;},
          &quot;ca-central-1&quot;     : {&quot;PV64&quot; : &quot;NOT_SUPPORTED&quot;, &quot;HVM64&quot; : &quot;ami-730ebd17&quot;, &quot;HVMG2&quot; : &quot;NOT_SUPPORTED&quot;},
          &quot;sa-east-1&quot;        : {&quot;PV64&quot; : &quot;ami-1ad34676&quot;, &quot;HVM64&quot; : &quot;ami-6dd04501&quot;, &quot;HVMG2&quot; : &quot;NOT_SUPPORTED&quot;},
          &quot;cn-north-1&quot;       : {&quot;PV64&quot; : &quot;ami-77559f1a&quot;, &quot;HVM64&quot; : &quot;ami-8e6aa0e3&quot;, &quot;HVMG2&quot; : &quot;NOT_SUPPORTED&quot;}
        }

      },

      &quot;Resources&quot;: {
        &quot;WebServerGroup&quot;: {
          &quot;Type&quot;: &quot;AWS::AutoScaling::AutoScalingGroup&quot;,
          &quot;CreationPolicy&quot; : {
            &quot;ResourceSignal&quot; : {
              &quot;Timeout&quot; : &quot;PT5M&quot;,
              &quot;Count&quot;   : &quot;1&quot;
            }
          },
          &quot;UpdatePolicy&quot; : {
            &quot;AutoScalingRollingUpdate&quot; : {
              &quot;MaxBatchSize&quot; : &quot;1&quot;,
              &quot;MinInstancesInService&quot; : &quot;1&quot;,
              &quot;PauseTime&quot; : &quot;PT15M&quot;,
              &quot;WaitOnResourceSignals&quot;: &quot;true&quot;
            }
          },
          &quot;Properties&quot;: {
            &quot;VPCZoneIdentifier&quot; : { &quot;Ref&quot; : &quot;Subnets&quot; },
            &quot;LaunchConfigurationName&quot;: { &quot;Ref&quot;: &quot;LaunchConfig&quot; },
            &quot;MinSize&quot;: &quot;1&quot;,
            &quot;MaxSize&quot;: &quot;1&quot;        
          }
        },

        &quot;LaunchConfig&quot;: {
          &quot;Type&quot;: &quot;AWS::AutoScaling::LaunchConfiguration&quot;,
          &quot;Metadata&quot; : {
            &quot;Comment&quot; : &quot;Install a simple application&quot;,
            &quot;AWS::CloudFormation::Init&quot; : {
              &quot;config&quot; : {
                &quot;packages&quot; : {
                  &quot;yum&quot; : {
                    &quot;httpd&quot; : []
                  }
                },

                &quot;files&quot; : {
                  &quot;/var/www/html/index.html&quot; : {
                    &quot;content&quot; : { &quot;Fn::Join&quot; : [&quot;\n&quot;, [
                      &quot;&lt;img src=\&quot;&quot;, {&quot;Fn::FindInMap&quot; : [&quot;Region2Examples&quot;, {&quot;Ref&quot; : &quot;AWS::Region&quot;}, &quot;Examples&quot;]}, &quot;/cloudformation_graphic.png\&quot; alt=\&quot;AWS CloudFormation Logo\&quot;/&gt;&quot;,
                      &quot;&lt;h1&gt;Congratulations, you have successfully launched the AWS CloudFormation sample.&lt;/h1&gt;&quot;
                    ]]},
                    &quot;mode&quot;    : &quot;000644&quot;,
                    &quot;owner&quot;   : &quot;root&quot;,
                    &quot;group&quot;   : &quot;root&quot;
                  },

                  &quot;/etc/cfn/cfn-hup.conf&quot; : {
                    &quot;content&quot; : { &quot;Fn::Join&quot; : [&quot;&quot;, [
                      &quot;[main]\n&quot;,
                      &quot;stack=&quot;, { &quot;Ref&quot; : &quot;AWS::StackId&quot; }, &quot;\n&quot;,
                      &quot;region=&quot;, { &quot;Ref&quot; : &quot;AWS::Region&quot; }, &quot;\n&quot;
                    ]]},
                    &quot;mode&quot;    : &quot;000400&quot;,
                    &quot;owner&quot;   : &quot;root&quot;,
                    &quot;group&quot;   : &quot;root&quot;
                  },

                  &quot;/etc/cfn/hooks.d/cfn-auto-reloader.conf&quot; : {
                    &quot;content&quot;: { &quot;Fn::Join&quot; : [&quot;&quot;, [
                      &quot;[cfn-auto-reloader-hook]\n&quot;,
                      &quot;triggers=post.update\n&quot;,
                      &quot;path=Resources.LaunchConfig.Metadata.AWS::CloudFormation::Init\n&quot;,
                      &quot;action=/opt/aws/bin/cfn-init -v &quot;,
                      &quot;         --stack &quot;, { &quot;Ref&quot; : &quot;AWS::StackName&quot; },
                      &quot;         --resource LaunchConfig &quot;,
                      &quot;         --region &quot;, { &quot;Ref&quot; : &quot;AWS::Region&quot; }, &quot;\n&quot;,
                      &quot;runas=root\n&quot;
                    ]]}
                  }
                },

                &quot;services&quot; : {
                  &quot;sysvinit&quot; : {
                    &quot;httpd&quot;    : { &quot;enabled&quot; : &quot;true&quot;, &quot;ensureRunning&quot; : &quot;true&quot; },
                    &quot;cfn-hup&quot; : { &quot;enabled&quot; : &quot;true&quot;, &quot;ensureRunning&quot; : &quot;true&quot;,
                                  &quot;files&quot; : [&quot;/etc/cfn/cfn-hup.conf&quot;, &quot;/etc/cfn/hooks.d/cfn-auto-reloader.conf&quot;]}
                  }
                }
              }
            }
          },
          &quot;Properties&quot;: {
            &quot;KeyName&quot;: { &quot;Ref&quot;: &quot;KeyName&quot; },
            &quot;ImageId&quot;: {
              &quot;Fn::FindInMap&quot;: [ &quot;AWSRegionArch2AMI&quot;, { &quot;Ref&quot;: &quot;AWS::Region&quot; },
                { &quot;Fn::FindInMap&quot;: [ &quot;AWSInstanceType2Arch&quot;, { &quot;Ref&quot;: &quot;InstanceType&quot; }, &quot;Arch&quot; ] } ]
            },
            &quot;SecurityGroups&quot;: [ { &quot;Ref&quot;: &quot;InstanceSecurityGroup&quot; } ],
            &quot;InstanceType&quot;: { &quot;Ref&quot;: &quot;InstanceType&quot; },
            &quot;UserData&quot;       : { &quot;Fn::Base64&quot; : { &quot;Fn::Join&quot; : [&quot;&quot;, [
                 &quot;#!/bin/bash -xe\n&quot;,
                 &quot;yum update -y aws-cfn-bootstrap\n&quot;,

                 &quot;/opt/aws/bin/cfn-init -v &quot;,
                 &quot;         --stack &quot;, { &quot;Ref&quot; : &quot;AWS::StackName&quot; },
                 &quot;         --resource LaunchConfig &quot;,
                 &quot;         --region &quot;, { &quot;Ref&quot; : &quot;AWS::Region&quot; }, &quot;\n&quot;,

                 &quot;/opt/aws/bin/cfn-signal -e $? &quot;,
                 &quot;         --stack &quot;, { &quot;Ref&quot; : &quot;AWS::StackName&quot; },
                 &quot;         --resource WebServerGroup &quot;,
                 &quot;         --region &quot;, { &quot;Ref&quot; : &quot;AWS::Region&quot; }, &quot;\n&quot;
            ]]}}
          }
        },
        
        &quot;InstanceSecurityGroup&quot;: {
          &quot;Type&quot;: &quot;AWS::EC2::SecurityGroup&quot;,
          &quot;Properties&quot;: {
            &quot;GroupDescription&quot;: &quot;Enable SSH access and HTTP access on the configured port&quot;,
            &quot;SecurityGroupIngress&quot;: [ 
              { &quot;IpProtocol&quot;: &quot;tcp&quot;, &quot;FromPort&quot;: &quot;22&quot;, &quot;ToPort&quot;: &quot;22&quot;, &quot;CidrIp&quot;: { &quot;Ref&quot; : &quot;SSHLocation&quot; } },
              { &quot;IpProtocol&quot;: &quot;tcp&quot;, &quot;FromPort&quot;: &quot;80&quot;, &quot;ToPort&quot;: &quot;80&quot;, &quot;CidrIp&quot;: &quot;0.0.0.0/0&quot; }
            ],
            &quot;VpcId&quot; : { &quot;Ref&quot; : &quot;VpcId&quot; }
          }
        }
      }

    }


&lt;!-- end snippet --&gt;


error screenshot

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/ndaXm.png

</details>


# 答案1
**得分**: 1

请附上自动缩放组中实例状态的错误。您是否参考了这个[链接][1]

  [1]: https://stackoverflow.com/questions/42604753/aws-cloudformation-stack-fails-with-error-received-0-success-signals-out-of-1

<details>
<summary>英文:</summary>

Please attach the error what instance states in the autoscaling group.
Did you referred this [link][1]


  [1]: https://stackoverflow.com/questions/42604753/aws-cloudformation-stack-fails-with-error-received-0-success-signals-out-of-1

</details>



# 答案2
**得分**: 0

自动扩展组(ASG)已配置为要求成功信号。这个错误意味着ASG启动的实例在超时之前(因为这是初始堆栈创建时的5分钟)没有将这些消息发送回CFN。

尝试增加超时时间。还请确保实例具有互联网访问权限,以便能够发送信号。

<details>
<summary>英文:</summary>

The ASG is configured to require success signals.  This error means that the instances the ASG launched didn&#39;t send those messages back to CFN before the timeout (5 minutes since this was the initial stack creation)

Try increasing the timeout.  Also make sure the instances have internet access to be able to send the signal out

</details>



huangapple
  • 本文由 发表于 2020年1月6日 15:29:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/59608211.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定