Prerequisites: Make sure you have the Suga CLI installed.
This guide assumes you have an existing application that uses cloud services.
If you’re starting fresh, see the Getting Started Guide.
Initialize Suga Project
Navigate to your existing project directory and initialize Suga:When prompted, provide:
Login to Suga
Initialize Project
- Project name:
my-app
(or your preferred name) - Description: Brief description of your application
suga.yaml
configuration file in your project root.Configure Infrastructure
Open the Suga visual editor to design your infrastructure:Build your infrastructure visually:
Open Suga Editor
-
Drag an entrypoint onto the canvas and name it
ingress
-
Add a service named
app
and connect the entrypoint to it -
Add a bucket named
files
and connect the service to it -
Configure bucket permissions to include
read
,write
, anddelete
-
Configure the service with a command to run locally (e.g.,
go run main.go
ornpm run dev
)
suga.yaml
configuration:suga.yaml
The visual editor automatically maintains valid YAML syntax and ensures proper resource relationships.
Add Container Support
Create a Dockerfile for production deployment:
Dockerfile
If you already have a Dockerfile, ensure it’s referenced correctly in your
suga.yaml
configuration.Generate SDK and Migrate Code
Generate the Suga SDK for your project:Now migrate your application code. Here’s a complete example showing the transformation:
Generate Go SDK
Update Dependencies
main.go
Remove all cloud provider SDK dependencies after migration to avoid conflicts and reduce bundle size.
Test Locally
Start the Suga development environment:Test your migrated application:Expected response:
Start Development Server
Test Endpoint
Suga dev provides local emulation of cloud services. Files are stored locally during development and in real cloud storage when deployed.
Deploy to Cloud
Build your application and generate Terraform:Select your cloud provider and region when prompted. You’ll see:Configure cloud provider credentials:Deploy with Terraform:Type
Build Application
Configure AWS
Navigate to Stack
Initialize Terraform
Preview Changes
Deploy Infrastructure
yes
when prompted. After deployment completes, your application endpoints will be displayed in the output.Your application is now cloud-agnostic. Deploy to AWS or GCP without code
changes.
Next Steps
- Add more resources like databases or queues to your
suga.yaml
- Configure environment-specific settings for staging and production
- Explore Suga’s monitoring and observability features