What do I do if an ECS instance fails to be created and an error indicating that an ECS initialization script fails to be run by using ALIYUN::ECS::RunCommand is reported?

Updated at:

Learn how to resolve the ALIYUN::ECS::RunCommand error when an Elastic Compute Service (ECS) instance fails to be created because the initialization script cannot be run.

Considerations

To query the cause of the ALIYUN::ECS::RunCommand error, make sure that rollback on failure was disabled when you created the stack and the stack is in the Creation Failure state. For more information, see ALIYUN::ECS::RunCommand.

The ALIYUN::ECS::RunCommand resource type runs a shell, PowerShell, or batch command on one or more ECS instances.

Solution

ALIYUN::ECS::RunCommand runs commands by using Cloud Assistant. If ECS instance creation fails, perform the following steps to resolve the issue: Log on to the ECS console, find the instance on which the Cloud Assistant command failed to run (for example, an instance named t-****), check the cause of the execution failure, and modify the script.