<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Not able to read S3 object through AssumedRoleCredentialProvider in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-s3-object-through-assumedrolecredentialprovider/m-p/3916#M794</link>
    <description>&lt;P&gt;SparkSession spark = SparkSession.builder()&lt;/P&gt;&lt;P&gt;        .appName("SparkS3Example")&lt;/P&gt;&lt;P&gt;        .master("local[1]")&lt;/P&gt;&lt;P&gt;        .getOrCreate();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.access.key", S3_ACCOUNT_KEY);&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.secret.key", S3_SECRET_KEY);&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.aws.credentials.provider", "org.apache.hadoop.fs.s3a.auth.AssumedRoleCredentialProvider");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.credentials.provider", "org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.arn", "arn:aws:iam::000000000000:role/&amp;lt;bucket&amp;gt;");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.sts.endpoint.region", awsRegion);&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.session.name", "test");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.sts.endpoint", "sts.ap-southeast-2.amazonaws.com");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.endpoint", "s3.ap-southeast-2.amazonaws.com");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.endpoint.region", awsRegion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Able to get AccessKeyId, SecretAccessKey and SessionToken through AssumedRoleCredentialProvider, but not able to get object from S3, it is throwing 403 AccessDenied exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But If I used same AccessKeyId, SecretAccessKey and SessionToken in AWS CLI then able to download using cp command through command prompt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected to access S3 object through AssumedRoleCredentialProvider.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 29 May 2023 11:50:32 GMT</pubDate>
    <dc:creator>Sweetnesh</dc:creator>
    <dc:date>2023-05-29T11:50:32Z</dc:date>
    <item>
      <title>Not able to read S3 object through AssumedRoleCredentialProvider</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-s3-object-through-assumedrolecredentialprovider/m-p/3916#M794</link>
      <description>&lt;P&gt;SparkSession spark = SparkSession.builder()&lt;/P&gt;&lt;P&gt;        .appName("SparkS3Example")&lt;/P&gt;&lt;P&gt;        .master("local[1]")&lt;/P&gt;&lt;P&gt;        .getOrCreate();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.access.key", S3_ACCOUNT_KEY);&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.secret.key", S3_SECRET_KEY);&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.aws.credentials.provider", "org.apache.hadoop.fs.s3a.auth.AssumedRoleCredentialProvider");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.credentials.provider", "org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.arn", "arn:aws:iam::000000000000:role/&amp;lt;bucket&amp;gt;");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.sts.endpoint.region", awsRegion);&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.session.name", "test");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.assumed.role.sts.endpoint", "sts.ap-southeast-2.amazonaws.com");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.endpoint", "s3.ap-southeast-2.amazonaws.com");&lt;/P&gt;&lt;P&gt;    spark.sparkContext().hadoopConfiguration().set("fs.s3a.endpoint.region", awsRegion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Able to get AccessKeyId, SecretAccessKey and SessionToken through AssumedRoleCredentialProvider, but not able to get object from S3, it is throwing 403 AccessDenied exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But If I used same AccessKeyId, SecretAccessKey and SessionToken in AWS CLI then able to download using cp command through command prompt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected to access S3 object through AssumedRoleCredentialProvider.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 11:50:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-s3-object-through-assumedrolecredentialprovider/m-p/3916#M794</guid>
      <dc:creator>Sweetnesh</dc:creator>
      <dc:date>2023-05-29T11:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read S3 object through AssumedRoleCredentialProvider</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-s3-object-through-assumedrolecredentialprovider/m-p/3918#M796</link>
      <description>&lt;P&gt;Hi @Sweetnesh Dholariya​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does @Debayan Mukherjee​'s response answer your question? If yes, would you be happy to mark it as best so that other members can find the solution more quickly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 08:52:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-s3-object-through-assumedrolecredentialprovider/m-p/3918#M796</guid>
      <dc:creator>Vartika</dc:creator>
      <dc:date>2023-05-30T08:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read S3 object through AssumedRoleCredentialProvider</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-s3-object-through-assumedrolecredentialprovider/m-p/3917#M795</link>
      <description>&lt;P&gt;Similar thread: &lt;A href="https://repost.aws/knowledge-center/s3-troubleshoot-403" alt="https://repost.aws/knowledge-center/s3-troubleshoot-403" target="_blank"&gt;https://repost.aws/knowledge-center/s3-troubleshoot-403&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 07:13:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-s3-object-through-assumedrolecredentialprovider/m-p/3917#M795</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2023-05-30T07:13:28Z</dc:date>
    </item>
  </channel>
</rss>

