View a markdown version of this page

为 S3 Storage Lens 存储统计管理工具禁用可信访问权限 - Amazon Simple Storage Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)。

为 S3 Storage Lens 存储统计管理工具禁用可信访问权限

以委派管理员身份移除账户或禁用可信访问权限,会将账户拥有者的 S3 Storage Lens 存储统计管理工具控制面板指标限制为仅在账户级别起作用。然后,每个账户持有人所能看到的 S3 Storage Lens 存储统计管理工具的优势仅限于其账户的有限范围,而不是整个组织范围。

在 S3 Storage Lens 存储统计管理工具中禁用可信访问权限时,任何需要可信访问权限的控制面板都不再更新。所创建的任何组织控制面板也不再更新。相反,您只能查询 S3 Storage Lens 存储统计管理工具控制面板的历史数据(当这些数据仍然可用时)。

注意
  • 禁用对 S3 Storage Lens 存储统计管理工具的可信访问还会自动阻止所有组织级控制面板收集和聚合存储指标。这是因为 S3 Storage Lens 存储统计管理工具不再对组织账户拥有可信访问权限。

  • 管理账户和委派管理员账户仍可以查看任何禁用的控制面板的历史数据。这些账户还可以在历史数据仍可用时查询这些数据。

为 S3 Storage Lens 存储统计管理工具禁用可信访问权限
  1. 登录到 Amazon Web Services 管理控制台,然后通过以下网址打开 Amazon S3 控制台:https://console.aws.amazon.com/s3/。

  2. 在左侧导航窗格中,导航到 Storage Lens 存储统计管理工具。

  3. 选择 Amazon Organizations 设置。将显示 Storage Lens 存储统计管理工具的 Amazon Organizations 访问权限页面。

  4. 在 Amazon Organizations 可信访问权限下,选择编辑。

    将显示 Amazon Organizations 访问权限页面。

  5. 选择禁用,以便为 S3 Storage Lens 存储统计管理工具控制面板禁用可信访问权限。

  6. 选择保存更改。

例

以下示例使用 Amazon CLI 为 S3 Storage Lens 存储统计管理工具禁用可信访问权限。

aws organizations disable-aws-service-access --service-principal storage-lens.s3.amazonaws.com
例– 为 S3 Storage Lens 存储统计管理工具禁用 Amazon Organizations 可信访问权限

以下示例显示了如何在适用于 Java 的 SDK 中为 S3 Storage Lens 存储统计管理工具禁用 Amazon Organizations 可信访问权限。要使用此示例,请将 user input placeholders 替换为您自己的信息。

import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.regions.Regions; import com.amazonaws.services.organizations.AWSOrganizations; import com.amazonaws.services.organizations.AWSOrganizationsClient; import com.amazonaws.services.organizations.model.DisableAWSServiceAccessRequest; public class DisableOrganizationsTrustedAccess { private static final String S3_STORAGE_LENS_SERVICE_PRINCIPAL = "storage-lens.s3.amazonaws.com"; public static void main(String[] args) { try { AWSOrganizations organizationsClient = AWSOrganizationsClient.builder() .withCredentials(new ProfileCredentialsProvider()) .withRegion(Regions.US_EAST_1) .build(); // Make sure to remove any existing delegated administrator for S3 Storage Lens // before disabling access; otherwise, the request will fail. organizationsClient.disableAWSServiceAccess(new DisableAWSServiceAccessRequest() .withServicePrincipal(S3_STORAGE_LENS_SERVICE_PRINCIPAL)); } catch (AmazonServiceException e) { // The call was transmitted successfully, but Amazon Organizations couldn't process // it and returned an error response. e.printStackTrace(); } catch (SdkClientException e) { // Amazon Organizations couldn't be contacted for a response, or the client // couldn't parse the response from Amazon Organizations. e.printStackTrace(); } } }