bug: EC2 DescribeInstances group filters miss the second security group on an ASG instance #66
AndreKurait
started this conversation in
Bugs (AWS)
Replies: 1 comment
|
Hi @AndreKurait Thanks for the detailed report and reproducer. We were able to reproduce the issue on 2026.8.1 and on our latest dev build, and it's now with our engineering team for review. We'll update this thread once a fix is available so you can test it. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Additional version check — 2026-10-08
Still reproduced: the ASG instance contains both groups, but only the first group's ID/name matches. The bundled-Moto result remains separate from Docker-backed EC2 execution.
The comparison used an unmodified
localstack/localstack-pro:2026.8.1Linux ARM64 image,repository digest
sha256:4aef81c531684570d7b3cfd2805afa02194c929d52bbeedabb7d4874798b1572.Vendor packages were
localstack-core 2026.8.1,moto-ext 5.1.48, and bundledboto3/botocore 1.43.78. HTTP probes used a separateboto3/botocore 1.43.101client; the process-local security-group probe used the bundled interpreter.
The same scripts were used, with no custom extensions or provider source changes.
Owned test containers and the disposable network were removed.
This is a second specifically tested version, not a claim to have tested the latest release.
Existing report search
I found the matching upstream Moto issue #10114, which is closed. This report concerns the still-affected LocalStack bundled distribution; I am not opening another Moto issue. The proposed #10115 and #10145 are closed and were not merged, so their status alone does not identify a verified fixed LocalStack release. I found no matching current LocalStack Discussion.
Current behavior
An instance launched from an Auto Scaling launch template has two security groups in its
DescribeInstancesresponse. Addinginstance.group-idorinstance.group-namefor the first group finds the instance; the same filter for the second attached group returns no instances.This minimal case was reproduced in process against the unmodified Moto distribution bundled in the LocalStack image, using
moto.mock_aws(). It is not a Docker-backed EC2 guest launch test, and I have not established whether current standalone upstream Moto has the same defect.Expected behavior
Each attached group should match the instance. Multiple values within a filter should retain OR semantics, and different filters should retain AND semantics.
Reference: DescribeInstances filters.
Could you confirm the LocalStack release carrying the correction for the linked upstream report? I am reporting the tested bundled
moto-extbehavior, without claiming current standalone Moto remains affected.Environment
localstack/localstack-pro:2026.7.5.sha256:0d74e1d2d7ce13a3cb25fc64cf15eb225f1c95c762e56e057bc6a9ed0ed29306.localstack-core 2026.7.5,moto-ext 5.1.46,moto.__version__ = 5.1.21.dev,boto3/botocore 1.43.51.Fresh confirmation on 2026-10-08: the same four filter results reproduced on Linux ARM64 using the bundled
moto.mock_aws()andboto3/botocore 1.43.51, in an isolated read-only container with networking disabled. The container was removed after the run. A separate socket-free endpoint attempt could not launch a Docker guest; it is not used as evidence for this model/filter result.Steps to reproduce
Save the Python code below as
ec2_security_group_filters.py, then run it against the bundled Python environment:docker run --rm -i --entrypoint /opt/code/localstack/.venv/bin/python \ localstack/localstack-pro:2026.7.5 - < ec2_security_group_filters.pyThis process-local reproduction needs no running LocalStack edge, license token, application image, or Docker socket. Every synthetic resource exists only inside
moto.mock_aws(), which discards that state on exit, including assertion failures.This script also has an optional loopback endpoint mode; that mode requires a provider supporting its model-only placeholder AMI and is not the evidence for this report.
Complete standalone reproducer: ec2_security_group_filters.py
All reactions