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

질문됨 일 년 전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
답변함 일 년 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠