S3 Storage Lens 대시보드에서 AWS 리소스 태그 삭제

S3 Storage Lens 대시보드에서 AWS 리소스 태그 삭제

다음 예제는 기존 Storage Lens 대시보드에서 AWS 리소스 태그를 삭제하는 방법을 보여줘요. Amazon S3 콘솔, AWS Command Line Interface(AWS CLI), AWS SDK for Java로 태그를 삭제할 수 있어요.

출처: Deleting AWS resource tags from a S3 Storage Lens dashboard

본문

기존 Storage Lens 대시보드에서 AWS 리소스 태그 삭제

  1. AWS Management Console에 로그인하고 Amazon S3 콘솔(https://console.aws.amazon.com/s3/)을 엽니다.
  2. 왼쪽 탐색 창에서 Storage Lens 로 이동합니다.
  3. 대시보드(Dashboards) 를 선택합니다.
  4. 보려는 Storage Lens 대시보드 구성의 라디오 버튼을 선택합니다. 그런 다음 대시보드 구성 보기(View dashboard configuration) 를 선택합니다.
  5. 태그(Tags) 아래에서 대시보드와 연결된 태그를 검토합니다.
  6. 제거할 태그 옆의 제거(Remove) 를 선택합니다.
  7. 변경 사항 저장(Save changes) 을 선택합니다.

예제

다음 AWS CLI 명령은 기존 Storage Lens 대시보드에서 AWS 리소스 태그를 삭제해요. 이 예제 명령을 사용하려면 사용자 입력 자리 표시자를 자신의 정보로 교체하세요.

aws s3control delete-storage-lens-configuration-tagging --account-id= 222222222222 --config-id= your-configuration-id --region= us-east-1

다음 AWS SDK for Java 예제는 계정 111122223333에서 지정한 Amazon 리소스 이름(ARN)을 사용해 Storage Lens 대시보드에서 AWS 리소스 태그를 삭제해요. 이 예제를 사용하려면 사용자 입력 자리 표시자를 자신의 정보로 교체하세요.

예제: S3 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.DeleteStorageLensConfigurationTaggingRequest;

import static com.amazonaws.regions.Regions. US_WEST_2 ;

public class DeleteDashboardTagging {
    public static void main(String[] args) {
        String configurationId = " ConfigurationId ";
        String sourceAccountId = " 111122223333 ";
        try {
            AWSS3Control s3ControlClient = AWSS3ControlClient.builder()
                    .withCredentials(new ProfileCredentialsProvider())
                    .withRegion( US_WEST_2 )
                    .build();

            s3ControlClient.deleteStorageLensConfigurationTagging(new DeleteStorageLensConfigurationTaggingRequest()
                    .withAccountId(sourceAccountId)
                    .withConfigId(configurationId)
            );
        } 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();
        }
    }
}

더 알아보기