Managing Buckets
Create and configure buckets in NFYio. Web Console, API, AWS CLI. Storage classes, versioning, lifecycle rules, bucket policies, and deletion.
A bucket is a container for objects in NFYio storage. Buckets are the top-level namespace — all objects belong to exactly one bucket. Bucket names must be globally unique within your NFYio deployment.
What is a Bucket?
- Namespace — Organizes objects under a single name (e.g.,
my-app-uploads) - Configuration scope — Versioning, lifecycle rules, and CORS apply at the bucket level
- Access control — Bucket policies and ACLs govern who can read/write
Creating Buckets
Web Console
- Log in to the NFYio dashboard
- Navigate to Storage → Buckets
- Click Create Bucket
- Enter a bucket name (lowercase, numbers, hyphens only)
- Optionally configure storage class, versioning, and lifecycle
- Click Create
API (curl)
curl -X POST "https://storage.yourdomain.com/my-new-bucket" \
-H "Authorization: AWS4-HMAC-SHA256 Credential=ACCESS_KEY/20260301/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=..." \
-H "x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" \
-H "x-amz-date: 20260301T120000Z"
AWS CLI
# Configure endpoint (one-time)
aws configure set default.s3.endpoint_url https://storage.yourdomain.com
# Create bucket
aws s3 mb s3://my-new-bucket
# Create with specific region (if required)
aws s3 mb s3://my-new-bucket --region us-east-1
Bucket Configuration
Storage Classes
Choose the storage class that matches your access patterns and cost requirements:
| Class | Use Case | Latency | Cost |
|---|---|---|---|
| Standard | Frequently accessed data | Low | Higher |
| Infrequent Access | Backups, archives, less frequent access | Low | Lower |
| Glacier | Long-term archival, rarely accessed | Higher (retrieval delay) | Lowest |
Set the default storage class when creating a bucket or via the API:
aws s3api put-bucket-storage-class \
--bucket my-bucket \
--storage-class STANDARD_IA \
--endpoint-url https://storage.yourdomain.com
Versioning
Enable versioning to keep multiple versions of objects. Once enabled, overwrites create new versions instead of replacing the object.
# Enable versioning
aws s3api put-bucket-versioning \
--bucket my-bucket \
--versioning-configuration Status=Enabled \
--endpoint-url https://storage.yourdomain.com
# Check versioning status
aws s3api get-bucket-versioning --bucket my-bucket --endpoint-url https://storage.yourdomain.com
See Object Versioning for details.
Lifecycle Rules
Automate transitions and expiration:
- Transition — Move objects to Infrequent Access or Glacier after N days
- Expiration — Delete objects or old versions after N days
Example lifecycle configuration (JSON):
{
"Rules": [
{
"ID": "ArchiveOldLogs",
"Status": "Enabled",
"Filter": { "Prefix": "logs/" },
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 365 }
}
]
}
Apply via API:
aws s3api put-bucket-lifecycle-configuration \
--bucket my-bucket \
--lifecycle-configuration file://lifecycle.json \
--endpoint-url https://storage.yourdomain.com
Bucket Policies
Bucket policies define who can perform which actions. Use JSON policy documents:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket/public/*"
}
]
}
Apply via API or Web Console under Bucket → Permissions → Bucket Policy.
Listing Buckets
# List all buckets
aws s3 ls --endpoint-url https://storage.yourdomain.com
# List objects in a bucket
aws s3 ls s3://my-bucket/ --endpoint-url https://storage.yourdomain.com
Deleting Buckets
A bucket must be empty before deletion. Delete all objects and their versions first:
# Delete all objects (including versions if versioning is enabled)
aws s3 rm s3://my-bucket/ --recursive --endpoint-url https://storage.yourdomain.com
# Delete the bucket
aws s3 rb s3://my-bucket --endpoint-url https://storage.yourdomain.com
# Force delete (empties and removes in one step — use with caution)
aws s3 rb s3://my-bucket --force --endpoint-url https://storage.yourdomain.com
Best Practices
- Naming — Use lowercase, hyphens; avoid underscores for maximum compatibility
- Versioning — Enable for critical data to prevent accidental loss
- Lifecycle — Automate transitions to reduce costs for cold data
- Policies — Prefer least-privilege; avoid
Principal: "*"for sensitive buckets
Next Steps
- Working with Objects — Upload and download objects
- Object Versioning — Manage object versions
- Storage Classes — Choose the right storage tier