There is no direct configuration which can limit the number of instances. However you can configure Max vCPU in compute environment such that it can launch the instances upto required numbers only.
For example : Suppose you create a compute environment with instance type as m4.large ( it comes with 2vCPU and 8 GiB memory). Now if you set the MAX vCPU as 20 for this compute environment, so this compute environment can scale max upto 20 vCPU means 10 instances of type m4.large.
If I understand your question, you should be able to limit the number nodes when you're setting up a multi-node parallel job. >See #8 in multi-node parallel job definition.< This is per job, not across all EC2 instances.
I'm not aware of a convenient way to limit EC2 instances across an account without restrictions on users & services (e.g. simply disallowing creation as a policy).
My usecase for AWS BatchAccepted Answerasked 5 months ago
Does using SPOT_CAPACITY _OPTIMIZED launch spot instances into an auto-scaling group in AWS Batch?asked 3 months ago
AWS batch does not scale down EC2 instancesasked 8 months ago
Lightsail - EC2 - Instances Hard Limitasked 2 days ago
Is there a limit on the number of QuickSight dashboards?Accepted Answerasked 3 years ago
Why are so few instances running with my AWS Batch Compute Environment config?asked 6 months ago
Preload Docker Image on AWS Batch Instanceasked 3 months ago
Is there a way to automate failure handling and retries when using Amazon SageMaker batch transform?Accepted AnswerEXPERTasked 2 years ago
AWS Batch limit number of instancesAccepted Answerasked 5 months ago
IS AWS BATCH IS AVAILBLE WITH FREE TIREasked 2 months ago