Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 71 additions & 1 deletion docs/guides/add-suga.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,76 @@ Suga helps you migrate existing applications to a cloud-agnostic architecture. W
log.Fatal(http.ListenAndServe(":"+port, router))
}
```
</Tab>
<Tab title="Diff">
```diff title="main.go" icon="file-plus-minus"
package main

import (
+ "example/suga"
- "context"
"fmt"
"log"
"net/http"
"os"
- "strings"
- "github.com/aws/aws-sdk-go-v2/aws"
- "github.com/aws/aws-sdk-go-v2/config"
- "github.com/aws/aws-sdk-go-v2/service/s3"
)

func main() {
- // Load AWS configuration
- cfg, err := config.LoadDefaultConfig(context.TODO())
- if err != nil {
- log.Fatalf("Failed to load AWS config: %v", err)
- }

- // Create S3 client
- s3Client := s3.NewFromConfig(cfg)
- bucketName := os.Getenv("S3_BUCKET_NAME")

+ // Initialize Suga client
+ app, err := suga.NewClient()
+ if err != nil {
+ log.Fatalf("Failed to create suga client: %v", err)
+ }


router := http.NewServeMux()
router.HandleFunc("GET /hello/{name}", func(w http.ResponseWriter, r *http.Request) {
name := r.PathValue("name")

- // AWS S3 PutObject
- _, err := s3Client.PutObject(context.TODO(), &s3.PutObjectInput{
- Bucket: aws.String(bucketName),
- Key: aws.String("example.txt"),
- Body: strings.NewReader("Hello, " + name + "!"),
- })
- if err != nil {
- log.Printf("Failed to upload to S3: %v", err)
- http.Error(w, "Error uploading to S3", http.StatusInternalServerError)
- return
- }
+ // Simplified file write using Suga
+ if err := app.Files.Write("example.txt", []byte("Hello, "+name+"!")); err != nil {
+ log.Printf("Failed to write file: %v", err)
+ http.Error(w, "Error writing file", http.StatusInternalServerError)
+ return
+ }

fmt.Fprintf(w, "Hello, %s!", name)
})

port := os.Getenv("PORT")
if port == "" {
port = "8080"
}

log.Printf("Server starting on port %s\n", port)
log.Fatal(http.ListenAndServe(":"+port, router))
}
```
</Tab>
<Tab title="After: Suga SDK">
```go title="main.go" icon="rocket"
Expand Down Expand Up @@ -266,7 +336,7 @@ Suga helps you migrate existing applications to a cloud-agnostic architecture. W

Select your cloud provider and region when prompted. You'll see:

```
```bash
✓ Terraform generated successfully
output written to ./.suga/stacks/my-app-aws-12345

Expand Down
3 changes: 3 additions & 0 deletions docs/guides/aws/environment-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ graph TB
ProdRole -->|Deploys to| Prod

Admin --> S3

classDef nitricGreen stroke:#25b355,stroke-width:2px
class Admin,DevRole,StagingRole,ProdRole,Dev,Staging,Prod nitricGreen
```

Each target account has a `TerraformRole` that trusts the administrative account, allowing Terraform to assume the role and deploy resources to the appropriate environment.
Expand Down
19 changes: 10 additions & 9 deletions docs/guides/terraform-backend-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ After running `suga build`, add a backend configuration file to the synthesized

<Step title="Add Backend Configuration">
Choose your backend provider and add the appropriate configuration:

<Expandable title="AWS S3 Backend" defaultOpen={false}>
<Tabs>
<Tab title="AWS S3">
```hcl title="backend.tf - AWS S3" icon="aws"
terraform {
backend "s3" {
Expand All @@ -72,9 +72,9 @@ After running `suga build`, add a backend configuration file to the synthesized
<Warning>
Ensure your S3 bucket has versioning enabled and consider enabling MFA delete for production environments.
</Warning>
</Expandable>
</Tab>

<Expandable title="Google Cloud Storage Backend" defaultOpen={false}>
<Tab title="Google Cloud Storage">
```hcl title="backend.tf - Google Cloud" icon="cloud"
terraform {
backend "gcs" {
Expand All @@ -87,9 +87,9 @@ After running `suga build`, add a backend configuration file to the synthesized
<Tip>
Enable object versioning on your GCS bucket to maintain state history.
</Tip>
</Expandable>
</Tab>

<Expandable title="Azure Storage Backend" defaultOpen={false}>
<Tab title="Azure Storage">
```hcl title="backend.tf - Azure Storage" icon="cloud"
terraform {
backend "azurerm" {
Expand All @@ -100,9 +100,9 @@ After running `suga build`, add a backend configuration file to the synthesized
}
}
```
</Expandable>
</Tab>

<Expandable title="Terraform Cloud Backend" defaultOpen={false}>
<Tab title="Terraform Cloud">
```hcl title="backend.tf - Terraform Cloud" icon="cloud"
terraform {
backend "remote" {
Expand All @@ -113,7 +113,8 @@ After running `suga build`, add a backend configuration file to the synthesized
}
}
```
</Expandable>
</Tab>
</Tabs>
</Step>

<Step title="Initialize and Deploy">
Expand Down
16 changes: 15 additions & 1 deletion docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@ sidebarTitle: "Introduction"
description: "Cloud development with visual design, local testing, and multi-cloud deployment"
---

Suga makes cloud development simple by combining visual infrastructure design with automatic Terraform generation. Build applications with any framework, test locally with emulated cloud resources, and deploy anywhere with production-ready Terraform.
Suga makes cloud development simple by combining visual infrastructure design with automatic Terraform generation for AWS or GCP today (Azure coming soon).
Build applications with any framework, test locally with emulated cloud resources, and deploy anywhere with production-ready Terraform.
```mermaid
graph LR
HardenedInfra["Hardened Building Blocks"] ==> AppDesigner["Infrastructure Designer"]
AppDesigner ==> Generate["Generate Terraform"]
AppDesigner ==> Code["Code integration"]
Code ==> Test["Local Testing"]
Test ==> Deploy["Deploy"]
Generate ==> Deploy["Deploy"]

classDef nitricGreen stroke:#25b355,stroke-width:2px
class HardenedInfra,AppDesigner,Code,Test,Generate,Deploy nitricGreen

```

<Card title="Get Started" icon="rocket" href="/quickstart" horizontal>
Deploy your first application in minutes with the quickstart guide.
Expand Down
34 changes: 21 additions & 13 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ Deploy your first application on the Suga platform in just a few steps. The Suga
```

Select a template that matches your use case:

```
<Tip>
You can make your own templates too.
</Tip>
```bash
Welcome to Suga, this command will help you create a project from a template.
If you already have a project, run suga init instead.

Expand Down Expand Up @@ -80,7 +82,7 @@ Deploy your first application on the Suga platform in just a few steps. The Suga
```

You'll see a confirmation:
```
```bash
⚡ Suga Logging in...

✓ Logged in as User
Expand All @@ -93,7 +95,7 @@ Deploy your first application on the Suga platform in just a few steps. The Suga
```

The editor launches in your browser:
```
```bash
⚡ Suga Editor
Opening visual editor at http://localhost:3001
Press Ctrl+C to stop the editor
Expand All @@ -107,7 +109,7 @@ Deploy your first application on the Suga platform in just a few steps. The Suga
The editor automatically updates your `suga.yaml` file as you make changes.
</Tip>

Let's review what the template `suga.yaml` has:
Let's review what the `go-standard` template has defined in the `suga.yaml`:

```yaml title="suga.yaml" icon="file-code"
targets:
Expand Down Expand Up @@ -154,7 +156,7 @@ Deploy your first application on the Suga platform in just a few steps. The Suga

Your application starts with hot reload:

```
```bash
⚡ Suga v1.0.0
- App: my-first-app
- Addr: http://localhost:50051
Expand Down Expand Up @@ -207,8 +209,8 @@ Deploy your first application on the Suga platform in just a few steps. The Suga
suga build
```

You'll see the build output:
```
You'll see the build output as a terraform stack with everything needed to deploy your application to the cloud:
```bash
✓ Terraform generated successfully
output written to ./.suga/stacks/my-first-app-aws-12345

Expand Down Expand Up @@ -253,7 +255,7 @@ Deploy your first application on the Suga platform in just a few steps. The Suga
```

Confirm when prompted:
```
```bash
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Expand All @@ -275,10 +277,16 @@ Deploy your first application on the Suga platform in just a few steps. The Suga

**What you've accomplished:**

- ✅ Created and configured a Suga application from a template
- ✅ Developed and tested your application locally with hot reload
- ✅ Generated production-ready Terraform infrastructure code
- ✅ Deployed your application to your chosen cloud provider
```mermaid
graph TB
One["Created and configured a Suga application from a template"] ==> Two["Developed and tested your application locally with hot reload"]
Two ==> Three["Generated production-ready Terraform infrastructure code"]
Three ==> Four["Deployed your application to your chosen cloud provider"]

classDef nitricGreen stroke:#25b355,stroke-width:2px
class One,Two,Three,Four nitricGreen

```

<Note>
**Need help?** Contact [support@addsuga.com](mailto:support@addsuga.com) or
Expand Down