

# 組織または組織単位の ARN を取得する
<a name="get-org-ou-ARN"></a>

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

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

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "organizations:Describe*"
            ],
            "Resource": "*"
        }
    ]
}
```

------

------
#### [ AWS CLI ]

**組織の ARN を取得するには**  
[https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organization.html](https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organization.html) コマンドを使用します。組織 ARN のみを返す `--query` オプションを追加します。

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

出力例を次に示します。

```
"arn:aws:organizations::123456789012:organization/o-1234567abc"
```

**組織単位の ARN を取得するには**  
[https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organizational-unit.html](https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organizational-unit.html) コマンドを使用します。`--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](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-ORGOrganization.html) コマンドレットを使用します。

```
(Get-ORGOrganization).Arn
```

出力例を次に示します。

```
arn:aws:organizations::123456789012:organization/o-1234567abc
```

**組織単位の ARN を取得するには**  
[Get-ORGOrganizationalUnit](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-ORGOrganizationalUnit.html) コマンドレットを使用します。

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

出力例を次に示します。

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

------