The aws_ecs_service data source should only return active services or have a parameter that allows for filtering on the status. I didn't test it, but it's probably the same for the aws_ecs_cluster
Actual Behavior
The aws_ecs_service data source seems to return the same as a call to aws ecs delete-service which includes services with status INACTIVE (i.e. deleted services). That is counter intuitive because the service is no longer visible in the Console. This is also inconsistent with the aws_ecs_service resource which shows services as deleted when they were deleted in the Console and tries to re-create them. It is made worse by the fact that the status is not one of the attributes of the data source, so from the terraform side it is not possible to see what is going on.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
# it will be easiest to create an ECS cluster and service in the Console and then copy the relevant values here
data "aws_ecs_service" "service" {
cluster_arn = "cluster_arn"
service_name = "service_name"
}
output "service" {
value = aws_ecs_service.service
}
Steps to Reproduce
create a cluster
create a service
use aws_ecs_service data source to lookup the service
delete the service
use aws_ecs_service data source to lookup the service -> the output will be the same as before the deletion
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.4.2
AWS Provider Version
4.62.0
Affected Resource(s)
Expected Behavior
The
aws_ecs_service
data source should only return active services or have a parameter that allows for filtering on the status. I didn't test it, but it's probably the same for theaws_ecs_cluster
Actual Behavior
The
aws_ecs_service
data source seems to return the same as a call toaws ecs delete-service
which includes services with status INACTIVE (i.e. deleted services). That is counter intuitive because the service is no longer visible in the Console. This is also inconsistent with theaws_ecs_service
resource which shows services as deleted when they were deleted in the Console and tries to re-create them. It is made worse by the fact that the status is not one of the attributes of the data source, so from the terraform side it is not possible to see what is going on.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None