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
Let me analyze the issue:
- The bug is about ELBv2 (
DescribeListenerAttributesandDescribeCapacityReservation) returningUnsupportedOperationin Floci. - I need to implement these two actions in the
ElbV2Service.javafile. - I also need to implement
ModifyListenerAttributesas mentioned in the PR description.
Let me start by exploring the repository structure to understand how it's organized and find the relevant files.
- The bug is about ELBv2 (
Assistant
Let me look at the ELBv2 service and handler files.
Assistant
Let me look at the main files: ElbV2Service.java, ElbV2QueryHandler.java, and the existing attributes handlers.
Assistant
It seems I need to use the
opencommand withoutfile=syntax. Let me try again.Assistant
Now let me look at the Listener model and LoadBalancer model to understand their structure:
Assistant
Good, the Listener model already has an
attributesfield. Now let me check the LoadBalancer model to see if it has attributes too.Assistant
Now let me look at the ElbV2QueryHandler to see how actions are dispatched:
Assistant
Now I have a clear understanding. Let me look at the target group attributes handler for reference, and check the Listener model's attributes handling:
Assistant
Let me check the existing test to understand the patterns and verify things work:
Assistant
Now I have a clear picture. Let me implement the missing functionality:
DescribeListenerAttributes- returns listener's attribute mapModifyListenerAttributes- merges attributes into listener's attribute mapDescribeCapacityReservation- returns capacity reservation state for a load balancer
Let me start by adding the methods to
ElbV2Service.java:Assistant
Now I have a complete understanding. Let me implement all the needed changes. I'll start with the ElbV2Service.java:
Assistant
The edit command seems to have an issue with its format. Let me try using the proper syntax.
Assistant
Let me use the
editcommand properly with line range and heredoc:Assistant
Now let me create the new file with the listener attributes section inserted:
Assistant
Now let me add the CapacityReservation class and the describeCapacityReservation method. First, let me check what's at the end of the file:
Assistant
Let me add the CapacityReservation class and describeCapacityReservation method. First, let me find the exact line where the
linkTgToLbmethod ends and the class closing brace is:Assistant
I need to add the
CapacityReservationrecord anddescribeCapacityReservationmethod. TheCapacityReservationrecord should be a public static inner class ofElbV2Service, and thedescribeCapacityReservationmethod should go before the Helpers section. Let me also add the import forInstantif not already there.Looking at the issue:
CapacityReservation(Integer decreaseRequestsRemaining, Integer minimumCapacityUnits, Instant lastModifiedTime)- Returns null fields when no capacity is reserved
describeCapacityReservationvalidates the load balancer and returns its capacity-reservation state
I'll:
- Add the
CapacityReservationrecord as a static inner class - Add a
capacityReservationsmap to store capacity reservation data - Add the
describeCapacityReservationmethod - Add handlers in
ElbV2QueryHandlerforDescribeCapacityReservation
Let me check the imports first to see if Instant is already imported.
Assistant
Good,
Instantis already imported. Now let me add theCapacityReservationrecord anddescribeCapacityReservationmethod. I'll insert them before the Helpers section:Assistant
Now I need to:
- Add the
CapacityReservationrecord as a public static inner class - Add a
capacityReservationsmap - Add the
describeCapacityReservationmethod before the Helpers section
Let me create the code to insert before line 650 (the Helpers section).
- Add the
Assistant
Now I need to add the CapacityReservation record and the describeCapacityReservation method. Let me create the middle part.
Assistant
Let me verify the file looks correct:
Assistant
Now I need to add the action handlers in
ElbV2QueryHandler.java. Let me find where to add them:Assistant
Let me find the exact switch cases and where to add the new ones.
Assistant
I need to add the switch cases and handler methods. Let me add the new cases to the switch:
Assistant
I need to verify the switch cases were added correctly, then add the
DescribeCapacityReservationcase and the handler methods. Let me continue with the implementation.Assistant
Now let me add the
DescribeCapacityReservationcase:Assistant
Let me verify the switch cases were added correctly.
Assistant
Good, the switch cases are in place. Now I need to add the actual handler methods. Let me find where the listener-related handlers are in the handler file:
Assistant
Let me find where to insert the new handler methods - after
handleModifyListener:Assistant
Now I need to add the handler methods. Let me find the exact line where the "Rules" section starts:
Assistant
Now let me create a temporary file with the three new handler methods to insert:
Assistant
Now I'll split the file and insert the listener attributes handlers before the Rules section:
Assistant
Now let me find where to add the
handleDescribeCapacityReservationmethod. First, let me find where the listener certs handlers are (near the end):Assistant
Let me see the describeListenerCertificates handler and what comes after it:
Assistant
I need to add the
handleDescribeCapacityReservationmethod. Let me find the exact line where I should insert it - afterhandleDescribeListenerCertificatesand before the "XML builders" section.Assistant
Now I'll create and insert the
handleDescribeCapacityReservationmethod:Assistant
Let me verify the changes look correct:
Assistant
Now let me verify the complete structure of both files by compiling and testing. First, let me check if there's a build system:
Assistant
Now let me try to compile the code to verify it works correctly.
Assistant
The
CapacityReservationclass needs to be referenced with its full path since it's a static inner class ofElbV2Service. Let me fix the reference in ElbV2QueryHandler.java:Assistant
Let me verify the fix and compile again.
Assistant
The code compiles successfully. Now let me run the existing ELBv2 integration tests to make sure everything still works:
Assistant
All existing ELBv2 integration tests pass. Now let me create a quick test script to verify the new functionality works:
Assistant
The test script requires Floci to be running. Let me verify the complete changes are correct by examining all the modified files:
Assistant
Let me verify the complete diff to make sure everything is correct before submitting.
Assistant
I notice there's a duplicate
// ── Rules ──comment in the diff. Let me clean that up:Assistant
Let me remove the duplicate comment:
Assistant
Let me verify the fix and make sure everything still compiles and tests pass. I need to check:
- The duplicate comment is removed
- The code still compiles
- The existing tests still pass
Assistant
Good, the duplicate is removed. Now let me compile and run tests again to confirm everything still works:
Assistant
The code compiles. Now let me run the ELBv2 integration tests again to confirm everything still passes.
Assistant
All tests pass. Let me verify the final diff is clean:
Assistant
Let me verify the final diff looks correct:
Assistant
The implementation looks correct. Let me verify once more that all tests pass:
Assistant
It seems like there might be a test failure. Let me run the tests again with more verbose output to see what's happening.
Assistant
All 27 ELBv2 integration tests pass with no failures. The implementation is complete.
Let me provide a summary of what was implemented:
Summary of Changes
Issue
DescribeListenerAttributesandDescribeCapacityReservationELBv2 API actions were returningUnsupportedOperationerrors in Floci, breaking@pulumi/awsrefresh operations.Changes Made
1.
ElbV2Service.java- Added service-layer methods:describeListenerAttributes(String region, String arn)- Returns a copy of the listener's attribute mapmodifyListenerAttributes(String region, String arn, Map<String, String> newAttrs)- Merges new attributes into the listener's existing attributesCapacityReservation- A public static inner class representing the capacity reservation state withdecreaseRequestsRemaining, , and fields (all null when no capacity is reserved)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.