本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
建立組織 AWS Organizations
您可以使用 AWS 帳戶 作為管理帳戶。建立組織時,您可以選擇組織是否支援所有功能 (建議) 或僅支援合併帳單。依預設,您建立的組織支援所有功能。
建立組織
您可以使用 AWS Management Console 或使用來自 AWS CLI 或其中一個 SDKAPIs.
若要使用目前的組織建立組織 AWS 帳戶,您必須具有下列權限:
-
organizations:CreateOrganization
-
iam:CreateServiceLinkedRole
您可以將此許可限制為僅限服務委託人 organizations.amazonaws.com
。
建立組織
-
登入 AWS Organizations 控制台。您必須以IAM使用者身分登入、擔任IAM角色,或以 root 使用者身分登入 (不建議) 在組織的管理帳戶中。
-
在預設情況下,您建立的組織會啟用所有功能。但是,您可以選擇下列其中一個步驟:
-
若要建立已啟用所有功能的組織,在簡介頁面上,選擇 Create an organization (建立組織)。
-
若要建立僅具有合併帳單功能的組織,請在「簡介」頁面和 Create an organization (建立組織) 下,選擇 consolidated billing features (合併帳單功能),然後在 Confirmation (確認) 對話方塊中,選擇 Create an organization (建立組織)。
如果您不小心選擇了錯誤的選項,您可以立即前往 Settings (設定) 頁面,然後選擇 Delete organization (刪除組織),並重新開始
-
組織已建立,AWS 帳戶頁面隨即顯示。唯一存在的帳戶是您的管理帳戶,並且其目前存放在根組織單位 (OU)。
如有必要,Organizations 會自動傳送驗證電子郵件至與您管理帳戶關聯的地址。在您收到驗證電子郵件之前,可能會有一些延遲的時間。請在 24 小時內驗證您的電子郵件地址。如需詳細資訊,請參閱電子郵件地址驗證 AWS Organizations。您可以建立帳戶以發展您的組織,而不驗證您的管理帳戶的電子郵件地址。不過,若要邀請現有的帳戶,您必須先完成電子郵件驗證。
如果此帳戶之前已驗證其電子郵件地址,則在您使用該帳戶建立組織時,就不會再發生這種情況。
下列程式碼範例會示範如何使用CreateOrganization
。
- .NET
-
- AWS SDK for .NET
-
using System;
using System.Threading.Tasks;
using Amazon.Organizations;
using Amazon.Organizations.Model;
/// <summary>
/// Creates an organization in AWS Organizations.
/// </summary>
public class CreateOrganization
{
/// <summary>
/// Creates an Organizations client object and then uses it to create
/// a new organization with the default user as the administrator, and
/// then displays information about the new organization.
/// </summary>
public static async Task Main()
{
IAmazonOrganizations client = new AmazonOrganizationsClient();
var response = await client.CreateOrganizationAsync(new CreateOrganizationRequest
{
FeatureSet = "ALL",
});
Organization newOrg = response.Organization;
Console.WriteLine($"Organization: {newOrg.Id} Main Accoount: {newOrg.MasterAccountId}");
}
}
- CLI
-
- AWS CLI
-
範例 1:建立新組織
比爾希望使用帳戶 1111111111 的憑據創建一個組織。下列範例顯示該帳戶成為新組織中的主帳戶。因為他沒有指定功能集,所以新組織預設為所有已啟用的功能,而且服務控制原則會在根目錄上啟用。
aws organizations create-organization
輸出包含有關新組織詳細資訊的組織物件:
{
"Organization": {
"AvailablePolicyTypes": [
{
"Status": "ENABLED",
"Type": "SERVICE_CONTROL_POLICY"
}
],
"MasterAccountId": "111111111111",
"MasterAccountArn": "arn:aws:organizations::111111111111:account/o-exampleorgid/111111111111",
"MasterAccountEmail": "bill@example.com",
"FeatureSet": "ALL",
"Id": "o-exampleorgid",
"Arn": "arn:aws:organizations::111111111111:organization/o-exampleorgid"
}
}
範例 2:建立僅啟用合併帳單功能的新組織
下列範例會建立僅支援合併帳單功能的組織:
aws organizations create-organization --feature-set CONSOLIDATED_BILLING
輸出包含有關新組織詳細資訊的組織物件:
{
"Organization": {
"Arn": "arn:aws:organizations::111111111111:organization/o-exampleorgid",
"AvailablePolicyTypes": [],
"Id": "o-exampleorgid",
"MasterAccountArn": "arn:aws:organizations::111111111111:account/o-exampleorgid/111111111111",
"MasterAccountEmail": "bill@example.com",
"MasterAccountId": "111111111111",
"FeatureSet": "CONSOLIDATED_BILLING"
}
}
如需詳細資訊,請參閱 AWS Organizations 使用者指南。
建立組織之後,您可以透過下列方式從管理帳戶將帳戶新增至組織: