@@ -25,7 +25,7 @@ use datafusion::datasource::object_store::{
2525use datafusion:: execution:: runtime_env:: RuntimeConfig ;
2626use futures:: stream:: FuturesUnordered ;
2727use futures:: { StreamExt , TryStreamExt } ;
28- use object_store:: aws:: { AmazonS3 , AmazonS3Builder , Checksum } ;
28+ use object_store:: aws:: { AmazonS3 , AmazonS3Builder , AmazonS3ConfigKey , Checksum } ;
2929use object_store:: limit:: LimitStore ;
3030use object_store:: path:: Path as StorePath ;
3131use object_store:: { ClientOptions , ObjectStore } ;
@@ -46,6 +46,7 @@ use super::{object_storage, ObjectStorageProvider};
4646// in bytes
4747const MULTIPART_UPLOAD_SIZE : usize = 1024 * 1024 * 100 ;
4848const CONNECT_TIMEOUT_SECS : u64 = 5 ;
49+ const AWS_CONTAINER_CREDENTIALS_RELATIVE_URI : & str = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" ;
4950
5051#[ derive( Debug , Clone , clap:: Args ) ]
5152#[ command(
@@ -152,6 +153,13 @@ impl S3Config {
152153 . with_secret_access_key ( secret_key) ;
153154 }
154155
156+ if let Ok ( relative_uri) = std:: env:: var ( AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ) {
157+ builder = builder. with_config (
158+ AmazonS3ConfigKey :: ContainerCredentialsRelativeUri ,
159+ relative_uri,
160+ ) ;
161+ }
162+
155163 if self . imdsv1_fallback {
156164 builder = builder. with_imdsv1_fallback ( )
157165 }
0 commit comments