The error likely happens if you do one of the following things: In order to fix the error, you first need to validate if you’ve added SSM permissions to our existing ECS task IAM role. This grants permission for the ECS task to connect with the SSM Session Manager service. Next, you need to validate if you’ve added the ECS ExecuteCommand permission to your IAM role. Make sure your IAM role…

Source