文档中心 > 创建桶
创建桶

最近更新时间:2022-09-29

桶(Bucket)是存储对象(Object)的容器。对象都隶属于桶。

以下代码用于创建桶:

let req = AWSS3CreateBucketRequest.init()
req?.bucket = S3BucketName
req?.acl = AWSS3BucketCannedACL.private
s3.createBucket(req!).continueWith(block: { (task:AWSTask) -> Any? in

   if let error = task.error {
       print("create bucket failed with error: (\(error))")
   } else {
       print("create bucket completed.")
   }
   return nil
})