I created a bucket in Asia Pacific (Mumbai) region and another bucket in Singapore region. I set the keys as environment variables. Then ran the following commands in Spark shell.

For Singapore:

```
sc.hadoopConfiguration.set("fs.s3a.endpoint","s3-ap-southeast-1.amazonaws.com")
val testdf = sqlContext.read.csv("s3a://dev-singapore/test.csv")

```

It ran fine.

For Mumbai:

```
sc.hadoopConfiguration.set("fs.s3a.endpoint","s3.ap-south-1.amazonaws.com")
val testdf = sqlContext.read.csv("s3a://dev-mumbai/test.csv")

```

But it gave me following error

```
17/05/31 11:56:58 WARN DataSource: Error while looking for metadata directory.
com.amazonaws.services.s3.model.AmazonS3Exception: Status Code: 301, AWS Service: Amazon S3, AWS Request ID: BDFC*****9C820, AWS Error Code: null, AWS Error Message: Moved Permanently
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:798)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:421)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:232)

```

---

Mumbai region S3 server only supports Signature Version 4 while Singapore supports both Version 2 and 4.

I used Spark (2.0.0) from the docker image <https://hub.docker.com/r/stvdberghe/spark-s3/>