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
I'll start by exploring the repository structure to understand the codebase and locate the relevant files. Let's first check the current directory and list files.
- Assistant
Let me explore the elbv2 service directory to understand the structure.
- Assistant
Let me examine the key files to understand the current implementation.
- Assistant
Let me continue reading the file to see the rest of the handler and understand the pattern for handling actions.
- Assistant
Let me continue reading to see the attribute handling patterns and understand how they're implemented.
- Assistant
Now let me look at the ElbV2Service to understand the existing patterns:
- Assistant
Let me continue reading to see how load balancer attributes are handled:
- Assistant
Let me check the LoadBalancer model to understand how attributes are stored:
- Assistant
Now let me check the Listener model:
- Assistant
Good, I can see that Listener already has an attributes map. Now let me check the test file to understand the patterns:
- Assistant
Let me look at how listener creation works in the service to understand where to initialize attributes:
- Assistant
Let me look at the createListener and requireListener methods in the service:
- Assistant
Let me also look at the requireListener method:
- Assistant
Now let me see the target group attribute handlers in the query handler:
- Assistant
Let me check the parseAttributes method and the end of the service file:
- Assistant
Let me see the parseAttributes method:
- Assistant
Let me check the voidResponse and xmlError helpers:
- Assistant
Now I have a clear picture of the codebase. Let me plan and implement the changes:
- Add
describeListenerAttributesandmodifyListenerAttributesmethods toElbV2Service.java - Add
describeCapacityReservationmethod toElbV2Service.java - Add handler methods and switch cases to
ElbV2QueryHandler.java
Let me start with the service:
- Add
- Assistant
Now I'll implement the changes. Let me first add the CapacityReservation record and then modify the service and handler files. Let me create the CapacityReservation record:
- Assistant
I need to create a CapacityReservation record in the model package. Let me create it.
- Assistant
Now let me edit it to create the record:
- Assistant
Now let me add the listener attributes methods to ElbV2Service.java. I'll add them after the modifyListener method (around line 398):
- Assistant
I'll add the describeListenerAttributes and modifyListenerAttributes methods after line 399. Let me insert them.
- Assistant
Good, I've added the listener attributes methods. Now I need to add the describeCapacityReservation method. Let me add it after the load balancer attributes methods. Let me find where the load balancer section ends.
- Assistant
I need to add
describeCapacityReservationin the Load Balancer section, aftermodifyLoadBalancerAttributesand beforesetSecurityGroups. Let me add it: - Assistant
Now let me add
describeCapacityReservationaftermodifyLoadBalancerAttributesand beforesetSecurityGroups: - Assistant
Good, the service methods are in place. Now I need to add the CapacityReservation import to the service file. Let me check if it's already imported.
- Assistant
Good, the import
io.github.hectorvent.floci.services.elbv2.model.*already covers all classes in the model package. Now I need to update the ElbV2QueryHandler.java to add the three new actions. Let me add the switch cases and handler methods. - Assistant
Now I'll add the new switch cases. First, let me add
DescribeListenerAttributesandModifyListenerAttributesafterModifyListener: - Assistant
Now let me add
DescribeCapacityReservationunder the Load Balancers section. Let me add it afterSetIpAddressType: - Assistant
Now I need to add the handler methods for the three new actions. Let me find where the listener section ends:
- Assistant
Let me look at the handleModifyListener method and the area where I need to add the new handler methods:
- Assistant
Now I'll add the three new handler methods after
handleModifyListenerand before// ── Rules. Let me add them: - Assistant
Good, I've added the listener attribute handlers. Now I need to add the
handleDescribeCapacityReservationmethod. Let me find where to add it in the load balancer section: - Assistant
Let me look at the handleSetIpAddressType method to find where to insert the new method:
- Assistant
Now let me add the
handleDescribeCapacityReservationmethod afterhandleSetIpAddressTypeand before the Target Groups section: - Assistant
Good, I've added all three handler methods. Now I need to check if I need to add the
CapacityReservationimport to the handler file. Let me check the imports: - Assistant
Good - the import
io.github.hectorvent.floci.services.elbv2.model.*already coversCapacityReservation. Let me verify the code compiles and the existing tests pass. - Assistant
Good, compilation succeeded. Now let me run the existing tests.
- Assistant
All 27 existing tests pass. Let me also run the lambda target integration test:
- Assistant
All tests pass. Let me also run the full test suite to make sure nothing else is broken:
- Assistant
The full test suite is taking too long. The ELBv2-specific tests all pass (27 + 9 = 36 tests). Let me verify my changes by reviewing them:
- Assistant
Let me check the new CapacityReservation file too:
- Assistant
Let me review the diff to make sure everything looks correct:
- Assistant
Let me also verify the CapacityReservation record file:
- Assistant
Let me clean up the formatting - there should be blank lines between the new methods and the surrounding sections:
- Assistant
Let me fix the formatting by adding a blank line between
describeCapacityReservationandsetSecurityGroups: - Assistant
Now let me also fix the formatting in the handler file. Let me check the area after
handleModifyListenerAttributes: - Assistant
Let me fix the missing blank line between
handleModifyListenerAttributesand the Rules comment: - Assistant
Now let me also fix the same issue in the service file:
- Assistant
Let me fix the formatting in the service file too - add a blank line between modifyListenerAttributes and the Rules comment.
- Assistant
Let me fix the missing blank line between
modifyListenerAttributesand the Rules comment in the service file: - Assistant
Good. Now let me run the tests again to make sure everything still works after the formatting fixes.
- Assistant
Good. Now let me write a quick test script to verify the fix actually resolves the issue:
- Assistant
Let me also run the lambda target integration test to be thorough:
- Assistant
All tests pass. Let me now review the final diff to make sure everything is clean:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.