Suga Resources
Every Suga application can use these resource types:Services
Application containers that run your code
Entrypoints
HTTP routing and CDN configuration
Buckets
Object storage for files and assets
Databases
PostgreSQL databases for structured data
Resource Relationships
Resources connect to form your application architecture:
Defining Resources
Resources are defined insuga.yaml:
suga.yaml
Using the Visual Editor
The easiest way to define resources is with the visual editor, by running theedit command in your project directory:
- Drag-and-drop resource creation, using the available resource from your chosen platform
- Visual connections to establish relationships and access
- Property editors for configurations of resources
- Real-time validation of your architecture and configuration
- Automatic YAML sync with bidirectional live update to your project’s suga.yaml file
- AI Assistant that can collaborate with you on your design
Editing YAML Directly
You can also editsuga.yaml directly:
suga.yaml
Resource Naming
Resource names must follow these rules:- Lowercase letters and numbers -
api,api2,frontend - Underscores allowed -
api_service,user_uploads - Start with letter -
api(not2api) - No special characters - Avoid
-,.,/, etc.
Resource Configuration
Each resource type has unique configuration options; however, there are some common configuration options.Subtypes
Cloud provider like AWS provide many container and compute runtime options including EC2, ECS and Fargate, Lambda, EKS, and more. The list gets longer as you look to other cloud providers. The same is true for other resources like Buckets, which might use S3 on AWS, Cloud Storage on GCP, Blob Storage on Azure or another option like self-hosted Minio on Kubernetes. Suga helps you build applications that work well on any of these services without significant modifications to your application code. Reducing vendor lock-in and the cost of change. This allows you to migrate between services during development or as you better understand the performance, cost and other needs of your applications. The resource subtype in thesuga.yaml file is how you tell Suga which specific service you want to use:
Choose specific cloud service
suga/aws@1- Lambda, Fargate, S3, CloudFrontsuga/gcp@1- Cloud Run, Cloud Storage, Cloud CDNyou/custom@1- Any other cloud or resources you like, including cross-cloud deployments
Access Control
Resources can grant access to services:Grant service access to resources
Access Control Guide
Learn more about access control patterns
Accessing Resources from Code
Once you’ve defined resources in yoursuga.yaml, Suga provides generated client libraries for cloud-agnostic resource access. The same code works locally with suga dev and in production across any cloud provider.
Suga Client Libraries
Learn about generated client libraries for buckets and resource access patterns