Skip to content

ec2: Enhance security group handling in Spot Fleet launch specifications#159

Open
nik-localstack wants to merge 1 commit intolocalstack:localstackfrom
nik-localstack:unc-404-ec2-createfleet-instances-launched-from-launchtemplate
Open

ec2: Enhance security group handling in Spot Fleet launch specifications#159
nik-localstack wants to merge 1 commit intolocalstack:localstackfrom
nik-localstack:unc-404-ec2-createfleet-instances-launched-from-launchtemplate

Conversation

@nik-localstack
Copy link
Copy Markdown

Motivation

When CreateFleet uses a LaunchTemplateSpecification, security groups were never applied to launched instances because group_set was read exclusively from the non-standard GroupSet field, ignoring the actual SecurityGroupIds and NetworkInterfaces[N].Groups fields that AWS clients use.

Solution

The fix falls back through all three sources (GroupSet → SecurityGroupIds → NetworkInterfaces[N].Groups) when building the SpotFleetLaunchSpec, and two AWS-verified regression tests covering both code paths are added in TestFleetSecurityGroups.

@nik-localstack nik-localstack self-assigned this Apr 9, 2026
@nik-localstack nik-localstack marked this pull request as ready for review April 9, 2026 16:34
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.

1 participant