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, andDescribeCapacityReservation(mirroring the existing load balancer / target group attribute handlers) will reference this issue.Interface
Type: Function Name: describeListenerAttributes Path: src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java Input: region: String, arn: String Output: Map<String, String> Description: Returns a copy of the attributes map for the listener identified by the given ARN.
Type: Function Name: modifyListenerAttributes Path: src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java Input: region: String, arn: String, newAttrs: Map<String, String> Output: void Description: Merges the provided key-value pairs into the listener's existing attributes.
Type: Record Name: CapacityReservation Path: src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java Public API: CapacityReservation(Integer decreaseRequestsRemaining, Integer minimumCapacityUnits, Instant lastModifiedTime) Description: Stable representation of load-balancer capacity-reservation state. Floci returns null fields when no capacity is reserved.
Type: Function Name: describeCapacityReservation Path: src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2Service.java Input: region: String, arn: String Output: CapacityReservation Description: Validates the load balancer and returns its capacity-reservation state.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /floci, current file: none) bash-$
- Assistant
I'll start by exploring the repository structure to understand the codebase and locate the relevant files for ELBv2. First, let's check the current directory and see what's available.
- Assistant
Let me explore the repository structure to understand the codebase and then look at the specific files mentioned in the issue.
- Assistant
Let me first look at the main service file and the query handler to understand the current structure.
- Assistant
Now let me look at the query handler to see how actions are dispatched:
- Assistant
Now let me look at the Listener model to see if it has an attributes map:
- Assistant
Now let me look at the LoadBalancer model to see if it has capacity reservation:
- Assistant
Let me check the existing target group attribute handlers to understand the pattern:
- Assistant
Let me look at the full handler code for target group attributes:
- Assistant
Now I understand the codebase. Let me plan my changes:
- Add
describeListenerAttributesandmodifyListenerAttributesmethods toElbV2Service.java - Add
describeCapacityReservationmethod toElbV2Service.java(with a capacity reservation state concept on the LoadBalancer) - Add corresponding handler cases in
ElbV2QueryHandler.javaforDescribeListenerAttributes,ModifyListenerAttributes, andDescribeCapacityReservation
Let me look at the existing tests to understand the test patterns:
- Add
- Assistant
Let me look at the Listener creation in the service:
- Assistant
Let me see the createListener method to understand how attributes are initialized.
- Assistant
Now let me look at the AGENT.md file for conventions and also check how existing attribute handlers work for listeners:
- Assistant
Let me check the existing tests to see if there are any tests related to listener attributes or capacity reservation:
- Assistant
Let me also look at the full test file:
- Assistant
Now I have a complete understanding of the codebase. Let me implement the changes:
- Add
describeListenerAttributes,modifyListenerAttributes, anddescribeCapacityReservationmethods toElbV2Service.java - Add
DescribeListenerAttributes,ModifyListenerAttributes, andDescribeCapacityReservationhandler cases inElbV2QueryHandler.java
Let me start implementing. First, I'll add the service methods:
- Add
- Assistant
Let me look at the area around the listener certificates to find a good place to add the listener attributes methods:
- Assistant
Let me look at the listener section and the listener certificates section to understand where to add the new methods:
- Assistant
Now I have a clear picture. Let me implement the changes:
- Add
describeListenerAttributesandmodifyListenerAttributestoElbV2Service.java - Add
describeCapacityReservationtoElbV2Service.java(with a simple capacity reservation model) - Add corresponding handler methods in
ElbV2QueryHandler.java
Let me start with the service changes. I'll add the listener attributes methods after the listener certificates section:
- Add
- Assistant
Let me use the edit command directly:
- Assistant
Now let me add the new methods to
ElbV2Service.java. I'll add them after the listener certificates section (line 636): - Assistant
Now let me add the handler cases in
ElbV2QueryHandler.java. First, let me find where to add them: - Assistant
Let me add the new cases to the switch statement. I'll add
DescribeListenerAttributesandModifyListenerAttributesafterModifyListener, andDescribeCapacityReservationunder Load Balancers: - Assistant
Now add
DescribeCapacityReservationunder Load Balancers: - Assistant
Now I need to add the handler methods. Let me find where the Load Balancer handlers end and the Target Group section begins:
- Assistant
Let me add the
handleDescribeCapacityReservationmethod before the Target Groups section. - Assistant
Now let me add the handler methods. I'll add
handleDescribeCapacityReservationafterhandleSetIpAddressType(line 252) and before the Target Groups section. - Assistant
Now I need to add the
handleDescribeListenerAttributesandhandleModifyListenerAttributesmethods. Let me find where the Listener handlers are: - Assistant
Let me look at the area after
handleModifyListener: - Assistant
Now add the listener attributes handler methods after
handleModifyListenerand before the Rules section: - Assistant
I notice there's an extra
}on line 491. Let me check and fix that: - Assistant
There's an extra closing brace on line 491. Let me remove it:
- Assistant
Now let me verify the changes compile correctly. Let me run a quick build check:
- Assistant
Let me set the HOME variable first:
- Assistant
Great, compilation passed. Now let me run the existing tests:
- Assistant
The output doesn't show test results. Let me check more:
- Assistant
All 27 existing tests pass. Let me also run the Lambda target test and any other tests:
- Assistant
All tests pass. Now let me write a quick test script to verify the new functionality works:
- Assistant
Let me write a proper integration test as a temporary script (since we can't modify existing tests):
- Assistant
Now let me copy the test file to the test directory and run it:
- Assistant
All 9 new tests pass. Let me clean up the temporary test file since we shouldn't add tests to the repository:
- Assistant
Now let me verify that all the original tests still pass:
- Assistant
All 36 existing tests pass. Let me also run the compatibility test:
- Assistant
The compatibility tests seem to be failing because they need a running server. Let me check if these were already failing before my changes:
- Assistant
Good, the existing tests pass without my changes too. The compatibility tests likely need a running server. Let me restore my changes.
- Assistant
Let me verify the final state of my changes:
- Assistant
Let me view the full diff to review the changes:
- Assistant
The diff looks clean. Let me run the full test suite one more time to ensure everything passes:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →