모든 Storage Lens 그룹 나열하기

모든 Storage Lens 그룹 나열하기

다음 예시는 AWS 계정과 홈 리전의 모든 Amazon S3 Storage Lens 그룹을 나열하는 방법을 보여줘요. Amazon S3 콘솔, AWS Command Line Interface(AWS CLI), AWS SDK for Java로 모든 Storage Lens 그룹을 나열하는 방법을 보여주는 예시예요.

출처: Listing all Storage Lens groups

계정과 홈 리전의 모든 Storage Lens 그룹을 나열하려면

  1. AWS Management Console에 로그인하고 https://console.aws.amazon.com/s3/ 에서 Amazon S3 콘솔을 엽니다.
  2. 왼쪽 탐색 창에서 Storage Lens groups를 선택합니다.
  3. Storage Lens groups 아래에 계정의 Storage Lens 그룹 목록이 표시됩니다.

다음 AWS CLI 예시는 계정의 모든 Storage Lens 그룹을 나열해요. 이 예시 명령을 사용하려면 입력 자리 표시자(user input placeholders)를 자신의 정보로 바꿔주세요.

aws s3control list-storage-lens-groups --account-id 111122223333 \
--region us-east-1

다음 AWS SDK for Java 예시는 계정 111122223333의 Storage Lens 그룹을 나열해요. 이 예시를 사용하려면 입력 자리 표시자(user input placeholders)를 자신의 정보로 바꿔주세요.

package aws.example.s3control;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3control.S3ControlClient;
import software.amazon.awssdk.services.s3control.model.ListStorageLensGroupsRequest;
import software.amazon.awssdk.services.s3control.model.ListStorageLensGroupsResponse;

public class ListStorageLensGroups {
    public static void main(String[] args) {
        String accountId = "111122223333";

        try {
            ListStorageLensGroupsRequest listStorageLensGroupsRequest = ListStorageLensGroupsRequest.builder()
                    .accountId(accountId)
                    .build();
            S3ControlClient s3ControlClient = S3ControlClient.builder()
                    .region(Region.US_WEST_2)
                    .credentialsProvider(ProfileCredentialsProvider.create())
                    .build();
            ListStorageLensGroupsResponse response = s3ControlClient.listStorageLensGroups(listStorageLensGroupsRequest);
            System.out.println(response);
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 couldn't process
            // it and returned an error response.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // Amazon S3 couldn't be contacted for a response, or the client
            // couldn't parse the response from Amazon S3.
            e.printStackTrace();
        }
    }
}

더 알아보기

  • Storage Lens 그룹 세부 정보 보기
  • Storage Lens 그룹 삭제하기