Skip to content

EC2: run_instances should launch MaxCount instances - #10533

Open
lechakrawarthy wants to merge 1 commit into
getmoto:masterfrom
lechakrawarthy:fix/ec2-run-instances-max-count
Open

lechakrawarthy wants to merge 1 commit into
getmoto:masterfrom
lechakrawarthy:fix/ec2-run-instances-max-count

Conversation

@lechakrawarthy

Copy link
Copy Markdown

Fixes #10215

run_instances only read MinCount and used it as the instance count, so MinCount=1, MaxCount=3 launched a single instance. On AWS the call launches as many instances as capacity allows, up to MaxCount. Moto has no capacity limit, so it now launches MaxCount (falling back to MinCount if MaxCount is missing).

Added test_run_instances_launches_max_count, which fails on master with assert 1 == 3 and passes with this change.

Ran locally:

  • pytest tests/test_ec2 tests/test_autoscaling: 1109 passed
  • ruff check moto tests and ruff format --check: clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EC2: run_instances launches MinCount instances, MaxCount is ignored

1 participant