Skip to content


Subversion checkout URL

You can clone with
Download ZIP


SaltwaterC edited this page · 4 revisions


S3 helper for easy creations of buckets.


s3.createBucket(bucketName, cannedAcl, region, callback)
  • 'bucketName' - the Bucket Name.
  • 'cannedAcl' - the S3 Canned ACL.
  • 'region' - the region where to create the S3 bucket. Passing boolean false makes it to use us-east-1 which is the default S3 region. This argument accepts the same values as the query.setRegion() helper. It patches the S3 API inconsistencies. The allowed values:
    • 'us-east-1' || false => Virginia
    • 'us-west-1' => N. California
    • 'us-west-2' => Oregon
    • 'eu-west-1' => Ireland
    • 'ap-southeast-1' => Singapore
    • 'ap-northeast-1' => Tokyo
  • 'callback' - the callback that is executed when the processing finishes. It has a couple of arguments: error and result.
    • If there's an error, the callback receives the error argument as Error instance.
    • If the error argument is null, then the response argument contains the response.headers object as returned by the node.js core HTTPS client.

This helper calls s3.setBucket() transparently. This means that after the bucket is created, you operate into its context.

Something went wrong with that request. Please try again.