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

posta un anno fa214 visualizzazioni
1 Risposta
0
Risposta accettata

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
con risposta un anno fa
  • 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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande