Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: CC-BY-SA-4.0
Troubleshooting problems with services, start with reviewing diagnostic information is the service event log.
If you have trouble starting a task, your task might be stopping because of an error. For example, you run the task and the task displays a PENDING status and then disappears. You can view errors like this in the Amazon ECS console by displaying the stopped task and inspecting it for error messages.
To troubleshoot stopped tasks for errors follow the steps below.
Current environment should have all services and tasks running without issues. To simulate a task error deploy Fargate service using following command.
cdk deploy FargateWorkshopOps-failed
This service will provision and run a task where underlying container stays on for 60 seconds and then is terminated. Wait for 3-5 minutes for service to stabilize and review service events and container stop reason to verify status using ECS console.