S3
S3 specific configuration. Authentication resolution used by Flyte + obstore: 1. If explicit static credentials are provided via Flyte S3 inputs/environment (access_key_id/secret_access_key), those are used. 2. If static credentials are not provided, and both AWS_PROFILE and AWS_CONFIG_FILE are available, Flyte configures a boto3-backed obstore credential provider so profile-based auth can be used. This requires that the boto3 library is installed. 3. If neither of the above applies, obstore uses the default AWS credential chain (for remote runs this commonly resolves via workload identity / IAM attached to the service account and then IMDS fallbacks where applicable).
Attributes
| Attribute | Type | Description |
|---|---|---|
| endpoint | typing.Optional[str] = None | The S3 service endpoint URL to use for API requests. If not set, the default AWS endpoint for the specified region will be used. |
| access_key_id | typing.Optional[str] = None | The AWS access key ID for authenticating S3 requests. If not set, credentials will be resolved via other mechanisms (e.g., environment variables, IAM roles). |
| secret_access_key | typing.Optional[str] = None | The AWS secret access key for authenticating S3 requests. If not set, credentials will be resolved via other mechanisms (e.g., environment variables, IAM roles). |
| region | typing.Optional[str] = None | The AWS region to which S3 requests will be directed. This affects which S3 endpoint is used if 'endpoint' is not explicitly set. |
| addressing_style | typing.Optional[str] = None | The S3 addressing style to use for requests, such as 'virtual' for virtual hosted style or 'path' for path style. This influences how S3 bucket names are included in the request URL. |
Methods
auto()
@classmethod
def auto(
region: str | None = None
) - > [S3](s3.md?sid=flyte_storage__config_s3)
Config
Parameters
| Name | Type | Description |
|---|---|---|
| region | `str | None` = None |
Returns
| Type | Description |
|---|---|
[S3](s3.md?sid=flyte_storage__config_s3) | Config |
for_sandbox()
@classmethod
def for_sandbox() - > [S3](s3.md?sid=flyte_storage__config_s3)
Configures an S3 instance for local sandbox environments, typically using LocalStack or MinIO. This method sets the endpoint to http://localhost:4566 and provides default access keys for local testing.
Returns
| Type | Description |
|---|---|
[S3](s3.md?sid=flyte_storage__config_s3) | An S3 configuration object pre-configured for a sandbox environment. |
get_fsspec_kwargs()
@classmethod
def get_fsspec_kwargs(
anonymous: bool = False,
**kwargs: Any
) - > typing.Dict[str, typing.Any]
Generates a dictionary of keyword arguments suitable for fsspec S3 file system initialization. This method consolidates S3 configuration, including credentials and endpoint, and handles credential resolution from environment variables or AWS config files.
Parameters
| Name | Type | Description |
|---|---|---|
| anonymous | bool = False | A boolean indicating whether to access S3 anonymously, bypassing credential resolution. |
| **kwargs | Any | Additional keyword arguments to be included in the fsspec configuration. |
Returns
| Type | Description |
|---|---|
typing.Dict[str, typing.Any] | A dictionary of keyword arguments to be passed to fsspec.filesystem('s3', **kwargs). |