2

I am trying to create a bucket, with help of aws-sdk-ruby from ruby console. Following is the code I am running in my console:

Aws.config.update({
  :region => "myRegion",
  :credentials => Aws::Credentials.new("access_key", "secret_key"),
  :endpoint => "http://Ip",
  :force_path_style => true
  })
  bucket_name = "abc"
  bucket = s3.bucket(bucket_name)
  bucket.create({ acl: "authenticated-read", grant_full_control: "GrantFullControl"})

Last line gives this error:

Aws::S3::Errors::InvalidBucketName:

I dont see this error in the documentation here. When can one get such error and how to resolve this?

Saurabh
  • 71,488
  • 40
  • 181
  • 244

1 Answers1

0

I was also getting this error.. the main reason why was getting this error because my bucket name was starting with capital letter.. Bucket name always starts with lowercase ..

Dharman
  • 30,962
  • 25
  • 85
  • 135