如果UserData执行失败,能否停止EC2实例并报错

0

【以下的问题经过翻译处理】 如果UserData执行失败,是否有可能停止创建EC2实例并报错?假设我执行了一些 PowerShell 脚本作为 UserData 配置的一部分,但一些脚本执行失败了,这种情况下我想令EC2停止并提示错误

profile picture
EXPERT
asked 5 months ago119 views
1 Answer
0

【以下的回答经过翻译处理】 如果您通过Cloudformation部署实例,可以使用cfn-helper脚本来实现此目的。具体来说,您将使用cfn-signal脚本,以及Cloudformation wait conditions来表示脚本是否成功或失败。

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions