Error: Unexpected resource instance key

From wikieduonline
Jump to navigation Jump to search
Error: Unexpected resource instance key


╷
│ Error: Unexpected resource instance key
│
│   on nats.tf line 5, in resource "aws_ecs_service" "your_service":
│    5:   task_definition = "${aws_ecs_task_definition.your_task[0].family}:${aws_ecs_task_definition.your_task[0].revision}"
│
│ Because aws_ecs_task_definition.your_task does not have "count" or
│ "for_each" set, references to it must not include an index key. Remove the
│ bracketed index to refer to the single instance of this resource.



Advertising: