I'm using spark 2.3.0 and Hadoop 2.7 ( but i can upgrade if necessary)
I want acces S3 file with an ARN (Amazon Resource Name) IAM Role https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
I already took a look to this How to access s3a:// files from Apache Spark? but there is no question about IAM acces
public class test {
public static void main(String[] args) {
SparkSession sc = new SparkSession.Builder()
.appName("test")
.config("spark.master", "local[*]") //for example
.config("spark.hadoop.fs.s3a.access.key", "****")
.config("spark.hadoop.fs.s3a.secret.key", "****")
// .config("spark.hadoop.fs.s3a.arn_role","arn:aws:iam::***:role/******"")
.getOrCreate();
sc.read().format("csv").load("s3a://toto/****.csv").printSchema();
}
}
I didn't find any option or configuration
I'm also looking for a solution with args on the spark submit ,but not inside a configuration files ( this need to by dynamic )
do you have any idea ?