Fail/Rollback EC2 Instance Provisioning if UserData Fails

0

Is it possible to fail or rollback EC2 instance provisioning, if UserData fails? Let's say I execute some PowerShell scripts as part of UserData provisioning and some scripts fail. I want to fail the EC2 provisioning with the errors. Please help

質問済み 1年前214ビュー
1回答
0
承認された回答

If you deploy the instance via Cloudformation, you can utilize the cfn-helper scripts to achieve this. Specifically, the cfn-signal script is what you would use, along with Clouformation wait conditions to signal that the script succeeded or failed.

profile pictureAWS
回答済み 1年前
  • Thanks a lot for your prompt response. However, I have a couple of questions. Will this work for Windows Instance.? I am trying to implement this in an Auto Scaling Group scenario. Will it work? Can you please share any example, if possible? Thanks a lot once again.

  • Thanks a lot for the hint. This helped me, although I had to make some changes.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ