Storage buckets in CloudNexus are fundamental containers for your unstructured data. This guide covers everything you need to know about provisioning, configuring, and securing buckets for production workloads.
Prerequisites
- An active CloudNexus account with Developer or higher permissions
- CloudNexus CLI installed (
cnx --version >= 2.4.0) - Valid API credentials (
CNX_API_KEY&CNX_SECRET)
Create via Console
The easiest way to provision a bucket is through the CloudNexus Web Console:
- Navigate to Storage → Buckets in the left sidebar
- Click the + Create Bucket button in the top-right corner
- Enter a globally unique bucket name (e.g.,
app-assets-prod) - Select your target Region (e.g.,
us-east-1,eu-west-1) - Configure access controls: Private (default), Public, or Authenticated
- Toggle optional features: Versioning, Lifecycle Policies, or Cross-Region Replication
- Click Create Bucket. Provisioning takes ~5 seconds.
Create via CLI
For automation and Infrastructure-as-Code workflows, use the CloudNexus CLI:
cnx storage bucket create my-app-assets \
--region us-east-1 \
--visibility private \
--versioning enabled \
--encryption AES256 \
--lifecycle delete-after-30d
This returns a JSON response containing the bucket ARN, endpoint URL, and metadata. You can pipe this output into your CI/CD pipeline or configuration management tool.
Create via REST API
Make a POST request to the storage API endpoint:
curl -X POST https://api.cloudnexus.io/v1/storage/buckets \
-H "Authorization: Bearer $CNX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "data-lake-backups",
"region": "eu-west-1",
"access": "private",
"versioning": true,
"tags": {
"environment": "production",
"team": "data-eng"
}
}'
Configure Lifecycle & Permissions
Once created, apply lifecycle rules to optimize costs and manage data retention:
cnx storage lifecycle put my-app-assets \
--rule "archive-after-90d,delete-after-365d"
Best Practices
- Region Selection: Always deploy buckets in the same region as your application servers to minimize latency and cross-region data transfer costs.
- Access Control: Default to
private. Use CloudNexus IAM policies to grant granularGET,PUT, orDELETEpermissions to specific service roles. - Encryption: Enable server-side encryption (SSE-KMS or AES256) for compliance with SOC2, HIPAA, and GDPR requirements.
- Versioning: Enable versioning for critical assets to protect against accidental deletions or overwrites. Combine with lifecycle rules to manage storage costs.
- Monitoring: Enable CloudNexus Metrics for your bucket to track requests, bandwidth usage, and error rates via the Observability dashboard.
Next Steps
Now that your bucket is provisioned, explore these guides to integrate it into your architecture: