@@ -542,6 +542,9 @@ impl From<InnerStorageConfig> for StorageConfig {
542542 v => unreachable ! ( "{v:?} should not be used as storage backend" ) ,
543543 }
544544
545+ cfg. s3 . disable_config_load = inner. s3_disable_config_load ;
546+ cfg. s3 . disable_ec2_metadata = inner. s3_disable_ec2_metadata ;
547+
545548 cfg
546549 }
547550}
@@ -587,6 +590,8 @@ impl TryInto<InnerStorageConfig> for StorageConfig {
587590 Ok ( InnerStorageConfig {
588591 num_cpus : self . storage_num_cpus ,
589592 allow_insecure : self . allow_insecure ,
593+ s3_disable_config_load : self . s3 . disable_config_load ,
594+ s3_disable_ec2_metadata : self . s3 . disable_ec2_metadata ,
590595 params : {
591596 match self . typ . as_str ( ) {
592597 "azblob" => {
@@ -931,6 +936,14 @@ pub struct S3StorageConfig {
931936 #[ clap( long = "storage-s3-enable-virtual-host-style" , value_name = "VALUE" ) ]
932937 pub enable_virtual_host_style : bool ,
933938
939+ /// Disable loading credentials from env/shared config/web identity.
940+ #[ clap( long = "storage-s3-disable-config-load" ) ]
941+ pub disable_config_load : bool ,
942+
943+ /// Disable EC2 instance metadata credential provider (IMDS).
944+ #[ clap( long = "storage-s3-disable-ec2-metadata" ) ]
945+ pub disable_ec2_metadata : bool ,
946+
934947 #[ clap( long = "storage-s3-role-arn" , value_name = "VALUE" , default_value_t) ]
935948 #[ serde( rename = "role_arn" ) ]
936949 pub s3_role_arn : String ,
@@ -963,6 +976,8 @@ impl Debug for S3StorageConfig {
963976 . field ( "bucket" , & self . bucket )
964977 . field ( "root" , & self . root )
965978 . field ( "enable_virtual_host_style" , & self . enable_virtual_host_style )
979+ . field ( "disable_config_load" , & self . disable_config_load )
980+ . field ( "disable_ec2_metadata" , & self . disable_ec2_metadata )
966981 . field ( "role_arn" , & self . s3_role_arn )
967982 . field ( "external_id" , & self . s3_external_id )
968983 . field ( "access_key_id" , & mask_string ( & self . access_key_id , 3 ) )
@@ -987,6 +1002,8 @@ impl From<InnerStorageS3Config> for S3StorageConfig {
9871002 root : inner. root ,
9881003 master_key : inner. master_key ,
9891004 enable_virtual_host_style : inner. enable_virtual_host_style ,
1005+ disable_config_load : false ,
1006+ disable_ec2_metadata : false ,
9901007 s3_role_arn : inner. role_arn ,
9911008 s3_external_id : inner. external_id ,
9921009 storage_class : inner. storage_class ,
0 commit comments