Ecs-fargate issue with aws_ecs_task_definition.task.arn

I’m at a loss to figure out why this is no longer working - even on destroy of everything, I’m still getting this on an attempt to recreate the Fargate Cluster:

module.fargate_service.aws_ecs_service.fargate_without_lb: Resource 'aws_ecs_task_definition.task' not found for variable 'aws_ecs_task_definition.task.arn'

It’s the same as other infra we have and I’m not sure what happened to cause this to error out. Looking for any pointers if anyone has seen anything similar. It’s like it can’t find a task.arn, but how would it know this before it’s deployed?

It looks like this was from some sort of remote-state (s3) namespace corruption - I simply renamed the folder for this and it worked fine. I wonder if this is from manual updating of the service task count in the console or something. I also had already done a tg destroy and all was successful, but there could have been some orphaned infra.

Anyway, resolved, but did not determine root cause.

Nope, not a remote state issue. Was due to the fact that I had added an unquoted value for an environment entry in the container-definition.json.

Changed: {"name" : "PORT", "value" : ${container_http_port}}

To: {"name" : "PORT", "value" : "${container_http_port}"}

And it’s now happy. Wild goose chase errors are always fun.

Wow, not sure how you figured that out with those error messages, but glad you got it sorted :slight_smile: