Skip to content

Commit db923cc

Browse files
committed
Document aws region defaults
1 parent 86ac00f commit db923cc

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/server/cloud/aws.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ impl AwsService {
114114
.or_default_provider()
115115
.or_else(Region::new("us-east-1")),
116116
);
117-
match endpoint_url {
118-
Some(url) => config_provider = config_provider.endpoint_url(url),
119-
None => {}
120-
}
117+
if let Some(url) = endpoint_url {
118+
config_provider = config_provider.endpoint_url(url)
119+
};
121120
config_provider.load().await
122121
});
123122

src/server/config.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ pub enum ServerConfig {
7979
#[cfg(feature = "server-aws")]
8080
Aws {
8181
/// Region in which the bucket is located.
82+
/// If `None`, the default region is used.
83+
/// The `default` region is based on the AWS SDK
84+
/// - <https://docs.aws.amazon.com/sdk-for-rust/latest/dg/region.html>
85+
///
86+
/// following, in order:
87+
/// 1. `AWS_REGION` environment variable,
88+
/// 2. `AWS_CONFIG_FILE` environment variable and the `region` in that file
89+
/// 3. `AWS_PROFILE` variable and the region for that file in the config file
90+
/// 4. The instance profile if running in an AWS compute environment
91+
///
92+
/// Failing all of those, we will default to `us-east-1`.
8293
region: Option<String>,
8394
/// Bucket in which to store the task data.
8495
///

0 commit comments

Comments
 (0)