組織または組織単位の ARN を取得する - Amazon Elastic Compute Cloud

組織または組織単位の ARN を取得する

組織と組織単位 ARN には、12 桁の管理アカウント番号が含まれています。管理アカウント番号がわからない場合は、組織と組織単位を記述して、それぞれの ARN を取得できます。以下の例では、123456789012 が管理アカウントのアカウント ID です。

必要なアクセス許可

ARN を取得する前に、組織と組織単位を記述する権限が必要です。次のポリシーで、これらの権限が付与されます。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "organizations:Describe*" ], "Resource": "*" } ] }
AWS CLI
組織の ARN を取得するには

describe-organization コマンドを使用します。組織 ARN のみを返す --query オプションを追加します。

aws organizations describe-organization --query 'Organization.Arn'

以下は出力例です。

"arn:aws:organizations::123456789012:organization/o-1234567abc"
組織単位の ARN を取得するには

describe-organizational-unit コマンドを使用します。--query パラメータを使用して、組織単位の ARN のみを返します。

aws organizations describe-organizational-unit \ --organizational-unit-id ou-a123-b4567890 \ --query 'OrganizationalUnit.Arn'

以下は出力例です。

"arn:aws:organizations::123456789012:ou/o-1234567abc/ou-a123-b4567890"
PowerShell
組織の ARN を取得するには

Get-ORGOrganization コマンドレットを使用します。

(Get-ORGOrganization).Arn

以下は出力例です。

arn:aws:organizations::123456789012:organization/o-1234567abc
組織単位の ARN を取得するには

Get-ORGOrganizationalUnit コマンドレットを使用します。

(Get-ORGOrganizationalUnit -OrganizationalUnitId "ou-a123-b4567890").Arn

以下は出力例です。

arn:aws:organizations::123456789012:ou/o-1234567abc/ou-a123-b4567890