I am looking at the aws sdk-for-go developer guide to delete an object.
Sample Code
_, err = svc.DeleteObject(&s3.DeleteObjectInput{Bucket: aws.String(bucket), Key: aws.String(obj)})
if err != nil {
exitErrorf("Unable to delete object %q from bucket %q, %v", obj, bucket, err)
}
err = svc.WaitUntilObjectNotExists(&s3.HeadObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(obj),
})
As seen above, the example calls the delete object API followed by wait till object does not exists
I have below questions related to this:
- After calling the delete API why is it necessary to wait and check if it is deleted ?
- How long does it wait for the check? (What is the max window ?). How frequently does it check?
Could not find anything in the AWS documentation which answers this.
You'll be happy to know that in Go V2 no such waiter exists. It only supplies a waiter on object existence, which is what you need when creating a resource.