AWS ECS services with Admin roles may lead to unauthorized access to resources in full capacity.
The role can only be altered when using a networking configuration other than awsvpc in a task definition. You must also use a load balancer with a single target group. For more information on how to properly configure a task definition, see the AWS documentation.
In AWS Console -
In Terraform -
References:
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service_definition_parameters.html
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_service