

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 错误：“UnknownResourceException”
<a name="tshoot-unknown-resource"></a>

## 场景
<a name="tshoot-unknown-resource-scenario"></a>

您会收到以下错误之一：
+ “CannotCreateResourceShare: UnknownResourceException: OrganizationalUnit 你-*xxxx* 找不到”
+ “CannotUpdateResourceShare: UnknownResourceException: OrganizationalUnit 你-*xxxx* 找不到”。

## 原因
<a name="tshoot-unknown-resource-cause"></a>

如果您使用 Organizations [控制台或 Organizations Enable A AWSService ccess API 而不是[使用](getting-started-sharing.md#getting-started-sharing-orgs)控制台来启用 AWS RAM](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.htm)和 AWS Organizations 之间的集成，则可能会发生这些错误。 AWS RAM 当您使用 Organizations 控制台或 API 启用集成时，该服务不会在您的账户中创建 `AWSServiceRoleForResourceAccessManager` 角色。需要该角色才能访问有关您组织的信息。由于该角色尚未创建，因此 AWS RAM 无法访问有关组织中账户或组织单位 (OUs) 的详细信息。

## 解决方案
<a name="tshoot-unknown-resource-fix"></a>

要解决此问题，请关闭 AWS RAM 和之间的集成 AWS Organizations。然后通过调用 AWS RAM [EnableSharingWithAwsOrganization](https://docs.aws.amazon.com/ram/latest/APIReference/API_EnableSharingWithAwsOrganization.html)API 操作或使用执行以下步骤再次将其打开。 AWS 管理控制台 

**重要**  
禁用对的可信访问权限后 AWS Organizations，组织内的委托人将从所有资源共享中删除，并失去对这些共享资源的访问权限。

1. 使用具有管理权限的 IAM 角色或用户登录您组织的管理账户。

1. 在[AWS Organizations 控制台中导航到服务页面](https://console.aws.amazon.com/organizations/v2/home/services)。

1. 选择 **RAM**。

1. 选择 **Disable trusted access（禁用信任访问权限）**。

1. 导航到[AWS RAM 控制台中的 “设置” 页面](https://console.aws.amazon.com/ram/home#Settings:)。

1. 选中 “**启用与之共享**” 复选框 AWS Organizations，然后选择 “**保存设置”**。

现在，您应该 AWS RAM 能够使用与账户和 OUs组织内部共享您的资源。