amazon_s3_storage_config.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from typing import Optional
  2. from pydantic import Field
  3. from pydantic_settings import BaseSettings
  4. class S3StorageConfig(BaseSettings):
  5. """
  6. Configuration settings for S3-compatible object storage
  7. """
  8. S3_ENDPOINT: Optional[str] = Field(
  9. description="URL of the S3-compatible storage endpoint (e.g., 'https://s3.amazonaws.com')",
  10. default=None,
  11. )
  12. S3_REGION: Optional[str] = Field(
  13. description="Region where the S3 bucket is located (e.g., 'us-east-1')",
  14. default=None,
  15. )
  16. S3_BUCKET_NAME: Optional[str] = Field(
  17. description="Name of the S3 bucket to store and retrieve objects",
  18. default=None,
  19. )
  20. S3_ACCESS_KEY: Optional[str] = Field(
  21. description="Access key ID for authenticating with the S3 service",
  22. default=None,
  23. )
  24. S3_SECRET_KEY: Optional[str] = Field(
  25. description="Secret access key for authenticating with the S3 service",
  26. default=None,
  27. )
  28. S3_ADDRESS_STYLE: str = Field(
  29. description="S3 addressing style: 'auto', 'path', or 'virtual'",
  30. default="auto",
  31. )
  32. S3_USE_AWS_MANAGED_IAM: bool = Field(
  33. description="Use AWS managed IAM roles for authentication instead of access/secret keys",
  34. default=False,
  35. )