스토리지 렌즈 그룹에서 AWS 리소스 태그 삭제 - Amazon Simple Storage Service

스토리지 렌즈 그룹에서 AWS 리소스 태그 삭제

다음 예제에서는 스토리지 렌즈 그룹에서 AWS 리소스 태그를 삭제하는 방법을 보여줍니다. Amazon S3 콘솔, AWS Command Line Interface(AWS CLI) 및 AWS SDK for Java를 사용하여 태그를 삭제할 수 있습니다.

스토리지 렌즈 그룹에서 AWS 리소스 태그를 삭제하려면
  1. AWS Management Console에 로그인한 후 https://console.aws.amazon.com/s3/에서 Amazon S3 콘솔을 엽니다.

  2. 왼쪽 탐색 창에서 스토리지 렌즈 그룹을 선택합니다.

  3. 스토리지 렌즈 그룹에서 업데이트하려는 스토리지 렌즈 그룹을 선택합니다.

  4. AWS 리소스 태그 아래에서 삭제하려는 키-값 페어를 선택합니다.

  5. 삭제를 선택합니다. AWS 리소스 태그 삭제 대화 상자가 나타납니다.

    참고

    태그를 사용하여 액세스를 제어하는 경우 이 작업을 진행하면 관련 리소스에 영향이 미칠 수 있습니다. 영구 삭제한 태그는 복원할 수 없습니다.

  6. 삭제를 선택하여 키-값 페어를 영구적으로 삭제합니다.

다음 AWS CLI 명령은 기존 스토리지 렌즈 그룹에서 두 개의 AWS 리소스 태그를 삭제합니다. 이 예제 명령을 사용하려면 자체 정보로 user input placeholders를 바꿉니다.

aws s3control untag-resource --account-id 111122223333 \ --resource-arn arn:aws:s3:us-east-1:111122223333:storage-lens-group/Marketing-Department \ --region us-east-1 --tag-keys k1 k2

다음 AWS SDK for Java 예제에서는 스토리지 렌즈 그룹 Amazon 리소스 이름(ARN)에서 계정 111122223333에서 지정한 AWS 리소스 태그 두 개를 삭제합니다. 이 예제를 사용하려면 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.UntagResourceRequest; public class UntagResource { public static void main(String[] args) { String resourceARN = "Resource_ARN"; String accountId = "111122223333"; try { String tagKey1 = "resource-tag-key-1"; String tagKey2 = "resource-tag-key-2"; UntagResourceRequest untagResourceRequest = UntagResourceRequest.builder() .resourceArn(resourceARN) .tagKeys(tagKey1, tagKey2) .accountId(accountId) .build(); S3ControlClient s3ControlClient = S3ControlClient.builder() .region(Region.US_WEST_2) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); s3ControlClient.untagResource(untagResourceRequest); } 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(); } } }