Skip to content

feat(elb): tagging, and a producer for elasticloadbalancing:CreateAction (#748) - #775

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/748-elb-tagging
Aug 23, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/748-elb-tagging

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #748

AddTags, RemoveTags and DescribeTags did not exist, and the Tags.member.N on each of the four ELBv2 creates was accepted and silently dropped — a CreateLoadBalancer carrying tags answered success and produced an untagged load balancer. The Tags field was dead on two of the four records and absent from the other two.

All four creates now store what they are given, and the three tagging operations reach all four resource types. Limits are the API model's: keys 1–128, values 0–256, 50 tags per resource with aws:-prefixed keys excluded from the count, DescribeTags capped at 20 resources and RemoveTags at 128 keys. Per-operation error sets are followed rather than unified — DuplicateTagKeys on AddTags and CreateLoadBalancer only, since those are the two operations that publish it.

Authorization

Every ELB request naming a resource by ARN is now decided against that ARN. Previously every ELB request was decided against the literal string *, which is not a wildcard on the request side — so an ARN-scoped Allow denied every call and an ARN-scoped Deny was inert. A request naming several resources is denied unless every one is allowed. Tags are reported under elasticloadbalancing:ResourceTag/<key> as well as aws:ResourceTag/<key>.

A tagged create is authorized twice, against elasticloadbalancing:AddTags with elasticloadbalancing:CreateAction set to the bare operation name. That is the last of the seven bundled managed-policy condition keys to gain a producer; the census in docs/services.md drops to four.

Provenance correction

The plan claimed elasticloadbalancing:CreateAction's only citable source was AWS's own managed policy shipping inside substrate. That is wrong: the ELB user guide's "Tag your Elastic Load Balancing resources during creation" page documents the key, the second AddTags authorization, and the bare operation name as its value. It is absent from the guide's own condition-key list, and both Service Authorization Reference pages for ELB render their tables in JavaScript and were unreachable — which is how it came to look otherwise. Docs, CHANGELOG and release notes cite the user guide.

A second bug, found by the live proof

Six pre-existing operations — DeleteLoadBalancer, DeleteTargetGroup, DeleteListener, DeleteRule, RegisterTargets, DeregisterTargets — answered a bare <OperationResponse/> with no result wrapper. ELBv2 is a Query-protocol service whose output shapes all declare a resultWrapper, so the AWS CLI raised KeyError: 'DeleteLoadBalancerResult' for a call that had already succeeded. Substrate's ELB tests read the response XML directly rather than through an SDK parser, so all six were green. Fixed in one shared place with a test that asserts the wire bytes.

Verification

  • gofmt/go build/go vet/golangci-lint: 0 issues
  • make test passes; coverage emulator 83.5%, total 82.9% (baseline 83.4% / 82.9%)
  • make docs-reference-check, docs-versions, npm --prefix docs run build, anchor diff: clean
  • go vet/go test under test/e2e: pass
  • Live AWS CLI proof, fail-before against a main build: all three tagging operations answered InvalidAction and a tagged create dropped its tags; after, the round trip, the multi-resource describe, DuplicateTagKeys and LoadBalancerNotFound all answer correctly, and the six empty-output operations no longer crash the CLI.

Deliberate gaps, named in the docs

  • Names.member.N on DescribeLoadBalancers/DescribeTargetGroups is not resolved to an ARN — whether ELB describes support resource-level permissions is on the unreachable pages, and leaving them at * cannot invent a grant.
  • A key beginning aws: is accepted: the restriction is documented, no code for refusing one is.
  • Substrate's nested listener/rule ARNs (ELBv2 listener and listener-rule ARNs are the wrong shape #774) — the tagging code accepts both shapes and the create pass authorizes against AWS's spelling.

…ion (#748)

AddTags, RemoveTags and DescribeTags did not exist, and the Tags.member.N on
each of the four creates was accepted and silently dropped. All four creates
now store what they are given, the three tagging operations reach all four
resource types, and every ELB request naming a resource by ARN is authorized
against that ARN rather than against the literal string "*".

A tagged create is authorized a second time against elasticloadbalancing:AddTags
with elasticloadbalancing:CreateAction set to the operation name, which is the
last of the seven bundled managed-policy condition keys to gain a producer.

Also fixes six pre-existing ELB operations that answered a bare
<OperationResponse/> with no result wrapper, making the AWS CLI and boto3 raise
KeyError on a call that had succeeded. Found by this PR's live-CLI proof.
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.75751% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
emulator/elb_tags.go 83.39% 27 Missing and 19 partials ⚠️
emulator/elb_authz.go 76.47% 16 Missing ⚠️
emulator/elb_plugin.go 90.24% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 0e0cb05 into main Aug 23, 2026
16 checks passed
@scttfrdmn
scttfrdmn deleted the fix/748-elb-tagging branch August 23, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

elbv2: tagging, so elasticloadbalancing:CreateAction has a producer

1 participant