pub struct S3Config {
pub gateway_listen: String,
pub s3_virtual_hosting: bool,
pub s3_domain: String,
pub s3_skip_signature_validation: bool,
pub s3_max_memory_object_size: usize,
pub default_region: String,
pub log_level: String,
pub persistence: bool,
pub data_dir: String,
}Expand description
S3 service configuration.
All fields have sensible defaults matching LocalStack behavior. Configuration
can be loaded from environment variables via S3Config::from_env.
§Examples
use rustack_s3_core::config::S3Config;
let config = S3Config::default();
assert_eq!(config.gateway_listen, "0.0.0.0:4566");
assert!(config.s3_virtual_hosting);Fields§
§gateway_listen: StringBind address for the gateway (e.g. "0.0.0.0:4566").
s3_virtual_hosting: boolWhether S3 virtual-hosted-style addressing is enabled.
s3_domain: StringDomain for S3 virtual hosting resolution.
s3_skip_signature_validation: boolWhether to skip signature validation on incoming requests.
s3_max_memory_object_size: usizeMaximum object size (in bytes) kept entirely in memory before spilling to disk.
default_region: StringDefault AWS region for this S3 service instance.
log_level: StringLog level filter string (e.g. "info", "debug").
persistence: boolWhether persistence (durable storage) is enabled.
data_dir: StringData directory used when persistence is enabled.
Implementations§
Source§impl S3Config
impl S3Config
Sourcepub fn builder() -> S3ConfigBuilder<((), (), (), (), (), (), (), (), ())>
pub fn builder() -> S3ConfigBuilder<((), (), (), (), (), (), (), (), ())>
Create a builder for building S3Config.
On the builder, call .gateway_listen(...)(optional), .s3_virtual_hosting(...)(optional), .s3_domain(...)(optional), .s3_skip_signature_validation(...)(optional), .s3_max_memory_object_size(...)(optional), .default_region(...)(optional), .log_level(...)(optional), .persistence(...)(optional), .data_dir(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of S3Config.
Source§impl S3Config
impl S3Config
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load configuration from environment variables.
Reads the following environment variables (falling back to defaults):
| Variable | Default |
|---|---|
GATEWAY_LISTEN | 0.0.0.0:4566 |
S3_VIRTUAL_HOSTING | true |
S3_DOMAIN | s3.localhost.localstack.cloud |
S3_SKIP_SIGNATURE_VALIDATION | true |
S3_MAX_MEMORY_OBJECT_SIZE | 524288 |
DEFAULT_REGION | us-east-1 |
LOG_LEVEL | info |
PERSISTENCE | false |
DATA_DIR | /var/lib/localstack |
§Examples
use rustack_s3_core::config::S3Config;
let config = S3Config::from_env();
assert!(!config.gateway_listen.is_empty());