title: AWS S3 underscore workaround
body: <p>The situation: I have a bunch of images in an S3 bucket named with underscores (e.g. my_images)</p>
  
  <p>However, when instantiating a Java client with Amazon's SDK (v 1.8.7)</p>
  
  <pre><code>AWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey);
  amazonS3 = new AmazonS3Client(awsCredentials);
  amazonS3.createBucket("my_images");
  </code></pre>
  
  <p>I get an IllegalArgumentException. According to Amazon's documentation <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html" rel="nofollow" title="documentation">documentation</a>, </p>
  
  <blockquote>
    <p>Bucket names should not contain underscores</p>
  </blockquote>
  
  <p>Any workarounds for this? It is VERY annoying that Amazon would allow me to name a bucket with an underscore if it can't be accessed by the SDK.</p>
  
  <p>Edit: I tried migrating to a bucket called myImages and </p>
  
  <blockquote>
    <p>Bucket names cannot contain uppercase characters</p>
  </blockquote>