I am using Pyspark 3.1 locally to access data in s3 using AWS access key, password, and "s3a" protocol, it is working fine. I want to use AWS role instead of AWS keys. Can someone tell me the syntax to use this?
I have tried below code but it was giving an error:
spark_context._jsc.hadoopConfiguration().set("fs.s3a.aws.credentials.provider", "org.apache.hadoop.fs.s3a.auth.AssumedRoleCredentialProvider")
spark_context._jsc.hadoopConfiguration().set("fs.s3a.assumed.role.arn", "arn:aws:iam::2:role/admin-admin-admin")
I am getting error as:
Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY
Thanks, XI
