Skip to content

Root

Source: src/AWS/Organizations/Root.ts

The organization root.

Root is an import-style resource. It discovers the existing root returned by AWS Organizations and can reconcile root tags. Use root.rootId as the parentId for top-level OrganizationalUnits and Accounts, and as the targetId/rootId for PolicyAttachment and RootPolicyType.

Adopt the Organization Root

const organization = yield* Organization("Org", { featureSet: "ALL" });
const root = yield* Root("Root", {});

Parent OUs and Accounts Under the Root

const workloads = yield* OrganizationalUnit("Workloads", {
parentId: root.rootId,
name: "workloads",
});
const sandbox = yield* Account("Sandbox", {
name: "sandbox",
email: "aws-sandbox@example.com",
parentId: root.rootId,
});