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.
Assistant
Now the query handler.
Assistant
Now let me add the service methods.
Assistant
Now the query handler switch cases and handlers.
Assistant
Now insert the capacity reservation handler at line 251.
Assistant
Now add the switch cases.
Assistant
Now update the routing set in
AwsQueryController.Assistant
Now let's build and test.
Assistant
Checklist review:
- Reproduced the reported error: Yes — before the fix,
ElbV2QueryHandler's action switch had no cases forDescribeListenerAttributes/DescribeCapacityReservation, so both fell through to thedefault -> xmlError("UnsupportedOperation", ...)branch (and they were also absent fromELB_V2_ACTIONSused for header-less routing). I confirmed this by inspecting the dispatch path and by writing a temporary Quarkus integration test that exercised these actions over the Query protocol. - Confirmed the fix resolves the error: Yes — with a temporary test (
TmpNewActionsTest, deleted afterwards) all 6 scenarios passed:DescribeListenerAttributesreturns an emptyAttributeslist by default,ModifyListenerAttributesechoes/merges the key-value pairs and a subsequent describe returns them, andDescribeCapacityReservationreturns HTTP 200 withDescribeCapacityReservationResult(empty reservation state) instead ofUnsupportedOperation. - Edge cases: Unknown listener ARN →
ListenerNotFound(400); unknown load-balancer ARN →LoadBalancerNotFound(400) — both verified.modifyListenerAttributesis null-safe on the incoming map and merges (does not replace) existing attributes;describeListenerAttributesreturns a defensive copy.DescribeCapacityReservationomitsLastModifiedTime/DecreaseRequestsRemaining/MinimumLoadBalancerCapacitywhen null (AWS-faithful for "no reservation") while still emitting an emptyCapacityReservationStatelist so SDK unmarshallers get an empty list rather than a missing member. Routing was also added toAwsQueryController.ELB_V2_ACTIONSso requests without anAuthorizationheader resolve to ELBv2. - Ran existing tests: Yes —
ElbV2IntegrationTest(27) andElbV2LambdaTargetIntegrationTest(9) pass, plus the other ELBv2-dependent suites (EcsLoadBalancerRegistrarTest,ApiGatewayProxyMatchTest,ApiGatewayV2AlbIntegrationTest, 30 tests) all pass; the project compiles cleanly. No existing tests were modified or added.
I also updated
docs/services/elb.mdandCHANGELOG.mdto document the three new actions.- Reproduced the reported error: Yes — before the fix,
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 →