Repository navigation
feat(#844): the classic ELB API is routed by the Version a request carries (Tier 1a) - #1146
Merged
Merged
Conversation
…rries Elastic Load Balancing is two APIs at one endpoint. `2012-06-01` and `2015-12-01` share a signing name, an IAM prefix and three action names — `CreateLoadBalancer`, `DescribeLoadBalancers`, `DeleteLoadBalancer` — while publishing different members, shapes and errors under each. Substrate read `Version` nowhere, so ELBv2's handler answered all three whatever the caller sent. The describe was the worst of the three: both generations name their result element `DescribeLoadBalancersResult`, so botocore finds what it is looking for and decodes an empty list — no error anywhere, a consumer simply told it owns no classic load balancers. The three operations now answer their own published shapes, the discriminator is `Version` and nothing else, and an absent or unrecognized version resolves to ELBv2 so every request substrate already answered is untouched. Classic records live in their own key space, so one name can be held by both generations. Every refusal is a code the operation's own page publishes, including `InvalidConfigurationRequest` at HTTP 409. The tagging reversal #863's fifth acceptance row needed is caller-scoped, not global, because AWS's two pages disagree: ELBv2's `AddTags` enumerates the resources it tags and Classic is absent, while RGT matches the type segment both generations spell `loadbalancer`. So RGT accepts a classic ARN and reads it back, and ELBv2's three tag doors still refuse one. Part of #844 (Tier 1a). Tiers 1b and 2 remain open.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
9 tasks
scttfrdmn
added a commit
that referenced
this pull request
Oct 1, 2026
…1317) `AddTags`, `RemoveTags` and `DescribeTags` exist in both Elastic Load Balancing APIs with different shapes, so all three now read the Query `Version` member the way #1146's create/describe/delete trio does — six action names are discriminated where three were. Before this a classic caller's `AddTags` reached the ELBv2 handler and was refused `ResourceArns is required`, a member the 2012-06-01 API does not have: the same defect #1146 fixed, in its other half. The generations differ in every part of the shape. The resource is named rather than ARN'd on the way in (`LoadBalancerNames.member.N`) and on the way out (the classic `TagDescription` carries `LoadBalancerName`, and substrate's classic responses emit no `ResourceArn` at all). `AddTags` and `RemoveTags` take one load balancer where ELBv2's take a list, and `DescribeTags` takes 1-20. And classic `RemoveTags` names its keys as `Tags.member.N` of `TagKeyOnly`, not `TagKeys.member.N` — the one difference whose wrong answer would have been a silent 200, so the test asserts both spellings against each other rather than only the published one. The rules are not new. The published cap of 10 against ELBv2's 50, each generation's own `TooManyTags` wording and `LoadBalancerNotFound`/400 all come from #1148 and are resolved from the stored record rather than from the API door, so one load balancer gets the same answer through its create, through classic `AddTags` and through the Resource Groups Tagging API — #844's last acceptance row, now asserted in both directions. `DuplicateTagKeys`/400 is answered on `AddTags` only, because that is the only page publishing it, and every check runs before any write, so a refused request leaves the stored tag set as it was. The write goes through `elbTaggedResource.encode`, which stamps `ever_tagged` from the pre-merge count (#938) — this is that method's first caller, as its own doc comment anticipated, so `elb_classic.go`'s "no caller yet" paragraph goes. AWS's `RemoveTags` page contradicts itself about the member: its parameter table publishes the indexed `LoadBalancerNames.member.N` while its Sample Request shows singular `&LoadBalancerName=`. `AddTags` and `DescribeTags` publish and sample the indexed form, so the singular is a typo on one page rather than a second accepted spelling, and substrate follows the model — what every SDK serializes. `docs/services.md` records the contradiction so a reader who copies AWS's own sample curl understands the refusal. Each refusal asserts its message as well as its code and status, and that is what makes most of those rows mean anything: unrouted, these same requests reached the ELBv2 handler, which refused seven of them `ValidationError`/400 for a different reason, so code and status alone passed with the routing removed. With the three `case` lines deleted every new test and subtest fails except the one asserting the ELBv2 half is untouched, which is the control in the other direction. Refs #844
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #844 (Tier 1a). This does not close #844 — Tiers 1b and 2 move to v0.121.0.
What was wrong
Elastic Load Balancing is two APIs at one endpoint.
2012-06-01and2015-12-01share a signingname, an IAM prefix and three action names —
CreateLoadBalancer,DescribeLoadBalancers,DeleteLoadBalancer— while publishing different members, shapes and errors under each. Substrateread
Versionnowhere (the onlyParams["Version"]read in the tree was in a parser test), soELBv2's handler answered all three whatever the caller sent:
CreateLoadBalancerValidationError/400 onName is required— ELBv2's member name for what classic spellsLoadBalancerNameDeleteLoadBalancerValidationError/400 on a missingLoadBalancerArn, for an operation that publishes no errors at all and documents idempotent successDescribeLoadBalancersThe third is the worst, and it corrects the issue's own prediction. Both generations name their
result element
DescribeLoadBalancersResult, so botocore finds what it is looking for and decodesan empty list — not a
KeyError. A classic caller was told, with a 200, that it owns noclassic load balancers.
What this does
Versionand nothing else. An absent or unrecognized version resolves toELBv2, so every request substrate already answered — every fixture, every recorded event log —
answers exactly as before, and no code is invented for a version AWS publishes none for. Member
names could not serve, because a classic
DescribeLoadBalancersmay carry no members at all.CreateLoadBalancerreturnsDNSNamealone, prefixed
internal-for theinternalscheme per AWS's sample;DescribeLoadBalancersreturns
LoadBalancerDescriptions.member.Nwith each listener inside its publishedListenerDescriptionswrapper and an emptyPolicyNameselement;DeleteLoadBalancersucceedsfor a load balancer that does not exist. Eight of
LoadBalancerDescription's sixteen members areabsent rather than invented, each because the operation that would set it is not routed.
each generation's describe reports only its own.
InvalidConfigurationRequestat HTTP 409 for two listeners claiming oneLoadBalancerPort.DuplicateListeneris not borrowed — it is published onCreateLoadBalancerListeners, whichthis operation does not have (ec2: an invalid block device mapping is accepted instead of refused with InvalidBlockDeviceMapping #671). An unissued
Markeris refused rather than silentlyrestarting the listing (A pagination token substrate never issued is silently answered with page one (CloudWatch, SSM x2, S3 ListObjectsV2) #915).
AddTagsenumerates the resources it tags andClassic is absent, so its three tag doors still answer
ValidationError/400 — while RGT matchesthe type segment both generations spell
loadbalancer, soTagResourcesaccepts a classic ARN andGetResourcesreports it, including underResourceTypeFilters=elasticloadbalancing:loadbalancer(cfn: the aws:cloudformation:* stamp covers EC2 only, so the rest of a stack is unstamped #765). The arity check tagging: resolveARN has no elasticloadbalancing arm, so the Resource Groups Tagging API reaches no ELB resource #863 added is not loosened; it is what keeps the two generations' records
apart. CloudFormation's writers resolve the same way, though no template reaches the classic half
yet — the classic type has no deploy helper, which is Tier 2.
Verification
Every assertion is over the wire, because the defect was a routing decision made from the request
body, and all three operations are asserted in both directions. The plan's requirement for this
PR — "a
Version=2012-06-01call answers the classic shape and a2015-12-01call is untouched, anda classic ARN is accepted by RGT while still refused at ELBv2's own tag doors" — is
TestELBClassic_TheELBv2FormOfTheSameActionIsUntouched(subtests for both the explicit and theabsent version) and
TestELBTagging_AClassicLoadBalancerARNIsCallerScoped.Full nine-stage gate green:
gofmt/build/vet,golangci-lint,make teston both toolchains,coverage, the docs targets, the docs site build, the e2e module, and the three check targets.
Coverage 86.0% emulator / 85.5% total, against the release floor of 85.5%/85.0%.
Two blocks of the new file are deliberately uncovered and documented in place: a
json.Marshalofthe record failing, and the classic arm's
withTagsclosure, whose only caller would beCloudFormation's tag writers — unreachable until the classic type has a deploy helper.