대시보드에 S3 Storage Lens 그룹 연결 또는 제거하기
대시보드에 S3 Storage Lens 그룹 연결 또는 제거하기
Amazon S3 Storage Lens의 고급(advanced) 계층으로 업그레이드한 후에는 Storage Lens 그룹을 대시보드에 연결할 수 있어요. Storage Lens 그룹이 여러 개 있으면 원하는 그룹을 포함하거나 제외할 수 있어요.
출처: Attaching or removing S3 Storage Lens groups to or from your dashboard
Storage Lens 그룹은 대시보드 계정의 지정된 홈 리전 안에 있어야 해요. Storage Lens 그룹을 대시보드에 연결한 후에는 48시간 내에 지표 내보내기에 추가 Storage Lens 그룹 집계 데이터를 받게 돼요.
참고: Storage Lens 그룹의 집계 지표를 보려면 그룹을 Storage Lens 대시보드에 연결해야 해요. Storage Lens 그룹 JSON 구성 파일 예시는 S3 Storage Lens 그룹이 포함된 S3 Storage Lens JSON 예시 구성을 참조해 주세요.
Storage Lens 그룹을 Storage Lens 대시보드에 연결하려면
- AWS Management Console에 로그인하고 https://console.aws.amazon.com/s3/ 에서 Amazon S3 콘솔을 엽니다.
- 왼쪽 탐색 창에서 Storage Lens 아래의 Dashboards를 선택합니다.
- Storage Lens 그룹을 연결하려는 Storage Lens 대시보드의 옵션 버튼을 선택합니다.
- Edit을 선택합니다.
- Metrics selection 아래에서 Advanced metrics and recommendations를 선택합니다.
- Storage Lens group aggregation을 선택합니다.
참고: 기본적으로 Advanced metrics도 선택됩니다. 다만 이 설정은 Storage Lens 그룹 데이터를 집계하는 데 필요하지 않으므로 선택 해제할 수도 있습니다.
- Storage Lens group aggregation까지 아래로 스크롤해 데이터 집계에 포함하거나 제외하려는 Storage Lens 그룹을 지정합니다. 다음 필터링 옵션을 사용할 수 있습니다.
- 특정 Storage Lens 그룹을 포함하려면 Include Storage Lens groups를 선택합니다. Storage Lens groups to include 아래에서 Storage Lens 그룹을 선택합니다.
- 모든 Storage Lens 그룹을 포함하려면 Include all Storage Lens groups in home Region in this account를 선택합니다.
- 특정 Storage Lens 그룹을 제외하려면 Exclude Storage Lens groups를 선택합니다. Storage Lens groups to exclude 아래에서 제외하려는 Storage Lens 그룹을 선택합니다.
- Save changes를 선택합니다. Storage Lens 그룹을 올바르게 구성했다면 48시간 내에 대시보드에 추가 Storage Lens 그룹 집계 데이터가 표시됩니다.
S3 Storage Lens 대시보드에서 Storage Lens 그룹을 제거하려면
- AWS Management Console에 로그인하고 https://console.aws.amazon.com/s3/ 에서 Amazon S3 콘솔을 엽니다.
- 왼쪽 탐색 창에서 Storage Lens 아래의 Dashboards를 선택합니다.
- Storage Lens 그룹을 제거하려는 Storage Lens 대시보드의 옵션 버튼을 선택합니다.
- View dashboard configuration을 선택합니다.
- Edit을 선택합니다.
- Metrics selection 섹션까지 아래로 스크롤합니다.
- Storage Lens group aggregation 아래에서 제거하려는 Storage Lens 그룹 옆의 X를 선택합니다. 이렇게 하면 Storage Lens 그룹이 제거됩니다.
대시보드에 모든 Storage Lens 그룹을 포함했다면 Include all Storage Lens groups in home Region in this account 옆의 확인란을 해제합니다.
- Save changes를 선택합니다.
참고: 대시보드가 구성 업데이트를 반영하는 데 최대 48시간이 걸릴 수 있습니다.
예시 - 모든 Storage Lens 그룹을 대시보드에 연결
다음 SDK for Java 예시는 계정 111122223333의 모든 Storage Lens 그룹을 DashBoardConfigurationId 대시보드에 연결해요.
package aws.example.s3control;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.s3control.AWSS3Control;
import com.amazonaws.services.s3control.AWSS3ControlClient;
import com.amazonaws.services.s3control.model.BucketLevel;
import com.amazonaws.services.s3control.model.PutStorageLensConfigurationRequest;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.services.s3control.model.AccountLevel;
import com.amazonaws.services.s3control.model.StorageLensConfiguration;
import com.amazonaws.services.s3control.model.StorageLensGroupLevel;
import static com.amazonaws.regions.Regions.US_WEST_2;
public class CreateDashboardWithStorageLensGroups {
public static void main(String[] args) {
String configurationId = "ExampleDashboardConfigurationId";
String sourceAccountId = "111122223333";
try {
StorageLensGroupLevel storageLensGroupLevel = new StorageLensGroupLevel();
AccountLevel accountLevel = new AccountLevel()
.withBucketLevel(new BucketLevel())
.withStorageLensGroupLevel(storageLensGroupLevel);
StorageLensConfiguration configuration = new StorageLensConfiguration()
.withId(configurationId)
.withAccountLevel(accountLevel)
.withIsEnabled(true);
AWSS3Control s3ControlClient = AWSS3ControlClient.builder()
.withCredentials(new ProfileCredentialsProvider())
.withRegion(US_WEST_2)
.build();
s3ControlClient.putStorageLensConfiguration(new PutStorageLensConfigurationRequest()
.withAccountId(sourceAccountId)
.withConfigId(configurationId)
.withStorageLensConfiguration(configuration)
);
} 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 그룹 두 개를 대시보드에 연결
다음 AWS SDK for Java 예시는 Storage Lens 그룹 두 개(StorageLensGroupName1과 StorageLensGroupName2)를 ExampleDashboardConfigurationId 대시보드에 연결해요.
package aws.example.s3control;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.services.s3control.AWSS3Control;
import com.amazonaws.services.s3control.AWSS3ControlClient;
import com.amazonaws.services.s3control.model.AccountLevel;
import com.amazonaws.services.s3control.model.BucketLevel;
import com.amazonaws.services.s3control.model.PutStorageLensConfigurationRequest;
import com.amazonaws.services.s3control.model.StorageLensConfiguration;
import com.amazonaws.services.s3control.model.StorageLensGroupLevel;
import com.amazonaws.services.s3control.model.StorageLensGroupLevelSelectionCriteria;
import static com.amazonaws.regions.Regions.US_WEST_2;
public class CreateDashboardWith2StorageLensGroups {
public static void main(String[] args) {
String configurationId = "ExampleDashboardConfigurationId";
String storageLensGroupName1 = "StorageLensGroupName1";
String storageLensGroupName2 = "StorageLensGroupName2";
String sourceAccountId = "111122223333";
try {
StorageLensGroupLevelSelectionCriteria selectionCriteria = new StorageLensGroupLevelSelectionCriteria()
.withInclude(
"arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName1,
"arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName2);
System.out.println(selectionCriteria);
StorageLensGroupLevel storageLensGroupLevel = new StorageLensGroupLevel()
.withSelectionCriteria(selectionCriteria);
AccountLevel accountLevel = new AccountLevel()
.withBucketLevel(new BucketLevel())
.withStorageLensGroupLevel(storageLensGroupLevel);
StorageLensConfiguration configuration = new StorageLensConfiguration()
.withId(configurationId)
.withAccountLevel(accountLevel)
.withIsEnabled(true);
AWSS3Control s3ControlClient = AWSS3ControlClient.builder()
.withCredentials(new ProfileCredentialsProvider())
.withRegion(US_WEST_2)
.build();
s3ControlClient.putStorageLensConfiguration(new PutStorageLensConfigurationRequest()
.withAccountId(sourceAccountId)
.withConfigId(configurationId)
.withStorageLensConfiguration(configuration)
);
} 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 그룹 연결
다음 SDK for Java 예시는 지정된 두 그룹(StorageLensGroupName1과 StorageLensGroupName2)을 제외하고 모든 Storage Lens 그룹을 ExampleDashboardConfigurationId 대시보드에 연결해요.
package aws.example.s3control;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.services.s3control.AWSS3Control;
import com.amazonaws.services.s3control.AWSS3ControlClient;
import com.amazonaws.services.s3control.model.AccountLevel;
import com.amazonaws.services.s3control.model.BucketLevel;
import com.amazonaws.services.s3control.model.PutStorageLensConfigurationRequest;
import com.amazonaws.services.s3control.model.StorageLensConfiguration;
import com.amazonaws.services.s3control.model.StorageLensGroupLevel;
import com.amazonaws.services.s3control.model.StorageLensGroupLevelSelectionCriteria;
import static com.amazonaws.regions.Regions.US_WEST_2;
public class CreateDashboardWith2StorageLensGroupsExcluded {
public static void main(String[] args) {
String configurationId = "ExampleDashboardConfigurationId";
String storageLensGroupName1 = "StorageLensGroupName1";
String storageLensGroupName2 = "StorageLensGroupName2";
String sourceAccountId = "111122223333";
try {
StorageLensGroupLevelSelectionCriteria selectionCriteria = new StorageLensGroupLevelSelectionCriteria()
.withInclude(
"arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName1,
"arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName2);
System.out.println(selectionCriteria);
StorageLensGroupLevel storageLensGroupLevel = new StorageLensGroupLevel()
.withSelectionCriteria(selectionCriteria);
AccountLevel accountLevel = new AccountLevel()
.withBucketLevel(new BucketLevel())
.withStorageLensGroupLevel(storageLensGroupLevel);
StorageLensConfiguration configuration = new StorageLensConfiguration()
.withId(configurationId)
.withAccountLevel(accountLevel)
.withIsEnabled(true);
AWSS3Control s3ControlClient = AWSS3ControlClient.builder()
.withCredentials(new ProfileCredentialsProvider())
.withRegion(US_WEST_2)
.build();
s3ControlClient.putStorageLensConfiguration(new PutStorageLensConfigurationRequest()
.withAccountId(sourceAccountId)
.withConfigId(configurationId)
.withStorageLensConfiguration(configuration)
);
} 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 그룹 만들기