# File lib/deltacloud/drivers/ec2/ec2_driver.rb, line 351
  def create_bucket(credentials, name, opts={})
    bucket = nil
    safely do
      begin
        s3_client = s3_client(credentials)
        bucket_location = opts['location']
        if bucket_location
          bucket = RightAws::S3::Bucket.create(s3_client, name, true, nil, :location => bucket_location)
        else
          bucket = RightAws::S3::Bucket.create(s3_client, name, true)
        end #if
        rescue RightAws::AwsError => e
          raise e unless e.message =~ /BucketAlreadyExists/
          raise Deltacloud::BackendError.new(409, e.class.to_s, e.message, e.backtrace)
      end #begin
    end #do
    convert_bucket(bucket)
  end