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 then implement the missing ELBv2 actions.
Assistant
I made an error - the
opencommand doesn't take afileargument, it takesFILEas a positional argument.Assistant
Now let me look at the ElbV2Service to understand the existing patterns:
Assistant
Now let me look at the Listener model to understand its structure:
Assistant
Good, the Listener model already has an
attributesmap. Now let me check the LoadBalancer model for capacity reservation patterns:Assistant
Now let me look at how the existing tests are structured:
Assistant
Now let me check how the
handleModifyLoadBalancerAttributesandhandleDescribeLoadBalancerAttributesmethods work in the handler to understand the pattern:Assistant
Let me also look at how the existing
CreateListenerand listener management methods work to understand the full flow:Assistant
Now I have a good understanding of the codebase. Let me create a plan:
-
Add service methods in
ElbV2Service.java:describeListenerAttributes(String region, String arn)- returns a copy of listener's attributes mapmodifyListenerAttributes(String region, String arn, Map<String, String> newAttrs)- merges attributesdescribeCapacityReservation(String region, String arn)- returns aCapacityReservationobject (or null fields when no capacity is reserved)- Create a
CapacityReservationrecord/class
-
Add handler methods in
ElbV2QueryHandler.java:- Register actions in the switch statement:
DescribeListenerAttributes,ModifyListenerAttributes,DescribeCapacityReservation - Implement handler methods following the existing patterns
- Register actions in the switch statement:
-
Add the
CapacityReservationmodel class
Let me first check the exact line numbers in the ElbV2Service for where to add the new methods:
-
Assistant
Now let me check the imports at the top of the ElbV2Service.java:
Assistant
Good, the
model.*import is already a wildcard import, so any new model class in that package will be available. Now let me implement the changes:- First, add the
CapacityReservationrecord to the model package:
- First, add the
Assistant
Now let me add the service methods to ElbV2Service.java. I'll add them after the
describeListenerCertificatesmethod:Assistant
Now I'll add the new service methods after line 636 (after
describeListenerCertificates):Assistant
Now let me combine them:
Assistant
Good. Now let me add the handler methods to ElbV2QueryHandler.java. First, let me add the action cases to the switch statement:
Assistant
I need to add
DescribeListenerAttributes,ModifyListenerAttributesafter theModifyListenercase, andDescribeCapacityReservationafter the Load Balancer section. Let me first see the current listener section:Assistant
I'll use
replaceto add the new cases:Assistant
Good. Now I need to add
DescribeCapacityReservationin the Load Balancers section. Let me find the right place:Assistant
I need to add
DescribeCapacityReservationafter the Load Balancer cases but before Target Groups. Let me do that:Assistant
Now I need to implement the three handler methods. Let me find a good place to add them - I'll add them after the existing listener methods. Let me find the end of
handleModifyListener:Assistant
I need to add the new handler methods between line 469 and 470 (before
handleCreateRule). Let me see what's around that area:Assistant
Now I'll add the three new handler methods before the Rules section. Let me split the file and insert the new methods:
Assistant
Now let me verify the changes are correct:
Assistant
Good, all the new methods are registered and implemented. Now let me verify that the file compiles correctly by running a build:
Assistant
The mvnw script is failing because HOME is not set. Let me try setting HOME and running the build again.
Assistant
Good, the compilation succeeded (no errors). Now let me run the tests to make sure everything works:
Assistant
The tests ran without errors. Let me verify the test results more explicitly:
Assistant
All 27 tests pass. Now let me also run the Lambda target integration test to make sure I didn't break anything:
Assistant
Let me create a test script to verify that my implementation works correctly. I'll create a script that tests the three new API actions.
Now let me create a test script to verify the new actions work correctly:
Assistant
Let me run the test script to verify everything works.
Assistant
All tests pass. Let me now review the changes I made:
Assistant
Let me verify the final state of all the files I modified or created:
Assistant
Let me verify the service methods are correctly implemented by checking the new code in ElbV2Service.java.
Assistant
Let me check the handler methods to make sure everything is correct.
Assistant
Let me also test edge cases - specifically testing errors for non-existent resources:
Assistant
Let me run the full test suite to make sure all tests still pass.
Assistant
The -pl flag is for specifying project modules, not test paths. Let me just run all tests with a wildcard pattern.
Assistant
Let me also see the git diff to verify the complete changes:
Assistant
Let me also view the git diff for ElbV2Service.java and check the new CapacityReservation.java file.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.