Learn R Programming

aws.s3 (version 0.2.2)

put_bucket: Create bucket

Description

Creates a new S3 bucket.

Usage

put_bucket(bucket, region = Sys.getenv("AWS_DEFAULT_REGION"),
  headers = list(), ...)

Arguments

bucket
Character string with the name of the bucket, or an object of class “s3_bucket”.
region
A character string containing the AWS region. If missing, defaults to value of environment variable AWS_DEFAULT_REGION.
headers
List of request headers for the REST call.
Additional arguments passed to s3HTTP.

Value

TRUE if successful.

References

http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html

See Also

bucketlist, get_bucket, delete_bucket, put_object

Examples

Run this code
## Not run: ------------------------------------
#   put_bucket("examplebucket")
#   
#   # set a "canned" ACL to, e.g., make bucket publicly readable
#   put_bucket("examplebucket", headers = list(`x-amz-acl` = "public-read")
# 
## ---------------------------------------------

Run the code above in your browser using DataLab