啟用 S3 Storage Lens 的受信任存取權 - Amazon Simple Storage Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

啟用 S3 Storage Lens 的受信任存取權

透過啟用受信任存取,您可以允許 Amazon S3 Storage Lens 透過 AWS Organizations API 操作存取您的 AWS Organizations 階層、成員資格和結構。然後,S3 Storage Lens 成為整個組織結構的受信任服務。

每當建立儀表板組態時,S3 Storage Lens 會在您組織的管理或委派管理員帳戶中建立服務連結角色。服務連結角色授予 S3 Storage Lens 執行下列動作的許可:

  • 描述組織

  • 列出帳戶

  • 驗證組織的 AWS 服務 存取清單

  • 取得組織的委派管理員

然後,S3 Storage Lens 可以確保其擁有存取權,以收集組織中帳戶的跨帳戶指標。如需詳細資訊,請參閱在 Amazon S3 Storage Lens 使用服務連結角色

啟用受信任存取權之後,您就可以將委派管理員存取權指派給組織中的帳戶。將帳戶標示為服務的委派管理員時,帳戶會收到所有唯讀組織 API 操作的存取授權。此存取權會提供組織成員和結構的委派管理員可見性,讓他們也可以建立 S3 Storage Lens 儀表板。

注意
  • 受信任存取權只能由管理帳戶啟用。

  • 只有管理帳戶和委派的管理員可以為您的組織建立 S3 Storage Lens 儀表板或組態。

讓 S3 Storage Lens 擁有 AWS Organizations 受信任的存取
  1. 登入 AWS Management Console ,並在 https://console.aws.amazon.com/s3/:// 開啟 Amazon S3 主控台。

  2. 在左側導覽窗格上,導覽至 Storage Lens

  3. 選擇 AWS Organizations 設定Storage Lens 的AWS Organizations 存取頁面隨即顯示。

  4. AWS Organizations 受信任存取下,選擇編輯

    AWS Organizations 存取頁面隨即顯示。

  5. 選擇啟用以啟用 S3 Storage Lens 儀表板的受信任存取。

  6. 選擇 Save changes (儲存變更)。

下列範例示範如何啟用 S3 Storage Lens 的 AWS Organizations 信任存取 AWS CLI。

aws organizations enable-aws-service-access --service-principal storage-lens.s3.amazonaws.com
範例 – 使用適用於 Java 的 SDK 啟用 S3 Storage Lens 的 AWS Organizations 受信任存取

下列範例示範如何在適用於 Java 的 SDK 中啟用 S3 Storage Lens 的受信任存取。若要使用此範例,請以您自己的資訊取代 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.EnableAWSServiceAccessRequest; public class EnableOrganizationsTrustedAccess { 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(); organizationsClient.enableAWSServiceAccess(new EnableAWSServiceAccessRequest() .withServicePrincipal(S3_STORAGE_LENS_SERVICE_PRINCIPAL)); } catch (AmazonServiceException e) { // The call was transmitted successfully, but AWS Organizations couldn't process // it and returned an error response. e.printStackTrace(); } catch (SdkClientException e) { // AWS Organizations couldn't be contacted for a response, or the client // couldn't parse the response from AWS Organizations. e.printStackTrace(); } } }