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
I'll start by exploring the repository structure to understand the codebase and then implement the missing ELBv2 actions.
Assistant
Let me explore the ELBv2 service files to understand the current implementation.
Assistant
The user seems to have encountered an error with the file opening command. Let me try a different approach to view the file. I'll use the cat command to display its contents.
Assistant
Now let me look at the QueryHandler to see the action switch:
Assistant
Now let me look at the Listener model to understand its current structure:
Assistant
Good, the Listener model already has an attributes map. Now let me look at the LoadBalancer model to see its current structure:
Assistant
Now let me check the existing tests to understand the testing patterns:
Assistant
Now let me look at the full QueryHandler file to understand the handler patterns better, especially for listeners:
Assistant
Now I have a good understanding of the codebase. Let me plan my implementation:
- ElbV2Service.java: Add methods for
describeListenerAttributes,modifyListenerAttributes, anddescribeCapacityReservation, plus aCapacityReservationrecord - LoadBalancer.java: Add capacity reservation field
- ElbV2QueryHandler.java: Add handlers for the three new actions
Let me start by modifying the ElbV2Service.java to add the new methods:
- ElbV2Service.java: Add methods for
Assistant
Let me find the right place to add the new methods. I'll look for where the
describeLoadBalancerAttributesandmodifyLoadBalancerAttributesmethods are defined, and add the listener attribute methods nearby:Assistant
Now I need to add the new methods. I'll add them after the
setIpAddressTypemethod and before the Target Groups section. Let me also find where listener-related methods are:Assistant
Now let me see what's after the modifyListener method to find a good place to add the new listener attribute methods:
Assistant
Now I'll add the new methods. I need to:
- Add
describeListenerAttributesandmodifyListenerAttributesmethods to ElbV2Service aftermodifyListener - Add the
CapacityReservationrecord anddescribeCapacityReservationmethod - Update the LoadBalancer model to include capacity reservation support
Let me first create the CapacityReservation record and add the methods to ElbV2Service.java:
- Add
Assistant
Now I'll insert the new methods after the modifyListener method (line 399) and before the Rules section:
Assistant
Now let me insert this code into the ElbV2Service.java file after line 399 (after the closing brace of modifyListener):
Assistant
Let me verify the insertion:
Assistant
The service methods are now in place. Now I need to update the ElbV2QueryHandler.java to add the handlers for the new actions. Let me find the right place to add them in the switch statement and add the handler methods:
Assistant
I need to add the three new actions to the switch statement. I'll add
DescribeListenerAttributesandModifyListenerAttributesafterModifyListener, andDescribeCapacityReservationafter the Load Balancer section:Assistant
The switch cases are added. Now I need to add the handler methods. Let me find where to add them:
Assistant
Good. I need to add the
handleDescribeCapacityReservationmethod afterhandleSetIpAddressType. Let me insert it:Assistant
Now I need to check if XmlBuilder has an
elemIfPresentmethod:Assistant
I see the
elemmethod skips the element when value is null. Let me check the implementation:Assistant
I see that
elem(String, String)already skips null values. So I can just convert Integer to String before passing. Let me update my handler code:Assistant
Now I need to insert this handler method. The line 252 (after
handleSetIpAddressType) is where I should add it. Let me find the exact line number:Assistant
Now I need to add the listener attributes handlers. Let me find where
handleModifyListenerends:Assistant
Let me check lines around 485-490:
Assistant
Now I'll add the listener attributes handler methods after line 485:
Assistant
Let me verify the changes:
Assistant
Good. Let me also verify the switch statement looks correct:
Assistant
Excellent! Now let me verify the handleDescribeCapacityReservation handler was properly inserted:
Assistant
Now let me try to build and run the tests to see if the code compiles correctly:
Assistant
I need to set the HOME variable first
Assistant
The compilation succeeded. Now let me run the ELBv2 integration tests to make sure the existing tests pass:
Assistant
I need to check if the test passed. Let me look for test results in the output.
Assistant
I've successfully implemented the three missing ELBv2 actions and confirmed all existing tests pass. Now let me write a small test script to verify that my new actions work correctly before submitting.
Assistant
I need to add the import statement for
notNullValueto the test file.Assistant
All 10 tests pass. The wildcard import already includes
notNullValue. Let me clean up my temporary test file since the instructions say I should NOT modify tests, and verify that my implementation is complete.Assistant
Now let me run the existing ELBv2 tests again to make sure I didn't break anything:
Assistant
Let me verify my changes by reviewing what I've modified:
Assistant
I have successfully implemented the missing ELBv2 actions. Let me provide my reasoning for each checklist item:
Checklist Review:
-
If an error was reported in the issue description, I have successfully reproduced it. ✓
- I examined the codebase and confirmed that
DescribeListenerAttributes,ModifyListenerAttributes, andDescribeCapacityReservationwere missing fromElbV2QueryHandler's action switch, which would cause the default case to returnUnsupportedOperation.
- I examined the codebase and confirmed that
-
If an error was reported in the issue description, I have confirmed that my fix resolves the error. ✓
- I created and ran a comprehensive test (10 tests) that validates all three new actions work correctly. All tests passed including edge cases like non-existent resources.
-
I have thought about edge cases and made sure my fix handles them as well. ✓
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.