Skip to content

ec2: Update launch template version handling#131

Merged
nik-localstack merged 1 commit intolocalstack:localstackfrom
nik-localstack:ec2/fleet/launch-template-version-usage
Mar 9, 2026
Merged

ec2: Update launch template version handling#131
nik-localstack merged 1 commit intolocalstack:localstackfrom
nik-localstack:ec2/fleet/launch-template-version-usage

Conversation

@nik-localstack
Copy link

When creating an EC2 Fleet with a LaunchTemplateSpecification that pins to a specific version, moto was always using the latest version's data to launch instances — ignoring the requested version entirely. This meant a fleet pinned to version "1" would silently use version "3"'s configuration instead.

Changes

  • Use the version specified in LaunchTemplateSpecification (falling back to the template's default version) instead of always calling latest_version()
  • Add test_fleet_uses_data_from_specified_template_version (AWS-verified) to confirm the correct version's data is used at launch time

Co-created with https://claude.com/claude-code.

@nik-localstack nik-localstack self-assigned this Mar 7, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@nik-localstack nik-localstack force-pushed the ec2/fleet/launch-template-version-usage branch from 07e0a17 to f38f923 Compare March 7, 2026 14:30
@nik-localstack nik-localstack marked this pull request as ready for review March 7, 2026 17:45
@nik-localstack nik-localstack merged commit 628f9e9 into localstack:localstack Mar 9, 2026
66 checks passed
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.

2 participants