ISSUE DESCRIPTION [BUG] ELBv2 DescribeListenerAttributes and DescribeCapacityReservation…
- User
ISSUE DESCRIPTION
[BUG] ELBv2 DescribeListenerAttributes and DescribeCapacityReservation return UnsupportedOperation (breaks @pulumi/aws refresh)
Service
ELBv2 (Elastic Load Balancing v2)
AWS API Action
DescribeListenerAttributesandDescribeCapacityReservationExpected behavior
DescribeListenerAttributesreturns the listener's attribute list (empty by default until attributes are set).DescribeCapacityReservationreturns the load balancer's capacity reservation status (empty/none when no capacity is reserved).
Both are normal management-plane reads that the AWS SDKs issue during resource refresh.
Actual behavior
Both actions return:
api error UnsupportedOperation: Action DescribeListenerAttributes is not supported. api error UnsupportedOperation: Action DescribeCapacityReservation is not supported.@pulumi/aws6.66.0+ (and recent Terraform AWS provider versions) call these two actions when refreshing existingLoadBalancer/Listenerresources. Because Floci returnsUnsupportedOperation, the provider errors out on refresh. The only workaround today is pinning@pulumi/awsto a version that predates these calls (e.g.6.30.0).ELBv2 is otherwise well supported in Floci — only these two read actions are missing from
ElbV2QueryHandler's action switch.Reproduction
# Assuming a load balancer + listener already exist (CreateLoadBalancer / CreateListener): aws --endpoint-url http://localhost:4566 elbv2 describe-listener-attributes \ --listener-arn arn:aws:elasticloadbalancing:us-east-1:000000000000:listener/app/my-lb/abc/def # -> UnsupportedOperation: Action DescribeListenerAttributes is not supported. aws --endpoint-url http://localhost:4566 elbv2 describe-capacity-reservation \ --load-balancer-arn arn:aws:elasticloadbalancing:us-east-1:000000000000:loadbalancer/app/my-lb/abc # -> UnsupportedOperation: Action DescribeCapacityReservation is not supported.Environment
- Floci version / image tag:
1.5.18(floci/floci:latest); also present on currentmain - AWS provider that triggers it:
@pulumi/aws6.66.0+ (works when pinned to 6.30.0) - How you're running Floci: Docker / Docker Compose
A PR implementing
DescribeListenerAttributes,ModifyListenerAttributes, and (mirroring the existing load balancer / target group attribute handlers) will reference this issue. Assistant
Let me start by exploring the repository structure to understand the
Assistant
Let me see the rest of ElbV2Service.java:
Assistant
me see the middle section of the file (the listener-related handlers):
Assistant
The Listener model already has an
attributesmap. Now let me look at the LoadBalancer model:Assistant
Now let me look at existing tests to understand the test pattern:
Assistant
Now let me check the rest:
Assistant
Let me also look at the TargetGroup model and the existing TargetGroup attribute handler in service:
Assistant
Let me look at how the existing service methods modifyTargetGroupAttributes look like:
Assistant
Let me check what models exist already:
Assistant
No capacity reservation model exists yet. Let me check the AWS SDK XML reference for both actions by looking at any sample SDKs or localstack docs:
Assistant
Let me look at the compatibility tests directory for ELBv2:
Assistant
Now I have a complete understanding. Let me make a plan and implement the fix:
Plan
- Create
CapacityReservationrecord inmodel/package - Add service methods to
ElbV2Service:describeListenerAttributes(region, arn)modifyListenerAttributes(region, arn, newAttrs)describeCapacityReservation(region, arn)
- Add handlers to
ElbV2QueryHandler:handleDescribeListenerAttributeshandleModifyListenerAttributeshandleDescribeCapacityReservation
- Wire up the new actions in the switch statement
Let me first check the existing pom.xml for any related dependency or test framework:
- Create
Assistant
Let me check the AwsException class to understand it better:
Assistant
Now I have all the context I need. Let me create the
CapacityReservationmodel first:Assistant
Now let me add the new service methods. First, I'll open the ElbV2Service.java to find a good location:
Assistant
I'll add the new service methods between the existing
modifyListenerand the// ── Rules ──section. Let me make the edit:Assistant
see I accidentally duplicated content. Let me check the file again and fix it:
Assistant
need to remove the duplicated lines:
Assistant
Now the service file is correct. Let me also verify the closing brace of
modifyListenerlooks correct (line 399):Assistant
Good. The file is correct now. Let me also check the rule comment header is missing a blank line:
Assistant
Let me add the missing blank line for consistency with the rest of the file:
Assistant
Service is good. Now let me update the QueryHandler. Let me first look at the listener section so I can add the new handlers right after the existing
ModifyListenerhandler:Assistant
Now let me add the new handlers in the QueryHandler. I'll add them in two places:
- The switch statement (top of the file)
- The actual handler methods (in the body of the class)
Assistant
a duplicate
case "ModifyListener". Let me fix it:Assistant
Good. Now let me find where the listener modify handler ends, and add the new handler methods there:
Assistant
Now let me add the new handler methods between
handleModifyListenerand the// ── Rules ──section:Assistant
I see duplicate code from the
handleModifyListenermethod's tail. Let me clean it up:Assistant
Now let me build the project to verify everything compiles:
Assistant
Let me try compiling just the changed Java files to verify they are valid:
Assistant
Good, both are available. Now let me run the full Maven compile (it will be quicker to use mvn):
Assistant
Compilation is successful. Now let me write a temporary test script to validate the fix using the Quarkus integration test infrastructure:
Assistant
Offline mode is missing dependencies. Let me run without -o:
Assistant
All 27 existing ELBv2 tests pass. Now let me write a temporary script to verify the bug fix for the three new actions:
Assistant
me look at how to start the Floci app and verify the bug fix via a curl-based reproduction script:
Assistant
Let me create a temporary test class that verifies the bug fix works:
Assistant
Let me run the temporary test to verify:
Assistant
All 7 tests pass! Now let me also try the exact reproduction commands from the issue using
curlagainst the test endpoint:Assistant
Let me also check the issue from a different angle - by looking at how the AWS SDK behaves when these responses have empty CapacityReservation fields. Let me check whether the AwsException handling for invalid listener ARN also raises proper ListenerNotFound code. Let me verify the actual XML response:
Assistant
me run the full elbv2 test suite (existing tests + my new temp test) to make sure nothing is broken:
Assistant
All 43 ELBv2 tests pass (7 new + 27 existing + 9 lambda). Now let me also verify the full test suite doesn't have issues:
Assistant
full test suite takes too long. Let me focus on related services tests to confirm I haven't broken anything:
Assistant
The only failing test is unrelated to my changes - it's an S3 test with locale issues (non-ASCII filename). All 43 ELBv2 tests pass. Let me also verify by looking at the test more carefully to confirm it's pre-existing:
Assistant
Confirmed - the S3 test failure is pre-existing. Let me restore my changes:
Assistant
Now let me delete the temporary test file as required:
Assistant
me verify everything still compiles correctly after removing the temp test:
Assistant
All 36 existing ELBv2 tests pass (27 + 9). Now let me also verify that the Lambda dispatch tests, which can be flaky, aren't affected:
Assistant
All changes are in place. Let me verify the final state:
Assistant
Let me check whether there's any handling for empty CapacityReservation response in similar SDK implementations to make sure my implementation works:
Assistant
Let me run one final comprehensive check of all elbv2 tests to ensure everything is working:
Assistant
All 36 ELBv2 tests pass. Let me also verify there are no temporary files left over:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.