Skip to content

feat(quotas): seed the organizations service quotas (#620) - #627

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/620-quotas-organizations
Aug 14, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/620-quotas-organizations

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

organizations was in neither Service Quotas seed table, so L-E619E033 — the accounts-per-organization ceiling — answered NoSuchResourceException. CreateAccount worked but nothing could read the limit it runs into. Like #619, this was found by driving a consumer against substrate server at v0.97.0 rather than by reading the API model.

The quotas

Quota code Name Value Adjustable
L-E619E033 Maximum number of accounts 10 yes
L-29A0C5DF Service control policies in an organization 10,000 no
L-0F0F51F4 Organizational units in an organization 2,000 no

Each value is the one substrate's Organizations plugin actually enforces, and a test asserts that against orgMaxAccounts/orgMaxSCPsPerOrg/orgMaxOUsPerOrg directly rather than against a copied literal. A quota table that disagreed with its own emulator would be worse than a missing one: a test written against the published number would fail for a reason unrelated to the code under test.

All three are GlobalQuota: true — Organizations is a global service hosted in us-east-1.

A correction to the issue

#620 gives SCPs-per-organization and OUs-per-organization as 1,000 each. Both Endpoints and quotas and the User Guide say 10,000 and 2,000, matching substrate's own constants. Same class of error as #578's RCP-for-SCP mixup, so the corrected values ship.

Provenance of the quota codes

Only L-E619E033's code is confirmable from AWS documentation: the endpoints page publishes a quota code only for the adjustable quotas, and that is the adjustable one. L-29A0C5DF and L-0F0F51F4 come from #620's report; the User Guide warns that quota codes may change and says to use ListServiceQuotas to discover them. Their values are documented and cited. This will be repeated in the release notes' ## Provenance section.

The two-table drift

defaultServiceQuotas is read only by ListServiceQuotas/GetServiceQuota, defaultServiceList only by ListServices, and both are maintained by hand. A service added to one and not the other is either undiscoverable or discoverable with no quotas, and neither state is visible in any single response. TestServiceQuotas_TheTwoTablesAgree now pins the two together on every service code and name, which closes that drift for the existing ten services as well.

The refusals that made this hard to diagnose

  • ListServiceQuotas for an unknown service was HTTP 200 with {"Quotas": []}. That claims this service exists and publishes no quotas — a different statement from there is no such service, and only the second is true of a code substrate does not carry. It now answers NoSuchResourceException, which the model declares for this operation.
  • GetServiceQuota/GetAWSDefaultServiceQuota could not distinguish an unknown service from an unknown quota code. Both are NoSuchResourceException — the only code the model declares — so the message is the sole place they can differ: an unknown service names the service and points at ListServices, an unknown quota code names the code and points at ListServiceQuotas. Conflating them is what sends a caller to audit a quota code when the service name was wrong.
  • A missing required member is now IllegalArgumentException, also from the model's error list, rather than a not-found for a resource the request never named.

Verification

  • gofmt, go build, go vet, golangci-lint run ./... — 0 issues
  • make test (race detector) green; make coverage at 81.5% total, 82.2% for emulator. Every function touched here is at 100% statement coverage.
  • make docs-reference docs-reference-check docs-versions; npm --prefix docs run build
  • go vet -C test/e2e ./... and go test -C test/e2e ./... green, including the new TestJourney_ServiceQuotasOrganizations — the level that catches an unrouted operation, since the SDK's SigV4 name (servicequotasv20190624) and target prefix are neither of them the plugin name.
  • Live against substrate server --address :4678 with AWS_MAX_ATTEMPTS=1, running Service Quotas: organizations is not seeded, so L-E619E033 (accounts per organization) reads as NoSuchResourceException #620's repro verbatim: get-service-quota organizations L-E619E033 reads 10 / adjustable, list-service-quotas returns all three, list-services names it once, both unknown-service refusals arrive with distinguishable messages, and a pending increase leaves the quota reading 10.
  • Mutation testing, five mutants aimed at this change: the defaultServiceList entry removed (caught by 2 tests), the unknown-service check reverted to the empty list, the two refusals conflated, the accounts value drifted off the enforced limit (caught by 3 tests), and the required-member check dropped (caught by 2). All caught, no survivors. Three more against Organizations: DescribeResourcePolicy/PutResourcePolicy are unimplemented, so delegated administration cannot be observed #619's merged code — re-minting the resource-policy ID on replacement, the 40,000-character bound off by one, and delete made a silent no-op — were also all caught.

Out of scope

The hardcoded accountID := "000000000000" in requestServiceQuotaIncrease and friends, filed as #624: HandleRequest discards the RequestContext, so increases are recorded under a placeholder account rather than the caller's. A real defect, but a separate concern from #620.

Closes #620

`organizations` was in neither Service Quotas seed table, so `L-E619E033` —
the accounts-per-organization ceiling — answered `NoSuchResourceException`.
`CreateAccount` worked but nothing could read the limit it runs into. Found by
driving a consumer against `substrate server` at v0.97.0, not by reading the
API model.

The three quotas are seeded at the values substrate's Organizations plugin
actually enforces, asserted against `orgMaxAccounts`/`orgMaxSCPsPerOrg`/
`orgMaxOUsPerOrg` directly: a quota table that disagrees with its own emulator
is worse than a missing one, because a test written against the published
number would fail for a reason unrelated to the code under test. #620 reported
SCPs and OUs as 1,000 each; both AWS pages and substrate's constants say
10,000 and 2,000.

The two seed tables are maintained by hand and read by different operations, so
a service in one and not the other is either undiscoverable or discoverable
with no quotas — invisible in any single response. A test now pins the two
together, closing that drift for the existing ten services too.

Also fixes the refusals that made the gap hard to diagnose. An unrecognized
service code on `ListServiceQuotas` was HTTP 200 with an empty list, which
claims the service exists and publishes nothing; it now answers
`NoSuchResourceException`, the error the model declares. `GetServiceQuota`
distinguishes an unknown service from an unknown quota code in the message,
since both carry the only code the model gives them. A missing required member
is `IllegalArgumentException` rather than a not-found for a resource the
request never named.

Closes #620
@scttfrdmn scttfrdmn added this to the v0.98.0 milestone Aug 14, 2026
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit b8674c9 into main Aug 14, 2026
16 checks passed
@scttfrdmn
scttfrdmn deleted the feat/620-quotas-organizations branch August 14, 2026 03:56
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.

Service Quotas: organizations is not seeded, so L-E619E033 (accounts per organization) reads as NoSuchResourceException

1 participant