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 locate the relevant files.
- Assistant
Let me examine the key files mentioned in the issue: ElbV2Service.java, ElbV2QueryHandler.java, and the Listener model.
- Assistant
Let me examine the Listener model and understand how attributes are handled for load balancers and target groups to understand the pattern.
- Assistant
Now let me look at how load balancer and target group attributes are handled (to understand the pattern) in ElbV2Service.java:
- Assistant
Let me examine the LoadBalancer model to see what fields it already has:
- Assistant
Now let me examine the ElbV2QueryHandler to see how actions are dispatched:
- Assistant
I need to see more of the handler file to understand the pattern for the
describeLoadBalancerAttributeshandler. - Assistant
Let me see more of the file to understand the pattern for
DescribeLoadBalancerAttributesandDescribeTargetGroupAttributes. - Assistant
Let me continue scrolling down to see the describeTargetGroupAttributes handler.
- Assistant
Now I have a good understanding of the pattern. Let me check the parseAttributes method and the remaining parts of the handler to see where I need to add the new methods. Let me search for the parseAttributes method:
- Assistant
Now I need to understand the complete picture:
-
ElbV2Service.java - needs:
describeListenerAttributes(region, arn)- return a copy of the listener's attributes mapmodifyListenerAttributes(region, arn, newAttrs)- merge provided key-value pairs into the listener's existing attributesCapacityReservationrecord (or class)describeCapacityReservation(region, arn)- validate the load balancer and return its capacity-reservation state
-
ElbV2QueryHandler.java - needs:
DescribeListenerAttributesaction handlerModifyListenerAttributesaction handlerDescribeCapacityReservationaction handler
-
LoadBalancer.java - may need a capacity reservation field (or we can return default/empty values)
Let me check the existing code more thoroughly to understand the pattern better. Let me also look at how the listener is found/looked up in the service.
-
- Assistant
Let me see the full ElbV2Service to understand the complete structure:
- Assistant
I've now seen the full ElbV2Service.java. Let me also see the end of the handler file to understand the full structure:
- Assistant
Now let me look at the XML serialization helpers and the tail of the handler file:
- Assistant
Let me look at the parseAttributes method and the rest of the handler file:
- Assistant
Let me see the rest of the file.
- Assistant
Let me see the rest of the file.
- Assistant
Let me see the last few lines of the file.
- Assistant
Now let me check the existing tests to understand the testing patterns:
- Assistant
Now I have a complete understanding of the codebase. Let me plan the implementation:
-
ElbV2Service.java:
- Add
describeListenerAttributes(String region, String arn)- returns copy of listener's attributes - Add
modifyListenerAttributes(String region, String arn, Map<String, String> newAttrs)- merges new attrs - Add
describeCapacityReservation(String region, String arn)- validates LB, returns capacity reservation state
- Add
-
ElbV2QueryHandler.java:
- Add switch cases for
DescribeListenerAttributes,ModifyListenerAttributes,DescribeCapacityReservation - Add handler methods for each
- Add switch cases for
-
LoadBalancer.java: The capacity reservation will be returned as null/empty fields since no capacity is reserved by default
Let me start with ElbV2Service.java - adding the three new methods after the existing listener certificate methods:
-
- Assistant
Let me find the listener certificate methods section:
- Assistant
Let me look at the area around the listener certificate methods:
- Assistant
Now I have a complete understanding of the codebase. Let me implement the changes. First, I'll add the methods to ElbV2Service.java. I'll insert them after the listener certificate methods (after line 636):
- Assistant
I see there's a duplicate
describeListenerCertificatesmethod. Let me fix that by removing the duplicate: - Assistant
I see there's a duplicate comment line. Let me fix that:
- Assistant
Let me add a blank line before the Helpers section for consistency:
- Assistant
I see there's an extra closing brace
}on line 661. Let me fix that: - Assistant
The extra
}is still there. Let me remove it: - Assistant
The file got messed up with duplicate lines. Let me reset the file and start over with clean edits.
- Assistant
Good, let me verify the file is back to its original state:
- Assistant
Good, the file is back to its original state. Now let me make the edit carefully, adding the new methods after line 636 (after the
describeListenerCertificatesmethod): - Assistant
Now let me insert the new methods between lines 636 and 638:
- Assistant
The edit command is creating duplicates. Let me reset and use a different approach:
- Assistant
Let me use
sedto insert the new methods after line 636: - Assistant
Now I know exactly where to insert. I need to insert after line 636 (the
}closingdescribeListenerCertificates) and before line 638 (the// ── Helperscomment). Let me use a sed command to insert the new code. - Assistant
Let me verify the insertion:
- Assistant
The ElbV2Service.java changes look correct. Now I need to update the ElbV2QueryHandler.java to add the new action handlers.
Let me first add the switch cases in the
handlemethod. I need to add them in the Listeners section: - Assistant
Now I need to add the three new cases in the switch statement. Let me add them in the appropriate sections:
- Assistant
Now let me add the DescribeCapacityReservation case. Let me check the current state of the switch:
- Assistant
Good. Now I need to add the DescribeCapacityReservation case. Let me add it after SetIpAddressType (which is now on a different line). Let me find the current line number:
- Assistant
Now let me add the DescribeCapacityReservation case after line 74:
- Assistant
Let me verify the switch statement looks correct now:
- Assistant
The switch statement looks correct. Now I need to add the handler methods. Let me find where to insert them. Let me first look at where handleModifyListener ends:
- Assistant
Let me see the area around handleModifyListener and handleCreateRule to find where to insert the new methods:
- Assistant
I need to add:
handleDescribeListenerAttributesandhandleModifyListenerAttributesmethods afterhandleModifyListener(before the "// ── Rules" section)handleDescribeCapacityReservationmethod afterhandleSetIpAddressType(before the "// ── Target Groups" section)
Let me find the exact line numbers:
- Assistant
Let me look at the area between handleSetIpAddressType and the Target Groups section:
- Assistant
Now I have the exact positions. Let me add the handler methods. First, I'll add
handleDescribeCapacityReservationafter line 253 (end of handleSetIpAddressType): - Assistant
Now let me add the listener attribute handlers. First, let me find the new line number of handleModifyListener:
- Assistant
Let me see what's on line 492:
- Assistant
Now let me add the listener attribute handlers after line 491 (end of handleModifyListener):
- Assistant
Good. Let me verify all the changes are correct by looking at the complete switch statement and the new handler methods:
- Assistant
Good. The switch statement looks correct. Let me verify the handler methods are correct by looking at them:
- Assistant
Let me verify the listener attribute handlers:
- Assistant
All the changes look correct. Let me verify the complete ElbV2Service.java changes:
- Assistant
Now let me run the existing tests to make sure the changes compile and pass:
- Assistant
Good, it's a Maven project. Let me run the tests.
- Assistant
Compilation succeeded. Let me run the tests:
- Assistant
The tests timed out. Let me try running just the ELBv2 tests instead:
- Assistant
Let me check the test results more explicitly:
- Assistant
All 27 tests pass. Let me also run the other ELBv2 test:
- Assistant
All tests pass. Let me now verify the changes by looking at the git diff:
- Assistant
Let me also check the full diff to make sure everything looks correct:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.