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 how it's organized and find the relevant files for ELBv2 implementation.
Assistant
Now let me look at the
ElbV2Service.javafile to understand the existing service methods:Assistant
Now let me look at the Listener model to understand its structure:
Assistant
Good, the Listener model already has an
attributesfield. Now let me check the LoadBalancer model to see if there's a capacity reservation field:Assistant
Now let me look at the test file to understand how these services are tested:
Assistant
Now I have a good understanding of the codebase. Let me check the AWS documentation format for the responses by looking at how similar actions are implemented. Let me see what the full test file looks like (it was truncated):
Assistant
Now let me understand what build system this project uses:
Assistant
It's a Maven project. Now let me create my implementation plan:
- Add the
CapacityReservationrecord toElbV2Service.java - Add
describeListenerAttributesmethod toElbV2Service.java - Add
modifyListenerAttributesmethod toElbV2Service.java - Add
describeCapacityReservationmethod toElbV2Service.java- need to add capacity reservation field to LoadBalancer - Add handler methods to
ElbV2QueryHandler.javafor:DescribeListenerAttributesModifyListenerAttributesDescribeCapacityReservation
- Register the new actions in the action switch statement in
ElbV2QueryHandler.java
Let me first add the capacity reservation field to the LoadBalancer model:
- Add the
Assistant
Let me use sed and bash to make the changes:
Assistant
Now I'll use sed to add the capacityReservation field and its getter/setter:
Assistant
Now add the getter and setter for capacityReservation:
Assistant
Let me verify the LoadBalancer.java file now:
Assistant
Now I need to create the CapacityReservation record class. Let me check if there's a pattern for records in the project:
Assistant
According to the issue description, the CapacityReservation record should be in
ElbV2Service.java. Let me add the CapacityReservation record to ElbV2Service.java and then add the service methods. Let me first view the full ElbV2Service.java to understand its structure:Assistant
I'll add the CapacityReservation record after the class declaration and before the fields. Let me insert it:
Assistant
Wait, that's wrong - I can't have a record inside a class without it being static. Let me check what happened and fix it properly:
Assistant
Good, the record is at the top level now. Now I need to add the three service methods to ElbV2Service.java. Let me find where to add them - after the existing load balancer methods:
Assistant
I'll add the
describeCapacityReservationmethod aftersetIpAddressType:Assistant
Now I need to find the Listener methods section and add the listener attribute methods. Let me find where the listener methods are:
Assistant
Now I need to add the listener attribute methods. I'll add them after the modifyListener method, before the Rules section:
Assistant
Now I need to update the ElbV2QueryHandler.java to add the handler methods and register the actions in the switch statement. Let me first check the current switch statement:
Assistant
Now I'll add the new actions to the switch statement. Let me add them after ModifyListener:
Assistant
Now let me also add the DescribeCapacityReservation action. Let me find a good place for it (near other load balancer actions):
Assistant
Let me verify the switch statement now:
Assistant
Now I need to implement the handler methods. Let me find where the existing handler methods are defined:
Assistant
Now I'll add the
handleDescribeCapacityReservationmethod afterhandleDescribeLoadBalancerAttributes. Let me first check the AWS API documentation format for this response:Assistant
Now I need to add the import for CapacityReservation in the ElbV2QueryHandler.java file. Let me check the current imports:
Assistant
Good, the
CapacityReservationrecord is in the same packageio.github.hectorvent.floci.services.elbv2, so no additional import is needed. Now I need to add the listener attribute handler methods. Let me find where the listener handler methods are:Assistant
Now I need to add the two listener attribute handler methods before the Rules section. Let me insert them:
Assistant
Let me verify the changes were applied correctly:
Assistant
The sed command with the dashed comment may not have matched. Let me check what the exact comment line looks like:
Assistant
.
Assistant
The sed insertion might have failed because of special characters. Let me check if the methods are already there:
Assistant
Only 1 occurrence - that's the switch case, but not the method definition. Let me try a different approach - I'll find the exact line number and insert the methods:
Assistant
Now let me use sed to insert this before line 492:
Assistant
The methods have been added. Now let me compile the project to check for any errors:
Assistant
I need to fix two issues:
- The
CapacityReservationrecord should be in its own file (Java requires public classes/records to be in their own files) - The
LoadBalancer.javafile needs to importCapacityReservationfrom the correct package
Let me create the CapacityReservation.java file:
- The
Assistant
Now let me remove the record from ElbV2Service.java:
Assistant
I need to remove the record definition from ElbV2Service.java since I've created a separate file for it:
Assistant
There's a dangling
*/. Let me fix it properly by restoring from backup and re-applying the changes more carefully:Assistant
Now let me re-apply all changes to ElbV2Service.java more carefully. First, let me find the line numbers where I need to add the methods:
Assistant
Now I'll use a more reliable approach - create a temporary script to insert the changes:
Assistant
I'll insert the
describeCapacityReservationmethod after line 161 (after the closing brace ofsetIpAddressType):Assistant
Now let me find the new line number for the Rules section and add the listener attribute methods:
Assistant
Now I need to add the import for
CapacityReservationinLoadBalancer.java:Assistant
Now let's compile again to check for errors:
Assistant
The code compiles successfully. Now let me run the existing tests to make sure I haven't broken anything:
Assistant
Let me check if the tests passed or failed.
Assistant
Excellent! All 27 tests pass. Now let me create a test script to verify my new functionality works correctly:
Assistant
Now let me run the tests by starting the server in the background and running the test script:
Assistant
.
Assistant
The server is starting but waiting for input. Let me kill it and use a different approach - run the tests using the existing test framework:
Assistant
Let me write a proper integration test that I can run with Maven:
Assistant
Now let me run this new test:
Assistant
All 10 tests pass. Let me also run the original tests again to make sure everything still works:
Assistant
All tests pass. Now let me remove the temporary test file I created since the instructions say not to add new tests:
Assistant
Now let me also clean up the backup file I created:
Assistant
Let me verify all my changes by reviewing the modified files:
Assistant
Let me see the diff to verify all changes are correct:
Assistant
Let me run the ELBv2 tests one more time to make sure everything passes:
Assistant
All 36 ELBv2 tests pass. Now let me verify the fix by checking that the actions no longer return "UnsupportedOperation". Let me view the switch statement one more time:
Assistant
Let me also check that there are no other tests that might be affected by my changes:
Assistant
The full test suite is taking too long. Let me just verify my specific changes one more time and then summarize what was done:
Assistant
Let me verify the compilation is still good:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.