Create a task definition with at least 2 container_definition entries in its JSON
Read the output of the task definition back and jsondecode it
Index into that list and see that the tasks are reordered
Debug Output
No response
Panic Output
No response
Important Factoids
Our use case is niche as we require reading the task definition out of the terraform state for other processes, and we can work around it, but given the AWS API defines them as a list (and not a map) it would perhaps make sense to do the drift detection on an internal sorted copy of the definitions vs the supplied definitions to preserve the order.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.5.2
AWS Provider Version
5.56.1
Affected Resource(s)
Expected Behavior
The container_definitions output of the resource should be returned in identical order to the inputs provided
Actual Behavior
The container_definitions property of the resource is sorted, meaning the input order is lost
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
Our use case is niche as we require reading the task definition out of the terraform state for other processes, and we can work around it, but given the AWS API defines them as a list (and not a map) it would perhaps make sense to do the drift detection on an internal sorted copy of the definitions vs the supplied definitions to preserve the order.
References
It appears this was introduced in https://github.com/hashicorp/terraform-provider-aws/pull/35792 as it now seems to internally sort the list.
Would you like to implement a fix?
None