Repository navigation
fix(runners): set security groups on the interfaces when network_interfaces is set - #5561
Merged
Brend-Smits merged 3 commits intoNov 19, 2026
Conversation
…rfaces is set With network_interfaces set, the launch template also kept the instance-level security groups, which EC2 rejects with InvalidParameterCombination. The security groups are now set on the instance only when the template has no network interfaces. An interface without security_groups gets the managed and additional security groups, unless it attaches an existing ENI. Fixes github-aws-runners#5560
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the runner security-group placement changes.
No open issues 🎉
What changed in this PR
Fixes #5560 by moving runner security groups onto network interfaces when interfaces are configured, avoiding the EC2 parameter conflict that prevented runners from launching. Applies the same behavior to the runners module and the EC2 compute provider.
Changes:
- Reuses a shared security-group local and omits instance-level groups when network interfaces are present.
- Adds regression tests for interface defaults, explicit groups, existing interfaces, and configurations without interfaces.
- Updates variable descriptions and generated READMEs to explain security-group placement.
| File | Description |
|---|---|
variables.tf |
Documents root-level interface security-group behavior. |
README.md |
Updates generated root input documentation. |
modules/runners/variables.tf |
Documents runner interface defaults and exceptions. |
modules/runners/tests/launch-template.tftest.hcl |
Tests security-group placement in runner launch templates. |
modules/runners/README.md |
Updates generated runner input documentation. |
modules/runners/main.tf |
Fixes security-group placement in runner launch templates. |
modules/runner-config/variables.compute-provider.tf |
Documents EC2 interface security-group behavior. |
modules/runner-config/README.md |
Updates generated compute-provider configuration documentation. |
modules/multi-runner/variables.tf |
Adds v1 network-interface field documentation. |
modules/multi-runner/README.md |
Includes the new v1 field description. |
modules/compute-providers/aws/ec2/variables.tf |
Documents provider interface defaults and exceptions. |
modules/compute-providers/aws/ec2/tests/provider.tftest.hcl |
Tests security-group placement in provider launch templates. |
modules/compute-providers/aws/ec2/runner-instances.tf |
Applies the security-group placement fix to the EC2 provider. |
modules/compute-providers/aws/ec2/README.md |
Updates generated EC2 provider input documentation. |
Review effort: Balanced
guicaulada
previously approved these changes
Nov 17, 2026
…s-security-groups # Conflicts: # modules/multi-runner/README.md # modules/runners/tests/launch-template.tftest.hcl
Contributor
Author
|
@guicaulada Thanks for review! There are no merge conflicts now, could you re-check and approve again? |
Brend-Smits
enabled auto-merge (squash)
November 19, 2026 19:51
Brend-Smits
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5560
Summary
When
network_interfacesis set andassociate_public_ipv4_addressisfalse, the runner launch template set bothvpc_security_group_idsand network interfaces. EC2 rejects this withInvalidParameterCombination, soCreateFleetlaunched no instance and the job stayed queued.Changes
Same change in
modules/runners/main.tfandmodules/compute-providers/aws/ec2/runner-instances.tf:vpc_security_group_idsis set only when the launch template has no network interfaces.security_groupsgets the managed security group and the additional security groups. An interface that attaches an existingnetwork_interface_idgets none, because EC2 does not accept security groups for it in the template.network_interfacesdescriptions (root,modules/runners,modules/multi-runner,runner-config, EC2 provider) describe this. The v1 field docs ofmodules/multi-runnernow includenetwork_interfaces.No change without
network_interfaces: the security groups stay on the instance, and withassociate_public_ipv4_addressthey stay on its interface.Test plan
modules/runners/tests/launch-template.tftest.hclandmodules/compute-providers/aws/ec2/tests/provider.tftest.hcl:security_groupsgets the runner security groups, one with its own keeps them, one withnetwork_interface_idgets nonemodules/runners(9), EC2 provider (12),modules/multi-runner(21),modules/runner-config(17).terraform fmtandterraform validate.terraform-docsimage used by CI.