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 understand the issue:
-
Two AWS ELBv2 API actions are not supported in Floci:
DescribeListenerAttributes- should return listener attributesDescribeCapacityReservation- should return capacity reservation status
-
These are called by
@pulumi/awsprovider 6.66.0+ when refreshing resources, causing errors. -
The issue mentions that a PR will implement these actions, and describes the interface needed.
Let me first explore the repository structure to understand how it's organized and find the relevant files.
-
Assistant
Let me explore the source directory structure to find the ElbV2Service file.
<tool_call> <function=bash_terminal> <parameter=command> find src -name "*.java" | head -50 </tool_call>
Assistant
Let me search for Java files related to ElbV2.
Assistant
Let me find the ElbV2Service file specifically.
<tool_call> <function=bash_terminal> <parameter=command> find src -name "ElbV2" -o -name "ElbV2" 2>/dev/null </tool_call>
Assistant
Let me use bash_terminal to search for ElbV2 related files.
Assistant
Now let me open the ElbV2Service.java file to understand the existing structure.
<tool_call> <function=bash_terminal> <parameter=command> cat src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java </tool_call>
Assistant
Let me use the bash_terminal tool correctly to read the file.
Assistant
Now let me look at the ElbV2QueryHandler to understand how actions are handled and where I need to add the new actions.
<tool_call> <function=bash_terminal> <parameter=command> cat src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java </tool_call>
Assistant
Let me use the bash_terminal tool to read the ElbV2QueryHandler.java file.
Assistant
Now let me look at the model files to understand how attributes are stored for LoadBalancer and TargetGroup. I need to see if there's a similar pattern I can follow for Listeners.
<tool_call> <function=bash_terminal> <parameter=command> ls -la src/main/java/io/github/hectorvent/floci/services/elbv2/model/ </tool_call>
Assistant
Let me use the bash_terminal tool to list the model directory.
Assistant
Now let me look at the LoadBalancer model to understand how attributes are implemented.
<tool_call> <function=bash_terminal> <parameter=command> cat src/main/java/io/github/hectorvent/floci/services/elbv2/model/LoadBalancer.java </tool_call>
Assistant
Let me use bash_terminal to read the LoadBalancer.java model file.
Assistant
Now let me look at the Listener model to see if it already has attributes support.
<tool_call> <function=bash_terminal> <parameter=command> cat src/main/java/io/github/hectorvent/floci/services/elbv2/model/Listener.java </tool_call>
Assistant
Let me use the bash_terminal tool correctly to read the Listener.java model file.
Assistant
The Listener model already has attributes support! Now I need to understand how LoadBalancer handles capacity reservation. Let me check the full ElbV2Service to see if there's any capacity reservation related code, and also check the TargetGroup model for attribute patterns.
<tool_call> <function=bash_terminal> <parameter=command> cat src/main/java/io/github/hectorvent/floci/services/elbv2/model/TargetGroup.java </tool_call>
Assistant
Let me read the TargetGroup model to understand the attribute pattern.
Assistant
Now let me understand how the target group attributes are handled in the ElbV2QueryHandler to get a pattern for implementing listener attributes.
Let me look at the part of ElbV2QueryHandler that handles target group attributes:
<tool_call> <function=bash_terminal> <parameter=command> grep -n "handleModifyTargetGroupAttributes|handleDescribeTargetGroupAttributes" src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java </tool_call>
Assistant
Let me use bash_terminal to grep for the attribute handling methods.
Assistant
Let me see the implementation of these methods:
Assistant
Now let me look at the ElbV2Service to see how these target group attribute methods are implemented:
<tool_call> <function=bash_terminal> <parameter=command> grep -n "modifyTargetGroupAttributes|describeTargetGroupAttributes" src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java </tool_call>
Assistant
Let me use bash_terminal to grep for the target group attribute methods in ElbV2Service.java.
Assistant
Now let me see those methods:
<tool_call> <function=bash_terminal> <parameter=command> sed -n '273,285p' src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java </tool_call>
Assistant
Let me use bash_terminal to grep and see those specific lines.
Assistant
Now I understand the pattern. I need to:
-
Add methods to ElbV2Service.java:
describeListenerAttributes(String region, String arn)- returns listener attributesmodifyListenerAttributes(String region, String arn, Map<String, String> newAttrs)- modifies listener attributesCapacityReservationrecord (or class)describeCapacityReservation(String region, String arn)- returns capacity reservation state
-
Add handlers to ElbV2QueryHandler.java:
handleDescribeListenerAttributes(params, region)handleModifyListenerAttributes(params, region)handleDescribeCapacityReservation(params, region)- Add the new actions to the switch statement
Let me first check what tests exist to understand how to reproduce the issue and test my fix.
<tool_call> <function=bash_terminal> <parameter=command> ls -la src/test/java/io/github/hectorvent/floci/services/elbv2/ </tool_call>
-
Assistant
Let me use bash_terminal to list the test files.
Assistant
Let me check how the existing tests are structured and if there are any tests for attributes:
<tool_call> <function=bash_terminal> <parameter=command> grep -n "Attributes|Capacity" src/test/java/io/github/hectorvent/floci/services/elbv2/ElbV2IntegrationTest.java | head -30 </tool_call>
Assistant
Let me use bash_terminal to grep for attribute-related tests in the integration test file.
Assistant
Now I have a good understanding of the patterns. Let me also check how capacity reservation works in AWS. For now, let me start implementing the changes. I'll need to:
- Add methods to ElbV2Service.java
- Add handlers to ElbV2QueryHandler.java
Let me start with the ElbV2Service.java file. First, I need to add:
- A CapacityReservation record/class
- Methods for describeListenerAttributes, modifyListenerAttributes, and describeCapacityReservation
Let me look at the end of ElbV2Service.java to see where to add the new methods:
<tool_call> <function=bash_terminal> <parameter=command> tail -100 src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java </tool_call>
Assistant
Let me use the bash_terminal tool to get the last 100 lines of the file.
Assistant
Now I have a clear picture of what needs to be done. Let me implement the fix step by step:
- First, I'll add the
CapacityReservationrecord to the model package - Then add the methods to
ElbV2Service.java - Finally add the handlers to
ElbV2QueryHandler.java
Let me start by creating the CapacityReservation class in the model package:
- First, I'll add the
Assistant
Now let me add the methods to ElbV2Service.java. I need to add methods for:
describeListenerAttributes- returns listener attributes mapmodifyListenerAttributes- modifies listener attributesdescribeCapacityReservation- returns capacity reservation state
I'll add these methods before the "Helpers" section. Let me find where to insert them:
Assistant
I need to look at the file to see where to insert the listener attribute methods. Let me check the area around line 638 to see what section comes before "Helpers".
Assistant
Now let me add the listener attributes and capacity reservation methods to ElbV2Service.java. I'll insert them after the listener certificates methods and before the Helpers section:
Assistant
Let me add the listener attributes methods and capacity reservation methods after line 636 (after the describeListenerCertificates closing brace).
Assistant
Let me verify the changes were added correctly:
Assistant
Now I need to add the handlers to ElbV2QueryHandler.java. Let me add the actions to the switch statement first:
Assistant
Let me view the relevant section of the switch statement to add the new action handlers:
Assistant
Now let me add the new action handlers to the switch statement:
Assistant
Now let me verify the changes were made correctly:
<tool_call> <function=bash_terminal> <parameter=command> sed -n '100,120p' src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java </tool_call>
Assistant
Let me use bash_terminal to verify the changes.
Assistant
Now I need to add the handler methods for the new actions. Let me find where to add them. I'll add them near the listener certificates handlers. Let me first find the handleDescribeListenerCertificates method:
<tool_call> <function=bash_terminal> <parameter=command> grep -n "handleDescribeListenerCertificates" src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java </tool_call>
Assistant
Let me use bash_terminal to find the line number for handleDescribeListenerCertificates method.
Assistant
Let me see the handleDescribeListenerCertificates method:
Assistant
I need to add the three handler methods. Let me find a good place to add them. I'll add them after the handleDescribeListenerCertificates method. Let me first find where that method ends:
Assistant
Let me add the three new handler methods after the handleDescribeListenerCertificates method:
Assistant
Let me verify the changes were added correctly:
Assistant
Now I need to add the import statement for CapacityReservation in ElbV2QueryHandler.java. Let me check the existing imports:
Assistant
The imports are using a wildcard import that will include CapacityReservation. Now let me compile the code to make sure there are no errors:
Assistant
Let me try to use mvn directly or fix the HOME environment issue:
Assistant
The compilation completed successfully! There are just warnings, but no errors. Let me verify by checking the exit status.
<tool_call> <function=bash_terminal> <parameter=command> export HOME=/tmp && ./mvnw compile 2>&1 | tail -5 </tool_call>
Assistant
Let me verify the compilation was successful by checking the tail output more carefully.
Assistant
The compilation was successful! Now let me run the existing tests to make sure I didn't break anything.
<tool_call> <function=bash_terminal> <parameter=command> export HOME=/tmp && ./mvnw test -Dtest=ElbV2IntegrationTest -q 2>&1 | tail -30 </tool_call>
Assistant
Let me run the test command properly to see the results.
Assistant
All 27 tests passed. Now let me create a simple test script to verify that the new API actions work correctly:
Assistant
I see the test script was created. Now let me run the ELBv2 Lambda target integration test as well to ensure nothing is broken:
<tool_call> <function=bash_terminal> <parameter=command> export HOME=/tmp && timeout 120 ./mvnw test -Dtest=ElbV2LambdaTargetIntegrationTest 2>&1 | tail -30 </tool_call>
Assistant
The command should be wrapped in a function call.
Assistant
All tests pass. Now let me check if I need to look at how the LoadBalancer handles CapacityReservation, since the description mentions capacity reservation should return the load balancer's capacity reservation status. Let me also verify my implementation matches what the issue expects.
Looking at the issue description again:
DescribeCapacityReservationreturns the load balancer's capacity reservation status (empty/none when no capacity is reserved).- The CapacityReservation record should have:
decreaseRequestsRemaining,minimumCapacityUnits,lastModifiedTime
The issue says "Floci returns null fields when no capacity is reserved." This means my implementation that returns
nullis correct.Assistant
Let me use bash_terminal to view the CapacityReservation.java file.
Assistant
The CapacityReservation record is correct. Now let me check the ElbV2Service methods:
Assistant
Good, the methods look correct. Now let me check the ElbV2QueryHandler methods:
<tool_call> <function=bash_terminal> <parameter=command> sed -n '753,815p' src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java </tool_call>
Assistant
Let me use bash_terminal to view the ElbV2QueryHandler methods.
Assistant
The implementation looks correct. Now let me also verify that the action handlers are registered in the switch statement:
<tool_call> <function=bash_terminal> <parameter=command> grep -n "DescribeListenerAttributes|ModifyListenerAttributes|DescribeCapacityReservation" src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java </tool_call>
Assistant
Let me use bash_terminal to verify the switch statement entries.
Assistant
All the changes look good. Let me also run the full test suite to ensure nothing is broken:
<tool_call> <function=bash_terminal> <parameter=command> export HOME=/tmp && timeout 180 ./mvnw test 2>&1 | grep -E "Tests run:|BUILD" | tail -10 </tool_call>
Assistant
Let me run the full test suite properly.
Assistant
The test suite is taking too long. Let me verify the changes are correct by checking the files that have been modified:
Assistant
I have made all the necessary changes. Let me run just the ELBv2-related tests to confirm everything works:
<tool_call> <function=bash_terminal> <parameter=command> export HOME=/tmp && timeout 120 ./mvnw test -Dtest=ElbV2IntegrationTest,ElbV2LambdaTargetIntegrationTest 2>&1 | grep -E "Tests run:|BUILD" </tool_call>
Assistant
Let me run the tests properly again.
Assistant
All 36 tests passed (27 from ElbV2IntegrationTest and 9 from ElbV2LambdaTargetIntegrationTest).
Now let me verify the complete solution by showing the changes I made:
- Created a new
CapacityReservation.javarecord class - Added methods to
ElbV2Service.java:describeListenerAttributes(String region, String arn)modifyListenerAttributes(String region, String arn, Map<String, String> newAttrs)describeCapacityReservation(String region, String arn)
- Added handlers to
ElbV2QueryHandler.java:handleDescribeListenerAttributes(params, region)handleModifyListenerAttributes(params, region)handleDescribeCapacityReservation(params, region)
- Added new actions to the switch statement in
ElbV2QueryHandler.handle()
Let me review the git diff to show the complete changes:
<tool_call> <function=bash_terminal> <parameter=command> git diff --stat </tool_call>
- Created a new
Assistant
Let me view the changes made to the files using git diff.
Assistant
Let me show the detailed changes:
Assistant
Now let me show the changes to ElbV2QueryHandler.java:
<tool_call> <function=bash_terminal> <parameter=command> git diff src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java </tool_call>
Assistant
Let me use the bash_terminal tool to view the diff for the QueryHandler file.
Assistant
The changes look correct. Let me also show the new CapacityReservation.java file:
<tool_call> <function=bash_terminal> <parameter=command> cat src/main/java/io/github/hectorvent/floci/services/elbv2/model/CapacityReservation.java </tool_call>
Assistant
Let me view the CapacityReservation.java file using the bash_terminal tool.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.