

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Snowball Edge의 Amazon S3 호환 스토리지에 있는 버킷의 객체 삭제
<a name="objects-delete-s3-snow"></a>

Amazon S3 compatible storage on Snowball Edge 버킷에서 하나 이상의 객체를 삭제할 수 있습니다. 다음 예시에서는 AWS CLI를 사용하여 {{sample-object.xml}} 이름의 객체를 삭제합니다. 이 명령을 사용하려면 각각의 사용자 입력 자리 표시자를 사용자의 정보로 바꿉니다.

```
aws s3api delete-object --bucket {{sample-bucket}} --key {{key}} --endpoint-url {{s3api-endpoint-ip}} --profile {{your-profile}}
```

이 명령에 대한 자세한 내용은 *AWS CLI Command Reference*의 [delete-object](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3control/delete-object.html) 섹션을 참조하세요.

다음 Amazon S3 compatible storage on Snowball Edge 예제에서는 SDK for Java를 사용하여 버킷의 객체를 삭제합니다. 이 예시를 사용하려면 삭제할 객체의 키 이름을 지정합니다. 자세한 내용은 Amazon Simple Storage Service API Reference에서 [DeleteObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) 섹션을 참조하세요.

```
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.DeleteObjectRequest;

public class DeleteObject {
    public static void main(String[] args) {
        String bucketName = "*** Bucket name ***";
        String keyName = "*** key name ****";

        try {
            // This code expects that you have AWS credentials set up per:
            // https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html
            AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
                    .enableUseArnRegion()
                    .build();

            DeleteObjectRequest deleteObjectRequest = DeleteObjectRequest.builder()
                    .bucket(bucketName)
                    .key(keyName)
                    .build()));
            s3Client.deleteObject(deleteObjectRequest);
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 couldn't process
            // it, so it 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();
        }
    }
}
```