

# 모든 Storage Lens 그룹 목록
<a name="storage-lens-groups-list"></a>

다음 예제에서는 AWS 계정 및 홈 리전 내의 모든 Amazon S3 Storage Lens 그룹을 나열하는 방법을 보여줍니다. 이 예제는 Amazon S3 콘솔, AWS Command Line Interface(AWS CLI) 및 AWS SDK for Java를 사용하여 모든 Storage Lens 그룹을 나열하는 방법을 보여줍니다.

## S3 콘솔 사용
<a name="storage-lens-group-list-console"></a>

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

1. AWS Management Console에 로그인한 후 [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/)에서 S3 콘솔을 엽니다.

1. 왼쪽 탐색 창에서 **스토리지 렌즈 그룹**을 선택합니다.

1. **Storage Lens 그룹** 아래에 계정의 Storage Lens 그룹 목록이 표시됩니다.

## AWS CLI 사용
<a name="storage-lens-groups-list-cli"></a>

다음 AWS CLI 예제는 계정의 모든 Storage Lens 그룹을 나열합니다. 이 예시 명령을 사용하려면 `user input placeholders`를 실제 정보로 대체하십시오.

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

## Java용 AWS SDK 사용
<a name="storage-lens-groups-list-sdk-java"></a>

다음 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();
        }
    }
}
```