Storage Lens 대시보드 태그 업데이트
다음 예제는 Amazon S3 콘솔, AWS Command Line Interface(AWS CLI) 및 AWS SDK for Java을 사용하여 Storage Lens 대시보드 태그를 업데이트하는 방법을 보여줍니다.
Storage Lens 대시보드의 AWS 리소스 태그를 업데이트하려면
AWS Management Console에 로그인한 후 https://console.aws.amazon.com/s3/
에서 Amazon S3 콘솔을 엽니다. -
왼쪽 탐색 창에서 Storage Lens로 이동합니다.
-
대시보드를 선택합니다.
-
보려는 Storage Lens 대시보드 구성의 라디오 버튼을 선택합니다. 그런 다음 대시보드 구성 보기를 선택합니다.
-
태그에서 대시보드와 연결된 태그를 검토합니다.
(선택 사항) 새 태그를 추가하려면 편집을 선택합니다. 그런 다음 태그 추가를 선택합니다. 태그 추가 페이지에서 새 키-값 쌍을 추가합니다.
참고
기존 태그와 동일한 키가 있는 새 태그를 추가하면 이전 태그 값을 덮어씁니다.
-
(선택 사항) 새로 추가된 항목을 제거하려면 제거하려는 태그 옆의 제거를 선택합니다.
-
Save changes(변경 사항 저장)를 선택합니다.
다음 예제 명령은 기존 Amazon S3 Storage Lens 대시보드 구성에 태그를 추가하거나 교체합니다. 이러한 예시를 사용하려면
를 실제 정보로 대체하십시오.user input placeholders
aws s3control put-storage-lens-configuration-tagging --account-id=
111122223333
--config-id=example-dashboard-configuration-id
--region=us-east-1
--config-id=your-configuration-id
다음 AWS SDK for Java 예제는 기존 Storage Lens 대시보드의 AWS 리소스 태그를 업데이트합니다. 이 예제를 사용하려면
를 사용자의 정보로 대체합니다.user input
placeholders
예 - 기존 Storage Lens 대시보드 구성의 태그 업데이트
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.PutStorageLensConfigurationTaggingRequest; import com.amazonaws.services.s3control.model.StorageLensTag; import java.util.Arrays; import java.util.List; import static com.amazonaws.regions.Regions.
US_WEST_2
; public class PutDashboardTagging { public static void main(String[] args) { String configurationId = "ConfigurationId
"; String sourceAccountId = "111122223333
"; try { List<StorageLensTag> tags = Arrays.asList( new StorageLensTag().withKey("key-1
").withValue("value-1
"), new StorageLensTag().withKey("key-2
").withValue("value-2
") ); AWSS3Control s3ControlClient = AWSS3ControlClient.builder() .withCredentials(new ProfileCredentialsProvider()) .withRegion(US_WEST_2
) .build(); s3ControlClient.putStorageLensConfigurationTagging(new PutStorageLensConfigurationTaggingRequest() .withAccountId(sourceAccountId) .withConfigId(configurationId) .withTags(tags) ); } 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(); } } }