Per my understanding, "task definition" for ECS is being created by Batch, and some fields, like env variables or mounting points, can be described in "job definition" and that is reflected in "task definition".
But what about other "task definition" parameters, which don't have a field in "job definition", like "portMappings"? How can I modify them?
While Batch does use ECS under the covers, and there are similarities between Batch job definitions and ECS job definitions, they are not a one to one match. There are some things you can do in ECS that you simply cannot in Batch.
For instance, in ECS you can define multiple containers and link them together. In Batch this is not possible; you can define only a single container.
Similarly, since batch processing workloads typically do not involve exposing a port on a given job, you can not specify port mappings with AWS Batch.