Repository navigation
Description
There is no account service namespace in emulator/ — no account_plugin.go. A tool that manages an account's opt-in region enablement (distinct from Organizations, and distinct from the aws:RequestedRegion permission boundary an SCP enforces) has no way to test that work against substrate at all; every call falls through to "service not emulated."
Context
Filed from automat — a research-computing account-vending tool built on top of substrate for testing (test/integration, currently pinned to v0.95.0). internal/baseline.EnsureRegions is a real, shipped feature: after vending a member account, it ensures the account's opt-in region enablement matches what an environment profile names, via exactly the four operations below. There is no way to exercise this against substrate today, so this path is emulator-untested.
Operations
ListRegions— read-first: which regions exist and their current opt-in status (ENABLED,ENABLED_BY_DEFAULT,DISABLED,DISABLING,ENABLING).EnableRegion— opt an account into a region not enabled by default (e.g.ap-east-1,me-south-1).DisableRegion— the reverse; refused for a region that'sENABLED_BY_DEFAULT(the ~17 regions every account starts with).GetRegionOptStatus— poll target. Per AWS's own docs,EnableRegion/DisableRegionare asynchronous ("may take several minutes to several hours"), so a caller with no poll loop should not pass its own tests here — the same shapeCreateAccount'sIN_PROGRESS/DescribeCreateAccountStatuspair already gets right for Organizations (Organizations: OUs, policies, and account placement are unimplemented, so the whole account-vending surface is unreachable #578).
Behaviours worth modelling
- This is account-scoped, not organization-scoped. Region opt-in is a property of one account (management or member), unlike Organizations' OU/SCP tree. It should key off the calling account, not off organization state.
- The default-enabled set is fixed and should not require an
EnableRegioncall. A region in the always-on set answersENABLED_BY_DEFAULTfrom the start;DisableRegionagainst one of those should refuse (AWS:ConstraintViolationException). EnableRegion/DisableRegionare idempotent against the target state, not the call. Re-enabling an already-ENABLEDregion should be a no-op success, not a duplicate-action error — this is the property that makes a re-vend (automat's own "ensure" semantics) safe to run twice.- Async convergence should resolve on first observation, matching the pattern v0.97.0 established for
DescribeCreateAccountStatusand the pattern requested for Config's conformance-pack status in AWS Config: no plugin exists, so recorder, delivery channel, and conformance packs are unreachable #580 — a waiter converges in one poll, with no wall-clock dependence, and the terminal status then never moves.
Priority relative to other open issues
Lower than #578 (closed)/#580 (Config)/#579 (SimulatePrincipalPolicy) for our purposes — region enablement is one of several internal/baseline slices, not the blocking one. Filed now because, unlike Config and SimulatePrincipalPolicy, nothing here was tracked at all.
Activity
scttfrdmn commentedon Aug 14, 2026
Planned for v0.99.0. Two corrections and one deliberate omission, from checking the
account/2021-02-01model and the Account Management Reference Guide rather than working from the issue text.DisableRegionon a default Region isValidationException, notConstraintViolationExceptionThe issue's bullet 2 gives
ConstraintViolationException. Theaccountmodel declares no such error forDisableRegion. Its full error list is:AccessDeniedException(403),ValidationException(400),ConflictException(409),TooManyRequestsException(429),InternalServerException(500).ValidationExceptionReasonhas exactly two members —invalidRegionOptTargetandfieldValidationFailed— and the first is the one that exists for this case. So substrate will answerValidationExceptionwithreason: invalidRegionOptTarget, for both a default Region and an unknown Region code. A refusal carrying a code the SDK has no catch branch for is worse than no refusal at all: the consumer'sexceptnever matches.(Same class of correction as v0.98.0's #620, where the issue's SCP/OU quota values were 1,000 each and the published values are 10,000 and 2,000.)
ConflictExceptionis still used, for the case the User Guide names verbatim: "You cannot cancel an opt-in or opt-out when it is in eitherENABLINGorDISABLINGstatus. Otherwise, aConflictExceptionwill be thrown."The open-request limits will not be modelled
The User Guide contradicts itself. Under Processing times and request limits:
and in the CLI section of Enable or disable a Region in your organization:
It also gives a per-account limit of 6 in-progress requests. Picking one of 50/20 would produce a
TooManyRequestsExceptionat a boundary AWS may not actually enforce, failing requests the real API accepts — the same "guessed refusal is worse than a missing one" rule that kept the resource-policy semantic reasons out of v0.98.0. Both limits are documented as not modelled instead, and this goes in the release's## Provenancesection.Everything else in the issue is confirmed
rest-json,POST /listRegions,/enableRegion,/disableRegion,/getRegionOptStatus, allresponseCode: 200.EnableRegion/DisableRegionhave no output shape — an empty 200.signingName: "account", hostaccount.<region>.amazonaws.com, noX-Amz-Target. Routing needs no alias entry, but it gets an explicit routing test anyway: SSO Admin is unreachable: parser.go maps a guessed X-Amz-Target prefix, not the real SWBExternalService #561 and organizations: every SDK call answers "service not emulated" — the X-Amz-Target prefix has no alias #610 were both "registered, unit-tested, unreachable from every SDK".RegionOptStatus:ENABLED,ENABLING,DISABLING,DISABLED,ENABLED_BY_DEFAULT.af-south-1,ap-east-1,ap-east-2,ap-south-2,ap-southeast-3,ap-southeast-4,ap-southeast-5,ap-southeast-6,ap-southeast-7,ca-west-1,eu-central-2,eu-south-1,eu-south-2,il-central-1,me-central-1,me-south-1,mx-central-1) and 17 default (ap-northeast-1/2/3,ap-south-1,ap-southeast-1/2,ca-central-1,eu-central-1,eu-north-1,eu-west-1/2/3,sa-east-1,us-east-1,us-east-2,us-west-1,us-west-2).GetRegionOptStatusresolvesENABLING→ENABLEDon first observation and the terminal status never moves, followingresolveCreateAccountStatus(emulator/organizations_account.go:334). Alternate outcomes — a Region pinned inENABLING, theConflictExceptionpath — are reachable through a control-plane seed rather than through nondeterminism.One thing worth knowing
ec2SeededRegions(emulator/ec2_plugin.go:4098) seeds onlyus-east-1,us-west-2,eu-west-1, all asopt-in-not-required, and there is no shared region table in substrate. Theaccountplugin gets its own tables;DescribeRegionsandListRegionswill therefore disagree on how many Regions exist. Unifying them is a bigger change than this issue, so the divergence is documented rather than fixed here.Scoped to the four region operations. The other eleven
accountoperations (contact information, primary email, account name) are out of scope.feat(account): emulate the Account Management Region opt-in API (#629) (