Skip to content

Instantly share code, notes, and snippets.

@ryanfitz
Created August 3, 2014 23:48
Show Gist options
  • Save ryanfitz/60bd921494461a25f5c0 to your computer and use it in GitHub Desktop.
Save ryanfitz/60bd921494461a25f5c0 to your computer and use it in GitHub Desktop.
list s3 buckets using the aws sdk
AWSS3.defaultS3().listBuckets(nil).continueWithBlock {
(task: BFTask!) -> AnyObject! in
let output : AWSS3ListBucketsOutput = task.result() as AWSS3ListBucketsOutput
println("found \(output.buckets.count) buckets")
for bucket in output.buckets as [AWSS3Bucket] {
println("Found bucket \(bucket.name)")
}
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment