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 for ELBv2 service. Let's first get an overview.
- Assistant
Let me explore the key files to understand the existing structure.
- Assistant
I can see the switch statement in the ElbV2QueryHandler. I notice there's no case for "DescribeListenerAttributes" or "DescribeCapacityReservation". Let me scroll down to see the rest of the switch statement and the existing handler methods. First, let me look at the ElbV2Service.java to understand the data model and existing attribute handling. Let's also check if there's already a Listener model and see what attributes it has. Let's open the ElbV2Service.java.
- Assistant
Let me look at the LoadBalancer model and Listener model to understand the structure and see if they have attributes fields.
- Assistant
Good - the
Listenermodel already has anattributesfield. Now let me look at the LoadBalancer model to see if it has a capacity reservation field. - Assistant
Now let me look at how existing attribute handlers work. Let me scroll through the QueryHandler to see existing implementations:
- Assistant
Let me search for existing attribute handler methods in the service:
- Assistant
Let me examine these service methods to understand the pattern:
- Assistant
Let me fix the sed command syntax.
- Assistant
Let me continue examining the target group attribute methods:
- Assistant
Let me look for the
requireListenermethod and the helper methods used in the query handler: - Assistant
Let me look at the requireListener method and the bottom of the service file:
- Assistant
Now let me look at the query handler's helper methods like voidResponse, parseTags, etc. Let me also check the existing tests to understand what the expected behavior should be. First, let me check the existing query handler more thoroughly:
- Assistant
Let me look at the full switch statement and the rest of the handler:
- Assistant
Now let me look at the
parseAttributesmethod and the target group attribute handlers: - Assistant
Let me look at the
parseAttributesmethod and also at theModifyTargetGroupAttributesandDescribeTargetGroupAttributeshandlers: - Assistant
Let me now look at the target group attributes handlers to understand the XML format:
- Assistant
Now I understand the pattern. I need to:
-
Add two new service methods in
ElbV2Service.java:describeListenerAttributes(String region, String arn)- returns the listener's attributes mapmodifyListenerAttributes(String region, String arn, Map<String, String> newAttrs)- merges new attributes
-
Add three new handler methods in
ElbV2QueryHandler.java:handleDescribeListenerAttributeshandleModifyListenerAttributeshandleDescribeCapacityReservation
-
Add the new cases to the switch statement in the
handlemethod. -
For
DescribeCapacityReservation, I need to add aCapacityReservationmodel class (or use a simple approach).
Let me also check what the existing tests look like to understand what I should test:
-
- Assistant
Let me check the rest of the test file to see if there are any existing tests for attributes:
- Assistant
Now I have a good understanding of the codebase. Let me implement the changes. I need to:
- Add
describeListenerAttributesandmodifyListenerAttributesservice methods (following the same pattern as load balancer/target group attributes) - Add
describeCapacityReservationservice method (with aCapacityReservationrecord) - Add handler methods in ElbV2QueryHandler for
DescribeListenerAttributes,ModifyListenerAttributes, andDescribeCapacityReservation - Wire them into the switch statement
Let me start with the service. First, let me see the end of the service file:
- Add
- Assistant
Now I have a clear picture of the codebase. Let me implement the changes step by step.
First, let me add the service methods to
ElbV2Service.java: - Assistant
Let me use the
editcommand to add the service methods. Let me first add the listener attributes methods: - Assistant
The service file has been updated. Now I need to add the handler methods and the switch cases in the QueryHandler. Let me first add the switch cases, then add the handler methods.
First, let me add the switch cases for the new actions. I'll add them to the Listeners section:
- Assistant
I see there's a duplicate "// Listeners" comment on line 83. Let me fix that and also add the
DescribeCapacityReservationcase. Let me first fix the duplicate comment: - Assistant
I see lines 82 and 83 are both "// Listeners" still. Let me remove the duplicate:
- Assistant
Good, the duplicate comment is removed. Now I need to add the
DescribeCapacityReservationcase. Let me add it near the load balancer section since it's a load balancer operation: - Assistant
Now I need to add the handler methods. Let me find where to add them. Let me look for where to insert the new listener attribute handlers (after existing listener handlers):
- Assistant
Let me find the end of the load balancer handlers section:
- Assistant
Now let me add the three handler methods. I'll add
handleDescribeListenerAttributesandhandleModifyListenerAttributesafterhandleModifyListener(line 466), andhandleDescribeCapacityReservationafter thehandleSetIpAddressTypemethod (around line 252). Let me first add the listener attribute handlers: - Assistant
I see the closing brace of
handleModifyListenerwas consumed. Let me check and fix: - Assistant
I see the issue - the closing brace
}ofhandleModifyListeneris missing. Let me fix this: - Assistant
Good. Now I need to add the
handleDescribeCapacityReservationmethod. Let me find wherehandleSetIpAddressTypeends and add it there: - Assistant
Let me look at the area around line 250-256:
- Assistant
Now I'll add the
handleDescribeCapacityReservationmethod right before the Target Groups section: - Assistant
I notice there's a missing blank line between
handleSetIpAddressTypeandhandleDescribeCapacityReservation. Let me add a blank line: - Assistant
Now let me verify the XmlBuilder API to make sure I'm using it correctly. Let me check the
elemmethod signature: - Assistant
Let me check the XmlBuilder class to understand the API:
- Assistant
Good, the XmlBuilder API looks correct. The
elemmethod takes two String arguments (name, value) and it skips the element when value is null. This is exactly what I need for the capacity reservation where null fields should not be rendered.Now let me also check if there's an
intoverload for elem since I'm using.toString()on integers: - Assistant
Good. Now let me try to compile the project to verify the changes compile correctly:
- Assistant
Let me try with
mvninstead or check what build tool is available: - Assistant
Let me try using mvn directly to compile:
- Assistant
The code compiles. Now let me run the existing tests to make sure I haven't broken anything:
- Assistant
All 27 existing tests pass. Let me also run the other ELBv2 test:
- Assistant
All tests pass. Let me also check if there are compatibility tests that test ELBv2:
- Assistant
The compatibility tests are in a separate directory and likely require a running server. Let me now verify the changes look correct by reviewing both files:
- Assistant
Let me review the actual diff:
- Assistant
The diff looks clean and correct. Let me verify the changes are complete by reviewing what was asked for:
- ✅
DescribeListenerAttributes- added to switch, handler, and service method - ✅
ModifyListenerAttributes- added to switch, handler, and service method - ✅
DescribeCapacityReservation- added to switch, handler, service method, and CapacityReservation record
The existing
Listenermodel already has anattributesmap field (line 23 of Listener.java), so the data model is ready.Let me also verify there's no issue with the
ISO_FMTfield being accessible in the handler: - ✅
- Assistant
Good, the
ISO_FMTfield is accessible and used elsewhere in the handler. Now let me run all ELBv2 tests one more time to confirm everything passes: - Assistant
All 36 tests pass. Let me now do a final review 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.