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
Now let me look at the ElbV2Service to understand the existing structure:
Assistant
Now let me look at the model classes to understand the structure of LoadBalancer and Listener:
Assistant
Now I have a good understanding of the codebase. Let me check the existing tests to understand the testing pattern:
Assistant
Now I understand the codebase structure. Let me create a plan:
- Add
CapacityReservationrecord toElbV2Service.java - Add
describeListenerAttributes,modifyListenerAttributes, anddescribeCapacityReservationmethods toElbV2Service.java - Add a
capacityReservationfield toLoadBalancermodel - Add handler methods for the three new actions in
ElbV2QueryHandler.java - Register the new actions in the action switch statement
Let me start by implementing the changes:
- Add
Assistant
Now let me add the new actions to the switch statement and implement the handler methods. First, let me see the exact lines of the switch cases for Listeners:
Assistant
I need to use the proper edit syntax. Let me use sed to make the changes:
Assistant
The sed command executed but I'm not sure if it worked correctly because I used \n which might not have been interpreted correctly. Let me check the file to see what happened.
Assistant
The new listener attribute cases were added correctly. Now I need to add the
DescribeCapacityReservationaction. Let me find where to add it (near the LoadBalancer cases):Assistant
I'll add the
DescribeCapacityReservationcase afterSetIpAddressType:Assistant
Good, now I need to add the handler methods. Let me find the line numbers where I should insert them. First let me see the handleDescribeLoadBalancerAttributes method:
Assistant
Good. Now let me find the end of handleSetIpAddressType to add the handleDescribeCapacityReservation method after it:
Assistant
Now I'll add the handleDescribeCapacityReservation method after handleSetIpAddressType. I need to insert it at line 253 (after the closing brace and before the Target Groups comment):
Assistant
Let me use sed to insert the handler method for DescribeCapacityReservation after line 252 (the closing brace of handleSetIpAddressType):
Assistant
Let me find the line numbers for the listeners section to add the handler methods there:
Assistant
Let me see the context around handleDescribeListenerCertificates to know where to insert the new handler methods:
Assistant
Now I'll create a script to make all the necessary modifications to the files:
Assistant
Now let me insert the capacity reservation handler after the handleSetIpAddressType method:
Assistant
Let me verify the changes to the handler file:
Assistant
Now I need to add the import for CapacityReservation in the handler. Let me first check the current imports:
Assistant
I see the imports. The
CapacityReservationclass will be in the same package (io.github.hectorvent.floci.services.elbv2), so no import is needed. But I need to define the record in the ElbV2Service.java file. Let me also check the listener attribute handlers:Assistant
Let me verify the listener attribute handlers:
Assistant
Now I need to add the service methods. Let me add them to ElbV2Service.java. First, let me find where to add the CapacityReservation record:
Assistant
I'll add the
CapacityReservationrecord after the imports and before the@ApplicationScopedannotation:Assistant
Now I need to add the three new methods to ElbV2Service. Let me find the right place to add the listener attribute methods (near the listener certificates methods):
Assistant
I'll add the listener attribute methods after the describeListenerCertificates method (after line 642):
Assistant
Now I need to add the
describeCapacityReservationmethod. Let me find where to add it (near the other load balancer methods):Assistant
I'll add the describeCapacityReservation method after setIpAddressType (after line 167):
Assistant
Let me verify all changes in ElbV2Service.java:
Assistant
The changes look correct. Now let me run the tests to verify everything compiles and works:
Assistant
Since HOME is not set, let me set it first </tool_call>
Assistant
Let me set the HOME variable and try to compile again.
Assistant
I need to remove the
publicmodifier from the record since it's inside ElbV2Service.java. Let me fix that:Assistant
I need to fix this - the record should be inside the class, not outside it. Let me revert and properly add it as a static nested record.
Assistant
Ah I see - the record is at package level (outside the class), and Java doesn't allow a non-public top-level class/record unless it's in its own file. I need to either:
- Make it a nested static class/record inside ElbV2Service
- Or make it package-private (default) and put it in a separate file
Actually, looking at the diff more carefully, the record is defined at package level (outside the class), and since I removed
public, it should be package-private which is valid for a top-level class. But the error says "class CapacityReservation is public" - wait, I changed it but let me check...Assistant
The record is now package-private, but it's still causing a compilation error because Java requires a file named CapacityReservation.java for a top-level record. Actually, looking at the error again, it says "class CapacityReservation is public" but I removed public. Let me check if there's a caching issue or the file wasn't saved properly.
Assistant
I need to make CapacityReservation a nested record inside ElbV2Service, since Java doesn't allow a top-level package-private type in a file named differently. Let me fix this:
Assistant
Let me revert and take a different approach - I'll make CapacityReservation a static nested record inside ElbV2Service:
Assistant
Let me create a separate file for the CapacityReservation record:
Assistant
Now let me add the three methods to ElbV2Service.java:
Assistant
The user seems to have encountered a system error or timeout. Let me continue with my implementation. I need to add the methods to ElbV2Service.java.
Assistant
I need to add the three new methods to ElbV2Service.java. Let me add describeCapacityReservation after setIpAddressType:
Assistant
Let me find where to add the listener attribute methods:
Assistant
The user's shell session seems to have timed out. I need to continue where I left off. Let me check the current state of the files and continue adding the listener attribute methods to ElbV2Service.java.
Assistant
Good, the shell is still working. Now I need to add the two listener attribute methods (describeListenerAttributes and modifyListenerAttributes) after the describeListenerCertificates method. The describeListenerCertificates method ends at line 642, so I'll insert after line 642.
Assistant
The user seems to have experienced a timeout. Let me continue checking the current state of the files and verify what has been done so far, then complete any remaining work.
Assistant
Good, the listener attribute methods were added successfully. Now let me verify the describeCapacityReservation method was also added, and then try to compile to make sure everything works.
Assistant
The user is asking me to check if there's a currently open file. Let me verify my implementation is complete by:
- Checking the current state of all modified files
- Compiling to see if there are any errors
- Running tests if compilation succeeds
Let me check the current status of the implementation.
Assistant
Good. I have:
- Modified ElbV2QueryHandler.java - added action cases and handler methods
- Modified ElbV2Service.java - added describeCapacityReservation, describeListenerAttributes, modifyListenerAttributes methods
- Created CapacityReservation.java - the record class
Let me verify the complete state of each file and then try to compile.
Assistant
Let me verify the changes I made and ensure the code compiles properly. I need to check:
- The CapacityReservation.java file (already verified)
- The ElbV2Service.java file for the new methods
- The ElbV2QueryHandler.java file for the new action handlers
Let me check the handler to make sure it references CapacityReservation properly.
Assistant
Good, the ElbV2QueryHandler.java already has the CapacityReservation references. Now I need to verify that it compiles correctly. Let me try to compile the project.
Assistant
the compilation seems to have succeeded (no error messages). Let me now run the tests to make sure everything works correctly.
Assistant
The tests ran successfully. Now let me create a test script to verify the new actions work correctly by testing against the running service.
Assistant
Let me verify my implementation is complete and correct by reviewing what I've done and checking if there are any issues.
The issue requires:
DescribeListenerAttributes- returns listener attributesModifyListenerAttributes- modifies listener attributesDescribeCapacityReservation- returns capacity reservation status
I've:
- Created
CapacityReservation.javarecord - Added methods to
ElbV2Service.java:describeListenerAttributesmodifyListenerAttributesdescribeCapacityReservation
- Added action cases and handler methods to
ElbV2QueryHandler.java
Let me verify the tests pass and also write a simple test to confirm the new actions work.
Assistant
I need to check if the tests actually passed. The grep might have filtered out all output if there were no matches. Let me run the tests again and see the full output to verify they passed.
Assistant
All 27 existing tests pass. Now let me create a simple test script to verify the new actions work correctly.
Assistant
The user seems to have sent an empty message or the system is showing an error about "Extra data detected". Let me continue with my task. I was in the middle of verifying my implementation. Let me continue checking the diff for ElbV2Service.java and then run tests to confirm everything works.
Assistant
The user seems to have sent an empty message or there was some kind of transmission error. I was in the middle of verifying my implementation changes. Let me continue with verifying the new CapacityReservation.java file and then run some tests to make sure the new actions work correctly.
I've made the following changes:
- Created CapacityReservation.java record
- Modified ElbV2Service.java to add:
- describeCapacityReservation method
- describeListenerAttributes method
- modifyListenerAttributes method
- Modified ElbV2QueryHandler.java to add:
- Action cases for the three new actions
- Handler methods for the three new actions
Let me verify the CapacityReservation.java file exists and then run a comprehensive test to make sure everything works.
Assistant
I see that the capacityReservation.java file exists and looks correct. Now let me create a test script to verify the new actions work correctly. I'll write a test that creates a load balancer and listener, then calls the new actions.
Assistant
I have completed the implementation and verified that all existing tests pass. Let me submit my changes now.
Assistant
Let me verify my implementation is complete and working before submitting. Let me check that the existing tests still pass and the new actions work correctly.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.