Enabling trusted access for Amazon S3 Storage Lens for Tables
By enabling trusted access, you allow Amazon S3 Storage Lens for Tables to access your AWS Organizations hierarchy, membership, and structure through AWS Organizations API operations. Amazon S3 Storage Lens for Tables then becomes a trusted service for your entire organization's structure.
Amazon S3 Storage Lens for Tables uses the same AWS Organizations trusted access as general-purpose Amazon S3 Storage Lens. You enable trusted access one time, and it covers both your general-purpose Storage Lens dashboards and your Storage Lens for Tables dashboards. Likewise, when you register a delegated administrator, that registration applies to both.
Whenever a dashboard configuration is created, Amazon S3 Storage Lens for Tables creates service-linked roles in your organization's management or delegated administrator accounts. The service-linked role grants Amazon S3 Storage Lens for Tables permission to perform the following actions:
-
Describe organizations
-
List accounts
-
Verify a list of AWS service access for the organizations
-
Get delegated administrators for the organizations
Amazon S3 Storage Lens for Tables can then ensure that it has access to collect the cross-account metrics for the accounts in your organization. For more information, see Using service-linked roles for Amazon S3 Storage Lens.
After enabling trusted access, you can assign delegated administrator access to accounts in your organization. When an account is marked as a delegated administrator for a service, the account receives authorization to access all read-only organization API operations. This access provides the delegated administrator visibility to the members and structures of your organization so that they too can create Amazon S3 Storage Lens for Tables dashboards.
-
Trusted access can only be enabled by the management account.
-
Only the management account and delegated administrators can create Amazon S3 Storage Lens for Tables dashboards or configurations for your organization.
Amazon S3 Storage Lens for Tables uses the same AWS Organizations trusted access as general-purpose Amazon S3 Storage Lens. Enabling trusted access authorizes Amazon S3 Storage Lens to access your organization hierarchy so that you can create organization-level dashboards. You must be signed in to the organization's management account.
To enable trusted access for Amazon S3 Storage Lens for Tables
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
Open the Account and organization settings page.
-
In the AWS Organizations settings for Storage Lens section, choose Edit trusted access.
-
On the AWS Organizations trusted access page, under Trusted access, choose Enable.
-
Choose Save changes.
Example
The following example shows you how to enable AWS Organizations trusted access for Amazon S3 Storage Lens for Tables in AWS CLI.
aws organizations enable-aws-service-access --service-principal storage-lens.s3.amazonaws.com
Example– Enable AWS Organizations trusted access for Amazon S3 Storage Lens for Tables using SDK for Java
The following example shows you how to enable trusted access for Amazon S3 Storage Lens for
Tables in SDK for Java. To use this example, replace the with your own information.user input
placeholders
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.organizations.OrganizationsClient; import software.amazon.awssdk.services.organizations.model.EnableAwsServiceAccessRequest; import software.amazon.awssdk.services.organizations.model.OrganizationsException; import software.amazon.awssdk.core.exception.SdkClientException; public class EnableOrganizationsTrustedAccess { private static final String S3_STORAGE_LENS_TABLES_SERVICE_PRINCIPAL = "storage-lens.s3.amazonaws.com"; public static void main(String[] args) { try (OrganizationsClient organizationsClient = OrganizationsClient.builder() .credentialsProvider(ProfileCredentialsProvider.create()) .region(Region.US_EAST_1) .build()) { organizationsClient.enableAWSServiceAccess(EnableAwsServiceAccessRequest.builder() .servicePrincipal(S3_STORAGE_LENS_TABLES_SERVICE_PRINCIPAL) .build()); } catch (OrganizationsException 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(); } } }