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
Let me start by exploring the repository structure to understand the codebase and then figure out how to implement the missing ELBv2 actions:
DescribeListenerAttributes,ModifyListenerAttributes, andDescribeCapacityReservation.Let me first explore the repository structure.
Assistant
Let me examine the ELBv2 service files to understand the current implementation and where I need to add the new actions.
Assistant
Now let me look at the
ElbV2QueryHandler.javato see how actions are handled:Assistant
Now let me look at the model classes to understand the data structures:
Assistant
Good. The
Listenermodel already has anattributesmap. Now I need to understand the fullElbV2QueryHandler.javato see the pattern for handling listener-related actions. Let me scroll through the handler:Assistant
Now let me see the full listener section in the handler and the service to understand how listener creation/modification works:
Assistant
Now let me check the
createListenermethod in the service and see how listener attributes work:Assistant
Now I have a good understanding of the codebase. Let me look at the existing tests to understand the testing patterns:
Assistant
Now let me see what tests exist for listener attributes and check more of the test file:
Assistant
Now I have a clear understanding of the codebase. Let me plan my implementation:
-
In
ElbV2Service.java: Add the following methods:describeListenerAttributes(String region, String arn)- Returns a copy of the listener's attributes mapmodifyListenerAttributes(String region, String arn, Map<String, String> newAttrs)- Merges attributes into listenerdescribeCapacityReservation(String region, String arn)- Returns capacity reservation state for a load balancer (null fields when no capacity reserved)- Also add a
CapacityReservationinner record/class
-
In
ElbV2QueryHandler.java: Add handler methods:handleDescribeListenerAttributeshandleModifyListenerAttributeshandleDescribeCapacityReservation- Register these in the switch statement
Let me also add capacity reservation state tracking to the
LoadBalancermodel.Let me first add the service methods:
-
Assistant
Now let me add the service methods. I'll add them after the
modifyLoadBalancerAttributesmethod and also add theCapacityReservationrecord:Assistant
Now I'll add the
CapacityReservationrecord and the three new methods toElbV2Service.java. I'll insert them before the "Target Groups" section:Assistant
I made an error with the edit command - I didn't provide the correct syntax. Let me use the replace command instead.
Assistant
I need to use the
editcommand properly. Let me first open the file and then use edit:Assistant
I need to use the correct format for the open command. Let me try a different approach.
Assistant
Good, I have the file open. Now I need to insert the new methods after line 161 (after
setIpAddressType) and before line 163 (the Target Groups comment). Let me use theeditcommand:Assistant
I need to fix the missing blank line between the new methods and the Target Groups section:
Assistant
The service methods are now added. Now I need to update the
ElbV2QueryHandler.javato add the handler methods and register them in the switch statement. Let me look at the switch statement in the handler:Assistant
I need to add the three new action handlers to the switch statement. I'll add them after the existing "Listener certs" section:
Assistant
I accidentally edited the wrong file. Let me revert the changes and fix this properly:
Assistant
Let me first fix the
ElbV2Service.javaproperly. I need to be more careful with the edit. Let me check the exact line numbers:Assistant
I'll use the
replacecommand to be more precise. Let me replace the text that includes thesetIpAddressTypemethod and the Target Groups comment:Assistant
The
ElbV2Service.javais updated correctly. Now I need to updateElbV2QueryHandler.javato add the handler methods and register them in the switch statement. Let me first add the cases to the switch:Assistant
Let me open the handler file and navigate to the right location:
Assistant
Now I can see the exact content. Let me use the edit command to replace lines 107-109:
Assistant
Good, the switch cases are added. Now I need to add the handler methods. Let me find a good location to add them - I'll add them after the existing listener certificates handlers:
Assistant
I need to add the three handler methods after the
handleDescribeListenerCertificatesmethod and before the// ── XML builderscomment. Let me insert them:Assistant
I notice there's a missing closing brace for the
handleDescribeListenerCertificatesmethod. Line 753 showsreturn Response.ok(xml.build()).type(MediaType.APPLICATION_XML).build();followed by the new methods without the closing brace. Let me fix this:Assistant
Good, now I need to add the helper methods
safeIntandsafeInstantthat I referenced in thehandleDescribeCapacityReservationmethod. Let me check if these already exist in the file:Assistant
I need to add the
safeIntandsafeInstanthelper methods. Let me find where the existing helper methods are:Assistant
I'll add
safeIntandsafeInstanthelper methods afterparseBoolOrNull:Assistant
I see there's a duplicate
parseBoolOrNullmethod. Let me fix this:Assistant
Now I need to add the import for
java.time.Instantto theElbV2QueryHandler.javafile. Let me check what imports already exist:Assistant
I need to add
java.time.Instantimport:Assistant
Now let me compile the code to check for any errors:
Assistant
The code compiles successfully. Now let me run the existing ELBv2 tests to make sure I didn't break anything:
Assistant
The tests passed. Let me also verify by checking the test result:
Assistant
All 27 tests pass. Now let me verify the changes I made are correct by reviewing the diff:
Assistant
The changes look correct. Now let me create a simple test script to verify the new actions work as expected:
Assistant
The test for
describeCapacityReservationhas an issue with the RestAssured path. Let me fix the test and run it again:Assistant
All 9 new tests pass. Now let me remove the test file I created (since I should not modify tests):
Assistant
Now let me run the existing ELBv2 tests one more time to make sure everything still works:
Assistant
All 36 tests pass. Let me verify the final state of my changes:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.