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:
codeapi 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
bash# 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. Assistant
Let me start by exploring the repository structure to understand the codebase
Assistant
Now I have a clear understanding. Let me look at the ELBv2 service structure.
Assistant
Now let me look at the ElbV2QueryHandler.java file to see how actions are handled.
Assistant
me look at the LoadBalancer model and the rest of the ElbV2QueryHandler.
Assistant
Now let me look at the Listener model.
Assistant
me view the rest of the ElbV2QueryHandler.java to find existing handlers.
Assistant
me check the existing tests for the ELBv2 service.
Assistant
Let me look at the TargetGroup model and how its attributes work.
Assistant
Let me check the rest of the ElbV2Service.java for the target group attributes pattern.
Assistant
Let me check the project setup and see the build files.
Assistant
Let me also check the test configuration and how to run tests.
Assistant
Let me first verify that the existing tests pass before I make changes.
Assistant
Let me see the full result, including any failure messages
Assistant
Now let me look at the model directory structure for the elbv2 service.
Assistant
Now I have all the info I need. Let me first create a script to reproduce the issue.
Assistant
successfully reproduced the issue. Now let me implement the fix. First, let me create the
CapacityReservationmodel.Assistant
Now let me add the new methods to
ElbV2Service. Let me first view the section where target group attribute methods are defined to add the listener attribute methods nearby.Assistant
me find where the
modifyListenermethod ends to place the attribute methods nearby.Assistant
I'll insert the new methods to
ElbV2Service.javaright before the Rules section.Assistant
perl replace mangled the newlines. Let me check what happened.
Assistant
Let me revert the file and try a different approach.
Assistant
, file is restored. Let me use
sedto insert the methods before the Rules section.Assistant
also check that the
import io.github.hectorvent.floci.services.elbv2.model.*wildcard already importsCapacityReservation.Assistant
Now let me add the cases to the switch statement in
ElbV2QueryHandler.java.Assistant
Let me add the new switch cases using
replace.Assistant
Now let me add the capacity reservation case in the load balancers section.
Assistant
Now let me add the actual handler methods. Let me find a good place to add them.
Assistant
Now let me add the listener attribute handlers. Let me find the end of
handleModifyListener:Assistant
Now let me build and verify the code compiles correctly.
Assistant
The code compiles successfully. Now let me run the reproduction tests.
Assistant
All my reproduction tests pass. Let me now run the existing ELBv2 tests to make sure I haven't broken anything.
Assistant
Let me enhance the reproduction test to cover more edge cases.
Assistant
Let me see the actual test output to understand the failure.
Assistant
The functionality works - the test was checking incorrectly. Let me fix the test.
Assistant
All 10 tests pass. Let me also run all existing ELBv2 tests to make sure I haven't broken anything.
Assistant
All 46 tests pass. Let me also run the broader test suite to ensure nothing else is affected.
Assistant
Let me check what failures are happening to make sure they're not related to my changes.
Assistant
The failures are all in apigateway tests, not related to my ELBv2 changes. Let me verify these were pre-existing failures by checking out the original code temporarily.
Assistant
Hmm, the test command failed (probably timed out). Let me try with the stash and see if the failures pre-exist or not:
Assistant
Confirmed - those ApiGateway test failures are pre-existing on main, not caused by my changes. Let me run only the ELBv2 tests to confirm.
Assistant
All 46 ELBv2 tests pass. Let me now verify the final state of my changes and clean up the reproduction test file (since I added it as a temporary test).
Assistant
Let me also see the new model file.
Assistant
Now let me clean up the temporary reproduction test file.
Assistant
Now let me re-run the existing tests to make sure everything still works.
Assistant
Let me create a temporary reproduction script to verify the fix one more time before submission.
Assistant
The fix is verified. Let me clean up the temporary script.
Assistant
Now let me verify the final state of my changes:
Assistant
me run the tests one final time to ensure everything works.
Assistant
All 36 ELBv2 tests pass. Let me also verify my final changes look good.
Assistant
also check the final state of the modifications to make sure everything is in good shape.
Assistant
fix is complete and verified. Let me review the checklist:
- ✅ Reproduced the error: Created a test confirming
UnsupportedOperationfor all three actions before the fix. - ✅ Confirmed fix resolves the error: All 6 reproduction tests pass after the fix.
- ✅ Edge cases handled:
- Unknown listener ARN →
ListenerNotFound(validation in service) - Unknown LB ARN for capacity reservation →
LoadBalancerNotFound(validation viarequireLoadBalancer) - ModifyListenerAttributes on unknown listener →
ListenerNotFound - DescribeListenerAttributes reflects modify operations
- The CapacityReservation XML response conditionally includes only non-null fields (mirrors AWS behavior for LBs with no reservation)
- Unknown listener ARN →
- ✅ Existing tests pass: All 36 ELBv2 tests pass (27 integration + 9 lambda target). I also confirmed the pre-existing ApiGateway test failures are not related to my changes.
Let me run one final check on the ELBv2 tests to confirm.
- ✅ Reproduced the error: Created a test confirming
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.