AWS Step Functions Timeout scenarios When Calling ECS Task from Lambda Triggered by EventBridge
I've been banging my head against this for hours. I'm having a hard time understanding I've been working on this all day and I'm prototyping a solution and Hey everyone, I'm running into an issue that's driving me crazy... I'm trying to orchestrate an AWS Step Function that triggers an ECS task from a Lambda function, which is invoked by an EventBridge rule. However, I'm working with a timeout behavior when the Step Function attempts to start the ECS task. The Step Function definition includes a state that looks like this: ```json { "Comment": "A simple AWS Step Function example that triggers an ECS task", "StartAt": "StartTask", "States": { "StartTask": { "Type": "Task", "Resource": "arn:aws:states:::ecs:runTask", "Parameters": { "Cluster": "my-cluster", "TaskDefinition": "my-task:1", "LaunchType": "FARGATE", "NetworkConfiguration": { "AwsvpcConfiguration": { "Subnets": ["subnet-01234abcd"], "AssignPublicIp": "ENABLED" } } }, "TimeoutSeconds": 60, "End": true } } } ``` When I invoke the Step Function, it returns the following behavior: ``` Task timed out after 60.00 seconds ``` I've verified the following: - The Lambda function has sufficient permissions to start ECS tasks. The IAM role attached to it includes `ecs:RunTask` and `iam:PassRole` permissions. - The ECS task definition is correctly configured, and I can manually run tasks from the console without issues. - The VPC configuration is accurate, and the security group allows outbound traffic. However, the Step Function times out consistently. I tried increasing the `TimeoutSeconds` from 60 to 120, but the scenario remains the same. I also checked CloudWatch logs for any additional behavior messages, but I only see the timeout message. Has anyone encountered a similar scenario with AWS Step Functions and ECS integration? Any insights on what might be causing the timeout or how to debug this further would be greatly appreciated! For context: I'm using Json on Linux. Is there a better approach? This is for a microservice running on macOS. Cheers for any assistance! My development environment is Windows 10. I'm working with Json in a Docker container on macOS. What are your experiences with this? Thanks for taking the time to read this!