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:
codeapi 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
bash# 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. Assistant
I'll start by exploring the repository structure to understand the codebase and find the relevant files mentioned in the issue.
Assistant
I'll explore the repository structure first.
Assistant
Let me explore the ELBv2 service files.
Assistant
Let me look at the main service file and the query handler to understand the structure.
Assistant
Let me see the middle section of the service file that was truncated.
Assistant
Now let me look at the model files for Listener and LoadBalancer.
Assistant
Both models already have an
attributesmap. Now let me look at the ElbV2QueryHandler to understand the action switch.Assistant
Let me see the listener handlers and the existing attribute handlers in detail.
Assistant
Let me look at the existing target group attribute handlers and the listener XML builder.
Assistant
I need to make single tool calls. Let me look at the relevant sections.
Assistant
Now let me look at the listenerXml and loadBalancerXml builders, and the rest of the handler file.
Assistant
Now let me look at the target group attribute methods in the service file, and check how the AWS real API structures these responses.
Assistant
Now let me look at the integration tests to understand the test patterns.
Assistant
Let me see the rest of the test file to understand the listener tests.
Assistant
Let me look at the XmlBuilder class to understand how it handles null values.
Assistant
Now I have a clear understanding. Let me check the AwsNamespaces for the ELB_V2 namespace constant.
Assistant
Now let me look at the listener section in the service file to find where to add the new methods.
Assistant
Now I have a complete understanding of the codebase. Let me implement the changes.
First, let me add the service methods to
ElbV2Service.java. I'll add the listener attribute methods aftermodifyListener(after the// ── Rules ──comment).Assistant
Now let me add the listener attribute methods. I'll use the
editcommand to insert methods before the Rules section.Assistant
Now let me add the listener attribute methods after
modifyListener(line 399) and before the Rules section:Assistant
I see a duplicate
// ── Rules ──comment. Let me fix that:Assistant
Now let me add the
CapacityReservationrecord anddescribeCapacityReservationmethod. I'll add the describeCapacityReservation method right after the load balancer attribute methods, and add the CapacityReservation record as a public static nested record. Let me find a good location for the capacity reservation method - aftersetIpAddressType:Assistant
Now let me add the
describeCapacityReservationmethod aftersetIpAddressType(line 161):Assistant
I see a duplicate line
lb.setIpAddressType(ipAddressType);at lines 160 and 161. Let me fix that:Assistant
Now I need to add the
CapacityReservationrecord. Let me add it as a public static nested record inside the ElbV2Service class, near the end of the file before the closing brace.Assistant
Now let me add the
CapacityReservationrecord just before the closing brace of the class (line 815):Assistant
The service file changes are complete. Now let me add the query handler cases and methods. First, let me add the action cases in the switch statement:
Assistant
Now let me add the new action cases. I'll add
DescribeListenerAttributesandModifyListenerAttributesafterModifyListener, andDescribeCapacityReservationin the load balancer section:Assistant
I see a duplicate
// Listenerscomment. Let me fix that and also add theDescribeCapacityReservationcase in the load balancer section:Assistant
I notice that the
case "CreateListener"line was lost. Let me check the listeners section:Assistant
I see the
case "CreateListener"line got removed. Let me add it back:Assistant
The switch cases look good now. Now let me add the handler methods. First, let me find the
handleSetIpAddressTypemethod to add thehandleDescribeCapacityReservationright after it:Assistant
Now let me add the
handleDescribeCapacityReservationmethod afterhandleSetIpAddressType(line 251) and before the Target Groups section:Assistant
Now let me add the listener attribute handler methods. Let me find the
handleModifyListenermethod:Assistant
I see there's a duplicate closing brace at line 491. Let me fix that:
Assistant
I need to add a blank line after line 490 to match the style:
Assistant
The code looks good. Now let me check that the
ElbV2Serviceis imported in the query handler (since I referencedElbV2Service.CapacityReservation):Assistant
The
ElbV2Serviceis in the same package (io.github.hectorvent.floci.services.elbv2), so it's accessible without an explicit import. Now let me compile the project to verify there are no compilation errors.Assistant
Compilation succeeded. Now let me create a temporary test script to reproduce the original issue and verify the fix. Let me first check how the tests are structured and run.
Assistant
Let me write a temporary test to reproduce the issue and verify the fix. First let me check how to run the existing tests:
Assistant
All existing tests pass. Now let me create a temporary test script to verify my new functionality works (DescribeListenerAttributes, ModifyListenerAttributes, DescribeCapacityReservation). Let me create a temporary test file:
Assistant
All 9 tests pass. Let me verify the actual XML response to confirm the structure is correct. Let me add a quick debug print to see the raw XML:
Assistant
The XML responses look correct:
- DescribeListenerAttributes returns an empty
<Attributes></Attributes>when no attributes are set (matches the expected behavior "empty by default"). - DescribeCapacityReservation returns an empty
<CapacityReservation></CapacityReservation>when no capacity is reserved (null fields are omitted). - ModifyListenerAttributes returns the attributes that were set.
Now let me clean up the temporary test files:
- DescribeListenerAttributes returns an empty
Assistant
Now let me run the full ELBv2 test suite one more time to make sure nothing is broken:
Assistant
All 36 tests pass. Let me review the final changes with
git diff:Assistant
The diff looks clean and correct. Let me do a final review of the complete changes to make sure everything is consistent.
Let me verify the
git statusto make sure no temporary files are left:Assistant
Only the two intended files are modified, and no temporary test files remain. Let me do one final compilation check to make sure everything is clean:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.