ruby/example_code/s3/s3-ruby-example-create-bucket.rb
# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.

Full example call:
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Full example call : Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .
def run_me
  region = 'us-west-2'
  s3_client = Aws::S3::Client.new(region: region)
  bucket_name = 'bucket-' + SecureRandom.uuid
  if bucket_created?(s3_client, bucket_name)
    puts "Bucket '#{bucket_name}' created."
  else
    puts "Bucket '#{bucket_name}' not created."
    exit 1
  end
end
def run_me region = 'us-west-2' s3_client = Aws :: S3 :: Client . new ( region : region ) bucket_name = 'bucket-' + SecureRandom . uuid if bucket_created? ( s3_client , bucket_name ) puts "Bucket '#{bucket_name}' created." else puts "Bucket '#{bucket_name}' not created." exit 1 end end
Full example call:
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Full example call : Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .