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
The file is truncated. Let me see the rest of the file by scrolling through it.
Assistant
Let me look at the LoadBalancer model to understand its structure
Assistant
Now let me look at the rest of ElbV2QueryHandler. Let me see the load balancer XML and target group attribute code:
Assistant
Now let me look at the listenerXml helper to understand the XML format and find how attributes are rendered for the LB
Assistant
Now let me check the existing tests to understand the testing setup:
Assistant
Let me see the rest of ElbV2QueryHandler.java, focusing on the listener portion:
Assistant
I have a clear understanding. Let me also look at how the
AwsExceptionworks and confirm the AWS response format expected forDescribeCapacityReservation:Assistant
Let me now reproduce the issue first to confirm the error:
Assistant
- both actions are missing. Let me also look at the TargetGroup model to compare its attribute structure:
Assistant
Now I have a complete understanding. Let me start implementing the changes.
Step 1: Create the
CapacityReservationmodel class:Assistant
Step 2: Add
describeListenerAttributes,modifyListenerAttributesanddescribeCapacityReservationmethods toElbV2Service.java:Assistant
Let me find the right location for inserting the new methods. I'll look at the file structure to understand where to add them:
Assistant
Now let me add the new methods to ElbV2Service.java. I'll add them just before the Rules section:
Assistant
wildcard import covers
CapacityReservation. Now let me updateElbV2QueryHandler.javato add the new actions. First, let me see the current switch statement:Assistant
Now let me add the new actions to the switch and add the corresponding handler methods. First, let me update the switch statement:
Assistant
Now let me add the
DescribeCapacityReservationcase to the switch. I'll put it next to other LB-related actions:Assistant
Now let me add the handler methods. Let me find the right spot to add the
handleDescribeCapacityReservationmethod (after the LB section), and thehandleDescribeListenerAttributes/handleModifyListenerAttributesmethods (after the listener section).Assistant
I made a mistake - the edit duplicated the
handleSetIpAddressTypemethod. Let me revert and fix this:Assistant
me revert the ElbV2QueryHandler.java file to a clean state and reapply the edits properly:
Assistant
Let me re-apply the changes more carefully. First add the new switch cases:
Assistant
Good. Now let me add the listener attribute cases:
Assistant
Now let me find the
handleSetIpAddressTypemethod end and add thehandleDescribeCapacityReservationright after it:Assistant
Now let me find where to add the listener attribute handlers. Let me look at the listener section:
Assistant
a small issue - I have an extra
.end("ModifyListenerResponse").build();lines left over. Let me fix it:Assistant
still an extra
}on line 491. Let me fix it:Assistant
let me check the file compiles by running mvn:
Assistant
Hmm, the build says "Nothing to compile - all classes are up to date." Let me force a clean rebuild
Assistant
Build successful. Now let me write a test script to verify the fix works. First let me look at how to run the existing integration test:
Assistant
me run the existing ELBv2 integration tests to make sure nothing is broken:
Assistant
All 27 existing tests pass. Now let me write a quick reproduction test to verify my fix works for the new actions:
Assistant
The actual functionality works correctly! The only "failure" is a bad assertion in my test - the response has a single member, not a collection. Let me fix that:
Assistant
All 7 tests pass. Let me also see the actual response output to verify it looks correct:
Assistant
! All response formats look correct. Now let me clean up my temporary test file and verify the existing tests still pass:
Assistant
Now let me run all the ELBv2 tests to make sure nothing is broken:
Assistant
All 36 ELBv2 tests pass. Let me also verify by reproducing the original issue scenario more thoroughly. Let me look at the final changes I made:
Assistant
also see the new
CapacityReservation.java:Assistant
Let me look at the final structure of the listener methods area in the query handler to make sure formatting is OK:Let me see the relevant section of ElbV2QueryHandler.java once more to ensure formatting is correct:]<]minimax[>[<tool_call> ]<]minimax[>[]<]minimax[>[sed -n '465,530p' src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2QueryHandler.java]<]minimax[>[]<]minimax[>[ ]<]minimax[>[</tool_call>
Assistant
Let me retry the bash
Assistant
me fix the small formatting issue (missing blank line between methods):
Assistant
Now the formatting looks clean. Let me run the tests one more time to ensure everything still passes:
Assistant
All 36 tests pass. Let me also do a quick smoke test on a wider test set to make sure nothing else broke:
Assistant
Let me do one final review of all changes by viewing the diffs:
Assistant
me make sure my temporary test file is fully removed and the test classes I deleted from
targetare clean:Assistant
Temporary test file is fully removed. Let me now do a final summary of the changes:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.