Storage Lens 그룹 태그 목록
다음 예는 Storage Lens 그룹과 관련된 AWS 리소스 태그를 나열하는 방법을 보여줍니다. Amazon S3 콘솔, AWS Command Line Interface(AWS CLI) 및 AWS SDK for Java을 사용하여 태그를 나열할 수 있습니다.
Storage Lens 그룹의 태그 및 태그 값 목록을 검토하려면
AWS Management Console에 로그인한 후 https://console.aws.amazon.com/s3/
에서 Amazon S3 콘솔을 엽니다. -
왼쪽 탐색 창에서 스토리지 렌즈 그룹을 선택합니다.
-
Storage Lens 그룹에서 관심 있는 Storage Lens 그룹을 선택합니다.
-
아래로 스크롤하여 AWS 리소스 태그 섹션으로 이동합니다. Storage Lens 그룹에 추가된 모든 사용자 정의 AWS 리소스 태그가 해당 태그 값과 함께 나열됩니다.
다음 AWS CLI 예제 명령은
라는 이름의 Storage Lens 그룹의 모든 Storage Lens 그룹 태그 값을 나열합니다. 이 예 명령을 사용하려면 marketing-department
를 실제 정보로 대체하세요.user input
placeholders
aws s3control list-tags-for-resource --account-id
111122223333
\ --resource-arn arn:aws:s3:us-east-1
:111122223333
:storage-lens-group/marketing-department
\ --regionus-east-1
다음 AWS SDK for Java 예제는 지정한 Storage Lens 그룹 Amazon 리소스 이름(ARN)의 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.ListTagsForResourceRequest; import software.amazon.awssdk.services.s3control.model.ListTagsForResourceResponse; public class ListTagsForResource { public static void main(String[] args) { String resourceARN = "
Resource_ARN
"; String accountId = "111122223333
"; try { ListTagsForResourceRequest listTagsForResourceRequest = ListTagsForResourceRequest.builder() .resourceArn(resourceARN
) .accountId(accountId
) .build(); S3ControlClient s3ControlClient = S3ControlClient.builder() .region(Region.US_WEST_2
) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); ListTagsForResourceResponse response = s3ControlClient.listTagsForResource(listTagsForResourceRequest); 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(); } } }