Takes care of deleting bucket objects, so that the bucket itself can be deleted cleanly
Arguments
- bucket
(character) bucket name. required
- force
(logical) force deletion without going through the prompt. default:
FALSE
. Should only be set toTRUE
when required for non-interactive use.- ...
named parameters passed on to delete_bucket
What is magical
Exits early if bucket does not exist
Checks for any objects in the bucket and deletes any present
Deletes bucket after deleting objects
See also
Other buckets:
aws_bucket_create()
,
aws_bucket_delete()
,
aws_bucket_download()
,
aws_bucket_exists()
,
aws_bucket_list_objects()
,
aws_bucket_tree()
,
aws_bucket_upload()
,
aws_buckets()
Other magicians:
six_admin_setup()
,
six_file_upload()
,
six_user_create()
,
six_user_delete()
Examples
if (FALSE) { # interactive()
# bucket does not exist
six_bucket_delete("notabucket")
# bucket exists w/o objects
bucket <- random_string("bucket")
aws_bucket_create(bucket)
six_bucket_delete(bucket)
# bucket exists w/ objects (files and directories with files)
bucket <- random_string("bucket")
aws_bucket_create(bucket)
demo_rds_file <- file.path(system.file(), "Meta/demo.rds")
links_file <- file.path(system.file(), "Meta/links.rds")
aws_file_upload(
c(demo_rds_file, links_file),
s3_path(bucket, c(basename(demo_rds_file), basename(links_file)))
)
aws_file_upload(
c(demo_rds_file, links_file),
s3_path(
bucket, "newfolder",
c(basename(demo_rds_file), basename(links_file))
)
)
aws_bucket_list_objects(bucket)
six_bucket_delete(bucket)
}