generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 235
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Tell us more about this new feature.
Summary
Add CLI-level validation for the --storage-class flag to ensure only valid S3 storage classes are accepted at mount time, providing immediate feedback to users before attempting to mount.
Motivation
Currently, invalid storage class values may not be caught until an upload operation fails. By validating storage classes at CLI parsing time using a strongly-typed enum, users receive immediate, clear error messages when specifying an invalid value.
Example (misspelled INTELLIGENT_TIERING with one L):
Current behavior:
# mount-s3 <bucket_name> mounted-s3 --storage-class INTELIGENT_TIERING
bucket <bucket_name> is mounted at mounted-s3
# echo "Hello from Mountpoint!" > test.txt
bash: echo: write error: Input/output error
Expected behavior:
# mount-s3 <bucket_name> mounted-s3 --storage-class INTELIGENT_TIERING
error: invalid value 'INTELIGENT_TIERING' for '--storage-class <STORAGE_CLASS>'
[possible values: STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE]
tip: a similar value exists: 'INTELLIGENT_TIERING'
For more information, try '--help'.
Proposed Implementation
Introduce a StorageClass enum implementing clap's ValueEnum trait that validates input against all valid S3 storage classes:
STANDARDREDUCED_REDUNDANCYSTANDARD_IAONEZONE_IAINTELLIGENT_TIERINGGLACIERDEEP_ARCHIVEOUTPOSTSGLACIER_IRSNOWEXPRESS_ONEZONE
The validation should:
- Accept only uppercase values (matching S3 API requirements)
- Reject empty strings, lowercase and mixed case
- Provide helpful error messages listing valid options and similar values when possible
Additional Context
- Reference: S3 PutObject StorageClass documentation
- Note:
EXPRESS_ONEZONEis only valid for directory buckets (further bucket-type validation may be a separate enhancement) - Note:
FSX_OPENZFSandFSX_ONTAPoptions are not included
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request