You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `aws_bucket` | Yes | Name of the S3 bucket to store vCons |
36
+
| `aws_region` | No | AWS region where the bucket is located (e.g., `us-east-1`, `us-west-2`, `eu-west-1`). **Recommended** to avoid "AuthorizationHeaderMalformed" errors when the bucket is in a different region than the default. |
37
+
| `endpoint_url` | No | Custom endpoint URL for S3-compatible services like MinIO, LocalStack, or other providers |
38
+
| `s3_path` | No | Prefix path for organizing vCon objects within the bucket |
39
+
40
+
### Region Configuration
41
+
42
+
**Important:** If your S3 bucket is in a region other than `us-east-1`, you should explicitly set the `aws_region` option. Without this, you may encounter errors like:
43
+
44
+
```
45
+
AuthorizationHeaderMalformed: The authorization header is malformed;
46
+
the region 'us-east-1' is wrong; expecting 'us-east-2'
24
47
```
25
48
26
49
## Features
27
50
28
-
- Object storage
29
-
- High availability
30
-
- Durability
31
-
- Versioning support
32
-
- Lifecycle management
33
-
- Automatic metrics logging
34
-
- Encryption support
35
-
- Access control
51
+
- Object storage with automatic date-based key organization (`YYYY/MM/DD/uuid.vcon`)
52
+
- High availability and durability
53
+
- Support for custom S3-compatible endpoints (MinIO, LocalStack, etc.)
54
+
- Configurable key prefix for organizing objects
55
+
- Automatic error logging
36
56
37
57
## Usage
38
58
@@ -42,21 +62,24 @@ from storage import Storage
42
62
# Initialize S3 storage
43
63
s3_storage = Storage("s3")
44
64
45
-
# Save vCon data
65
+
# Save vCon data (retrieves from Redis and stores in S3)
46
66
s3_storage.save(vcon_id)
47
67
48
68
# Retrieve vCon data
49
69
vcon_data = s3_storage.get(vcon_id)
50
70
```
51
71
52
-
## Implementation Details
72
+
## Key Structure
73
+
74
+
vCons are stored with keys following this pattern:
75
+
```
76
+
[s3_path/]YYYY/MM/DD/uuid.vcon
77
+
```
53
78
54
-
The S3 storage implementation:
55
-
- Uses boto3 for AWS S3 operations
56
-
- Implements retry logic
57
-
- Supports multipart uploads
58
-
- Provides encryption
59
-
- Includes automatic metrics logging
79
+
For example, a vCon created on January 15, 2024 with UUID `abc123` and `s3_path: vcons` would be stored at:
80
+
```
81
+
vcons/2024/01/15/abc123.vcon
82
+
```
60
83
61
84
## Dependencies
62
85
@@ -65,15 +88,11 @@ The S3 storage implementation:
65
88
66
89
## Best Practices
67
90
68
-
1. Secure credential management
69
-
2. Implement proper access control
70
-
3. Use appropriate storage classes
71
-
4. Enable versioning
72
-
5. Configure lifecycle rules
73
-
6. Implement proper error handling
74
-
7. Use appropriate encryption
75
-
8. Monitor costs
76
-
9. Implement retry logic
77
-
10. Use appropriate regions
78
-
11. Enable logging
79
-
12. Regular backup verification
91
+
1. Always configure `aws_region` to match your bucket's region
92
+
2. Use IAM roles with least-privilege access
93
+
3. Enable bucket versioning for data protection
94
+
4. Configure lifecycle rules for cost optimization
0 commit comments