title: Error accessing s3 bucket from lambda - InvalidBucketName
body: <p>Using Java AWS SDK I've created a lambda function to read a csv file from an s3 bucket.  I've made the bucket public and can access it and the file easily from any browser. 
  To test it, I'm using the test button on the lambda console.  I'm just using the hello world test config input template.<br>
  It fails with:</p>
  
  <p><strong>Error Message: The specified bucket is not valid. (Service: Amazon S3; Status Code: 400; Error Code: InvalidBucketName; Request ID: XXXXXXXXXXXXXXX)</strong></p>
  
  <p>Lambda function and s3 bucket are in the same region (us-east-1). </p>
  
  <p>I've added AmazonS3FullAccess to lambda_basic_execution role.</p>
  
  <pre><code>AmazonS3 s3Client = AmazonS3ClientBuilder.standard().build();
  </code></pre>
  
  <p>also tried</p>
  
  <pre><code>AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient();
  </code></pre>
  
  <p>then the call</p>
  
  <pre><code>S3Object s3object = s3Client.getObject(new GetObjectRequest(
                  bucketName, keyName));
  </code></pre>
  
  <p>bucketName is: </p>
  
  <pre><code>https://s3.amazonaws.com/&lt;allAlphaLowerCaseBucketName&gt;
  </code></pre>
  
  <p>keyName is: </p>
  
  <pre><code>&lt;allAlphaLowerCaseKeyName&gt;.csv
  </code></pre>
  
  <p>Any help is appreciated. </p>