diff --git a/crates/aws/src/lib.rs b/crates/aws/src/lib.rs index c879724c29..bd076700ad 100644 --- a/crates/aws/src/lib.rs +++ b/crates/aws/src/lib.rs @@ -780,6 +780,7 @@ mod tests { unsafe { std::env::set_var(crate::constants::AWS_S3_LOCKING_PROVIDER, "dynamodb"); } + let logstore = factory .with_options(Arc::new(store), &url, &StorageOptions::from(HashMap::new())) .unwrap(); diff --git a/crates/aws/src/storage.rs b/crates/aws/src/storage.rs index 5cc5f15fb6..7ffebd35fb 100644 --- a/crates/aws/src/storage.rs +++ b/crates/aws/src/storage.rs @@ -98,12 +98,18 @@ fn aws_storage_handler( // This function will return true in the default case since it's most likely that the absence of // options will mean default/S3 configuration fn is_aws(options: &StorageOptions) -> bool { - if options.0.contains_key(constants::AWS_FORCE_CREDENTIAL_LOAD) { + // Checks storage option first then env var for existence of aws force credential load + // .from_s3_env never inserts these into the options because they are delta-rs specific + if str_option(&options.0, constants::AWS_FORCE_CREDENTIAL_LOAD).is_some() { return true; } - if options.0.contains_key(constants::AWS_S3_LOCKING_PROVIDER) { + + // Checks storage option first then env var for existence of locking provider + // .from_s3_env never inserts these into the options because they are delta-rs specific + if str_option(&options.0, constants::AWS_S3_LOCKING_PROVIDER).is_some() { return true; } + // Options at this stage should only contain 'aws_endpoint' in lowercase // due to with_env_s3 !(options.0.contains_key("aws_endpoint") || options.0.contains_key(constants::AWS_ENDPOINT_URL))