AWS CloudFormation stack fails with error Received 0 SUCCESS signal(s) out of 1

扶醉桌前 提交于 2019-12-01 19:12:46

TLDR

This is a generic error which occurs when the EC2 cannot send a success signal to the ASG. There are many possible reasons why this might occur, but most likely whatever healthcheck it is you use is not working as intended.

Using the below userData should hard-code the healthcheck which is a great way to start testing your application and Cloud Formation template.

My issues

I removed all references to AWS::CloudFormation::WaitConditionHandle and AWS::CloudFormation::WaitCondition

There were issues with my UserData script:

  • The script needed <script> tags to be executed
  • The commands didn't have the correct parameters
  • The variables were not properly injected (for example ${AWS::StackName})

The result is:

UserData:
  "Fn::Base64":
    !Sub |
      <script>
        cfn-init.exe -v --stack ${AWS::StackName} --resource AutoScalingGroup --region ${AWS::Region}
        cfn-signal.exe -e 0 --stack ${AWS::StackName} --resource AutoScalingGroup --region ${AWS::Region}
      </script>

You are missing the - cloudformation:SignalResource action in your IAM role's PolicyDocument. This permission is required to send signals.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!