Amazon S3 Storage Lens의 고급 티어로 업그레이드한 후 Storage Lens 그룹을 대시보드에 연결할 수 있습니다. Storage Lens 그룹이 여러 개인 경우 원하는 그룹을 포함하거나 제외할 수 있습니다.
Storage Lens 그룹은 대시보드 계정의 지정된 홈 리전 내에 있어야 합니다. Storage Lens 그룹을 대시보드에 연결하면 48시간 이내에 지표 내보내기에서 추가 Storage Lens 그룹 집계 데이터를 받게 됩니다.
참고
Storage Lens 그룹의 집계된 지표를 보려면 Storage Lens 대시보드에 연결해야 합니다. Storage Lens 그룹 JSON 구성 파일의 예는 JSON의 Storage Lens 그룹을 사용한 S3 Storage Lens 예제 구성를 참조하십시오.
Storage Lens 그룹을 Storage Lens 대시보드에 연결하는 방법
AWS Management Console에 로그인한 후 https://console.aws.amazon.com/s3/
에서 Amazon S3 콘솔을 엽니다. -
왼쪽 탐색 창의 스토리지 렌즈에서 대시보드를 선택합니다.
-
Storage Lens 그룹을 연결하려는 Storage Lens 대시보드의 옵션 버튼을 선택합니다.
-
편집을 선택합니다.
-
지표 선택(Metrics selection)에서 고급 지표 및 권장 사항(Advanced metrics and recommendations)을 선택합니다.
-
Storage Lens 그룹 집계를 선택합니다.
참고
기본적으로 고급 지표도 선택됩니다. 하지만 Storage Lens 그룹 데이터를 집계하는 데 필요하지 않으므로 이 설정을 선택 취소할 수도 있습니다.
-
Storage Lens 그룹 집계까지 아래로 스크롤하여 데이터 집계에 포함하거나 제외하려는 Storage Lens 그룹 또는 그룹을 지정합니다. 다음 필터링 옵션을 사용할 수 있습니다.
-
특정 Storage Lens 그룹을 포함하려면 Storage Lens 그룹 포함을 선택합니다. 포함할 Storage Lens 그룹에서 Storage Lens 그룹을 선택합니다.
-
모든 Storage Lens 그룹을 포함하려면 이 계정에서 홈 리전의 모든 Storage Lens 그룹 포함을 선택합니다.
-
특정 Storage Lens 그룹을 제외하려면 Storage Lens 그룹 제외를 선택합니다. 제외할 Storage Lens 그룹에서 제외하려는 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 그룹을 제거하려는 Storage Lens 대시보드의 옵션 버튼을 선택합니다.
-
대시보드 구성 보기를 선택합니다.
-
편집을 선택합니다.
-
아래로 스크롤하여 지표 선택 섹션을 찾습니다.
-
Storage Lens 그룹 집계에서 제거하려는 Storage Lens 그룹 옆의 X를 선택합니다. 그러면 Storage Lens 그룹이 제거됩니다.
대시보드에 모든 Storage Lens 그룹을 포함한 경우 이 계정에 홈 리전의 모든 Storage Lens 그룹 포함 옆의 확인란을 선택 취소하십시오.
-
Save changes(변경 사항 저장)를 선택합니다.
참고
대시보드에 구성 업데이트가 반영되는 데 최장 48시간이 걸립니다.
예 - 모든 Storage Lens 그룹을 대시보드에 연결
다음 Java용 SDK 예제는 계정 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();
}
}
}
예 - 2개의 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 그룹 연결
다음 Java용 SDK 예제는 지정된 두 개의 그룹(StorageLensGroupName1
and 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();
}
}
}