Skip to content

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

Closed

Description

@scttfrdmn

Found driving automat against substrate server at v0.97.0 (42f1bf6).

What happens

defaultServiceQuotas and defaultServiceList in emulator/servicequotas_types.go cover ten services; organizations is not one of them. So the accounts-per-organization quota — L-E619E033, "Maximum number of accounts", the one quota that governs whether an account-vending tool can create anything at all — cannot be read:

operation error Service Quotas: GetServiceQuota,
https response error StatusCode: 400, RequestID: ,
NoSuchResourceException: No quota found for service "organizations" quota "L-E619E033"

Reproduce:

substrate server --address 127.0.0.1:4566 &
export AWS_ENDPOINT_URL=http://127.0.0.1:4566 AWS_REGION=us-east-1 \
       AWS_ACCESS_KEY_ID=substrate AWS_SECRET_ACCESS_KEY=substrate
aws service-quotas get-service-quota --service-code organizations --quota-code L-E619E033
aws service-quotas list-service-quotas --service-code organizations   # {"Quotas": []}

Now that Organizations itself is well covered (#578, #610, #577 all fixed), this is what stops the vending story from being testable end to end: CreateAccount works, but nothing can check the ceiling it runs into.

The part that actively misleads

getServiceQuota returns NoSuchResourceException for an unseeded service, and real Service Quotas returns that for a genuinely bogus quota code. A caller cannot tell the two apart. automat's remediation text for this failure reads:

servicequotas:GetServiceQuota returned NoSuchResourceException for L-E619E033, which should not happen for a valid, current quota code; treat this as a possible defect in automat itself (a stale or wrong quota code) before assuming an AWS-side cause

So the emulator sends a correct caller off to hunt a bug in its own quota codes. That reasoning is sound against real AWS — which makes the emulator's silence expensive.

Related: list-service-quotas for an unknown service returns {"Quotas": []} and HTTP 200, where real Service Quotas returns NoSuchResourceException for an unrecognised ServiceCode. An empty list reads as "this service has no quotas", which is a different claim from "no such service".

Suggested behaviour

Seed organizations with the quotas a vending tool reads, at their real AWS defaults:

Quota code Name Default
L-E619E033 Maximum number of accounts 10 (adjustable)
L-29A0C5DF Maximum number of policies (SCP) 1000
L-0F0F51F4 Maximum number of OUs 1000

L-E619E033 is the one that matters — a low, adjustable, support-ticket-gated default is exactly the condition a test wants to reproduce, and RequestServiceQuotaIncrease already exists to model the rest of that story.

Activity

  1. added
    type: feature
    area: quotas
    priority: medium
    on Aug 13, 2026
  2. added this to the v0.98.0 milestone on Aug 14, 2026
  3. scttfrdmn commented on Aug 14, 2026

    @scttfrdmn
    OwnerAuthor

    Picking this up for v0.98.0. Two corrections to the suggested quota table before implementing it, both from AWS documentation rather than recall.

    The SCP and OU defaults are 10× and 2× higher than stated

    Quota Issue says AWS says
    Maximum number of accounts 10 (adjustable) 10 (adjustable) ✓
    Policies (SCP) in an organization 1000 10,000
    OUs in an organization 1000 2,000

    Both AWS Organizations endpoints and quotas and Quotas and service limits for AWS Organizations agree: "Service control policies in an organization — Each supported Region: 10,000" and "OUs in an organization — Each supported Region: 2,000".

    This matters beyond fidelity: substrate already enforces those two numbers as orgMaxSCPsPerOrg = 10000 and orgMaxOUsPerOrg = 2000 in emulator/organizations_state.go. Seeding 1,000 would make the quota a consumer reads disagree with the limit the same consumer hits — which is a worse failure than the quota being absent, because it looks authoritative.

    Same class of mixup as the one in #578, where the quoted SCP numbers (5 per target, 5,120 characters) turned out to be the RCP values. Here 1,000 is the default for declarative / backup / tag / chat-applications / Security Hub policies.

    L-E619E033 = 10, adjustable, is confirmed exactly as filed, and is the one the issue rightly says matters most.

    Only one of the three quota codes is verifiable

    The endpoints page publishes a quota code only for adjustable quotas — those are the ones with a Service Quotas console link. L-E619E033 is there. SCPs-per-organization and OUs-per-organization are both non-adjustable, so neither page gives a code for them, and I could not confirm L-29A0C5DF or L-0F0F51F4 against any AWS source.

    The User Guide is explicit about why that is a live hazard:

    Service quota codes might change over time due to updates. This does not impact the quota values or names. To find the quota code for a specific quota, use the ListServiceQuotas operation.

    So substrate will seed all three as suggested, with the corrected values, and the release notes will carry a ## Provenance section recording that those two codes come from this report rather than from an AWS page — values documented and cited, codes best-effort. If they turn out wrong, the fix is a one-line table edit, and ListServiceQuotas will still return the right names and values.

    Also shipping the "actively misleads" part

    Confirmed against the Service Quotas API model: ListServiceQuotas does declare NoSuchResourceException, so the current 200 + {"Quotas": []} for an unrecognised ServiceCode is wrong, exactly as the Related note says. That changes to the error. And since GetServiceQuota must keep returning NoSuchResourceException for both an unknown service and an unknown quota code (the model declares only that one code), the two cases will be distinguishable by message — which is the part that sent automat off to hunt a non-existent bug in its own quota codes.

    One thing deliberately left out, filed separately rather than riding along: ServiceQuotasPlugin.HandleRequest discards its *RequestContext, so RequestServiceQuotaIncrease files every increase under a hardcoded 000000000000 instead of the caller's account.

  4. scttfrdmn commented on Aug 14, 2026

    @scttfrdmn
    OwnerAuthor

    Shipped in v0.98.0 (#627). Your repro verbatim, live against substrate server:

    $ aws service-quotas get-service-quota --service-code organizations --quota-code L-E619E033
    {
        "Quota": {
            "ServiceCode": "organizations",
            "ServiceName": "AWS Organizations",
            "QuotaCode": "L-E619E033",
            "QuotaName": "Maximum number of accounts",
            "Value": 10,
            "Unit": "None",
            "Adjustable": true,
            "GlobalQuota": true
        }
    }
    

    All three quotas are seeded, at the two corrected values discussed above: 10 accounts (adjustable), 10,000 SCPs, 2,000 OUs. A test asserts each against orgMaxAccounts/orgMaxSCPsPerOrg/orgMaxOUsPerOrg directly rather than against a copied literal, so the number a consumer reads and the number the Organizations plugin refuses at cannot drift apart silently — which was the point of correcting them rather than seeding what the issue said.

    The "Related" note is fixed too. list-service-quotas for an unrecognised service code now answers NoSuchResourceException instead of HTTP 200 with {"Quotas": []} — the model declares that error for the operation, and an empty list claims something different and false. get-service-quota also distinguishes its two refusals in the message now:

    $ aws service-quotas get-service-quota --service-code nosuchsvc --quota-code L-E619E033
    NoSuchResourceException: No such service "nosuchsvc". Use ListServices to find the service codes substrate emulates quotas for.
    
    $ aws service-quotas get-service-quota --service-code organizations --quota-code L-NOTAQUOTA
    NoSuchResourceException: No quota code "L-NOTAQUOTA" for service "organizations". Use ListServiceQuotas to find the quota codes a service publishes.
    

    Both are NoSuchResourceException because that is the only code the model declares for either, so the message is the sole place they can differ — and conflating them is what would send you to audit a quota code when the service name was wrong.

    Two things worth knowing that came out of the work:

    • L-29A0C5DF and L-0F0F51F4 are best-effort codes. AWS publishes a quota code only for the adjustable quotas, and neither of those is adjustable, so their codes come from your report rather than from an AWS page. The values are documented and cited. The release notes say this under ## Provenance, and the User Guide's advice — discover codes via ListServiceQuotas rather than hard-coding them — applies here as much as against real AWS.
    • Quota-increase requests still file under 000000000000. ServiceQuotasPlugin.HandleRequest discards its RequestContext, so RequestServiceQuotaIncrease records the request under a placeholder account rather than the caller's. It works — you can request and read back an increase against L-E619E033 — but the account on the record is wrong. Split out as Service Quotas: HandleRequest discards RequestContext, so every quota-increase request files under 000000000000 #624 rather than ridden along here.

    Closing. Thanks for both of these; finding them by driving a real consumer rather than by reading the model is exactly the provenance that made them worth prioritising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: organizationsarea: quotaspriority: mediumtype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions