Files
floci/docs
Matheus Oliveira 9242c7003a fix(organizations): preconfigure the account access role in a new account (#6444)
* fix(organizations): preconfigure the account access role in a new account

CreateAccount was returning a member account with no OrganizationAccountAccessRole, so sts:AssumeRole into it failed on a role that does not exist. The role AWS preconfigures is now created through IAM's own creation, in the new account's namespace: it trusts the management account and carries AdministratorAccess. CreateAccount's RoleName is honored, defaulted to OrganizationAccountAccessRole, and validated with the pattern the reference publishes, including the AWSServiceRoleFor refusal. Invited accounts do not get the role, which is AWS behavior. IAM owns the how behind an interface, the way ScpProvider already decouples IAM's reads of organization policy.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* fix(organizations): answer RoleName errors with their reasons and provision the role as the new account

CreateAccount's InvalidInputException for a bad RoleName now carries the
reference's Reason, INVALID_PATTERN for a pattern violation and
INVALID_ROLE_NAME for the reserved prefix, asserted at the service, the
wire and the SDK levels. The provisioner itself now runs createRole and
attachRolePolicy inside RequestScopes.callAs(memberAccountId), so
validation, ARN minting and storage stay IAM's own and the hand-built
role with its account-aware storage branch is gone. EntityAlreadyExists
is the one error caught, falling back to the role that is there, and
the integration test builds its requests and auth through the
OrganizationsRequests and EnforcementFixtures helpers.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-25 07:31:36 -04:00
..
2026-03-15 17:43:56 -05:00