I already succeed enabling cloud debug for an ECS Fargate task in IntelliJ via following doc.
Also I configured a debug configuration for the cloud debug enabled task via doc, then I ran the debugging configuration, got below error,
Retrieve execution role finished exceptionally: java.lang.RuntimeException: Failed to retrieve execution role from the service: is it set up for debugging?
Any hint to resolve it. I did not find any doc mentioned execution role requirements.
I turned it out the error described in question caused by the cloud debug enabled task is NOT running.
After reviewing the status of task named with cloud-debug-
in ECS console, the permission to create CloudWatch logs stream required by cloud debug sidecar
container which is depended by your app container. You have to grant the logs:CreateLogStream
permission to the execution role of the ECS task.
Also note that cloud debugging
won't work with ECS tasks with x-ray enabled or appmesh enabled at this moment.