Skip to main content

feldera_types/transport/
s3.rs

1use serde::{Deserialize, Serialize};
2use utoipa::ToSchema;
3
4fn default_max_concurrent_fetches() -> u32 {
5    8
6}
7
8fn default_max_retries() -> u32 {
9    5
10}
11
12/// Configuration for reading data from AWS S3.
13#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
14pub struct S3InputConfig {
15    /// AWS Access Key id. This property must be specified unless `no_sign_request` is set to `true`.
16    pub aws_access_key_id: Option<String>,
17
18    /// Secret Access Key. This property must be specified unless `no_sign_request` is set to `true`.
19    pub aws_secret_access_key: Option<String>,
20
21    /// Do not sign requests. This is equivalent to the `--no-sign-request` flag in the AWS CLI.
22    #[serde(default)]
23    pub no_sign_request: bool,
24
25    /// Read a single object specified by a key.
26    pub key: Option<String>,
27
28    /// Read all objects whose keys match a prefix. Set to an empty string to read all objects in the bucket.
29    pub prefix: Option<String>,
30
31    /// AWS region.
32    pub region: String,
33
34    /// S3 bucket name to access.
35    pub bucket_name: String,
36
37    /// The endpoint URL used to communicate with this service. Can be used to make this connector
38    /// talk to non-AWS services with an S3 API.
39    pub endpoint_url: Option<String>,
40
41    /// Controls the number of S3 objects fetched in parallel.
42    ///
43    /// Increasing this value can improve throughput by enabling greater concurrency.
44    /// However, higher concurrency may lead to timeouts or increased memory usage due to in-memory buffering.
45    ///
46    /// Recommended range: 1–10. Default: 8.
47    #[serde(default = "default_max_concurrent_fetches")]
48    pub max_concurrent_fetches: u32,
49
50    /// Retry `max_retries` times with exponential backoff.
51    /// If the object changes during a retry attempt, the remaining part of the object will not be processed.
52    /// Recommended range: 3-10. Default: 5.
53    #[serde(default = "default_max_retries")]
54    pub max_retries: u32,
55}