Skip to content

Commit 1c9624a

Browse files
committed
docs: add more docs on foundations, resources, support and more
1 parent adb9021 commit 1c9624a

37 files changed

+4726
-36
lines changed

docs/.vale/styles/config/vocabularies/Suga/accept.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,24 @@ nav
284284
prev
285285
next
286286
toc
287-
uv
287+
uv
288+
Monorepo
289+
monorepo
290+
Minio
291+
Prisma
292+
SQLAlchemy
293+
datasource
294+
sqlalchemy
295+
ORMs
296+
api
297+
debugpy
298+
dlv
299+
pgx
300+
sqlx
301+
pgxpool
302+
playsInline
303+
Reusability
304+
Pulumi
305+
SREs
306+
DevOps
307+
cicd

docs/deploy/aws.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "AWS Deployment"
3+
description: "Deploy Suga applications to Amazon Web Services"
4+
---
5+
6+
Deploy Suga applications to AWS using Lambda, Fargate, S3, and CloudFront.
7+
8+
## Prerequisites
9+
10+
- AWS account
11+
- AWS CLI configured
12+
- Terraform installed
13+
14+
## Quick Start
15+
16+
```bash
17+
# Build your application
18+
suga build
19+
20+
# Navigate to generated stack
21+
cd terraform/stacks/my-app
22+
```
23+
24+
Create provider configuration:
25+
26+
```hcl title="provider.tf"
27+
provider "aws" {
28+
region = "us-west-2"
29+
}
30+
```
31+
32+
Deploy:
33+
34+
```bash
35+
terraform init
36+
terraform apply
37+
```
38+
39+
<Card title="Complete Deployment Guide" icon="rocket" href="/foundations/deployment" horizontal>
40+
See the full deployment workflow
41+
</Card>

docs/deploy/azure.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: "Azure Deployment"
3+
description: "Deploy Suga applications to Microsoft Azure"
4+
---
5+
6+
Azure support is coming soon.
7+
8+
<Note>
9+
Azure platform development is in progress. Check back soon for updates.
10+
</Note>
11+
12+
## Interested in Azure Support?
13+
14+
Contact [support@addsuga.com](mailto:support@addsuga.com) to express interest or get notified when Azure support is available.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: "Environment Management"
3+
description: "Managing multiple deployment environments (dev, staging, production)"
4+
---
5+
6+
Manage multiple environments using Terraform workspaces and variable files.
7+
8+
## Using Workspaces
9+
10+
```bash
11+
# Create workspaces
12+
terraform workspace new dev
13+
terraform workspace new staging
14+
terraform workspace new prod
15+
16+
# Deploy to dev
17+
terraform workspace select dev
18+
terraform apply -var-file=environments/dev.tfvars
19+
20+
# Deploy to prod
21+
terraform workspace select prod
22+
terraform apply -var-file=environments/prod.tfvars
23+
```
24+
25+
## Environment-Specific Configuration
26+
27+
```hcl title="environments/dev.tfvars"
28+
services_api_memory = 512
29+
services_api_timeout = 10
30+
```
31+
32+
```hcl title="environments/prod.tfvars"
33+
services_api_memory = 2048
34+
services_api_timeout = 30
35+
```

docs/deploy/gcp.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "GCP Deployment"
3+
description: "Deploy Suga applications to Google Cloud Platform"
4+
---
5+
6+
Deploy Suga applications to GCP using Cloud Run, Cloud Storage, and Cloud CDN.
7+
8+
## Prerequisites
9+
10+
- Google Cloud account
11+
- gcloud CLI configured
12+
- Terraform installed
13+
14+
## Quick Start
15+
16+
```bash
17+
# Build your application
18+
suga build
19+
20+
# Navigate to generated stack
21+
cd terraform/stacks/my-app
22+
```
23+
24+
Configure required variables:
25+
26+
```hcl title="terraform.tfvars"
27+
project_id = "my-gcp-project"
28+
region = "us-central1"
29+
```
30+
31+
Deploy:
32+
33+
```bash
34+
terraform init
35+
terraform apply
36+
```
37+
38+
<Card title="Complete Deployment Guide" icon="rocket" href="/foundations/deployment" horizontal>
39+
See the full deployment workflow
40+
</Card>

docs/deploy/overview.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Deployment Overview"
3+
description: "Overview of deploying Suga applications to cloud providers"
4+
---
5+
6+
Deploying with Suga means running standard Terraform commands on infrastructure generated by `suga build`.
7+
8+
<Card title="Complete Deployment Guide" icon="rocket" href="/foundations/deployment" horizontal>
9+
See the comprehensive deployment guide in Foundations
10+
</Card>
11+
12+
## Quick Links
13+
14+
<CardGroup cols={2}>
15+
<Card title="AWS Deployment" icon="aws" href="/deploy/aws">
16+
Deploy to Amazon Web Services
17+
</Card>
18+
19+
<Card title="GCP Deployment" icon="google" href="/deploy/gcp">
20+
Deploy to Google Cloud Platform
21+
</Card>
22+
23+
<Card title="Azure Deployment" icon="microsoft" href="/deploy/azure">
24+
Deploy to Microsoft Azure
25+
</Card>
26+
27+
<Card title="Terraform Configuration" icon="code" href="/deploy/terraform-configuration">
28+
Configure Terraform backends and state
29+
</Card>
30+
</CardGroup>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "Terraform Configuration"
3+
description: "Configure Terraform backends, state management, and variables"
4+
---
5+
6+
## Remote State Backends
7+
8+
<Card title="Terraform Backend Configuration" icon="database" href="/guides/terraform-backend-config" horizontal>
9+
See the complete backend configuration guide
10+
</Card>
11+
12+
## Workspaces for Multiple Environments
13+
14+
```bash
15+
terraform workspace new dev
16+
terraform workspace new staging
17+
terraform workspace new prod
18+
```
19+
20+
<Card title="Environment Management" icon="layers" href="/deploy/environment-management" horizontal>
21+
Learn about managing multiple environments
22+
</Card>

docs/develop/access-control.mdx

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: "Access Control"
3+
description: "Managing permissions and security in Suga applications"
4+
---
5+
6+
Suga's access control model defines which services can access which resources, automatically generating appropriate IAM policies or service account permissions.
7+
8+
![temp](/images/develop/access-control/service-to-bucket-access-control.png)
9+
10+
## How Access Control Works
11+
12+
Access is granted through the `access` property on resources, which can be modified in your project's `suga.yaml` or through the visual editor with the `suga edit` CLI command.
13+
14+
```yaml
15+
buckets:
16+
uploads:
17+
access:
18+
api: [read, write] # API service can read and write
19+
worker: [read, delete] # Worker can read and delete
20+
21+
databases:
22+
main:
23+
access:
24+
api: [query] # API can query database
25+
```
26+
27+
When you deploy, Suga generates:
28+
- **IAM policies** (AWS) with least-privilege permissions
29+
- **Service account bindings** (GCP) with appropriate roles
30+
- **Network security rules** allowing service-to-resource communication
31+
32+
## Permission Types
33+
34+
### Bucket Permissions
35+
36+
- `read` - Download/read objects
37+
- `write` - Upload/write objects
38+
- `delete` - Delete objects
39+
- `all` - Shorthand for read, write, delete
40+
41+
```yaml
42+
buckets:
43+
data:
44+
access:
45+
uploader: [write]
46+
processor: [read, delete]
47+
api: [read]
48+
```
49+
50+
### Database Permissions
51+
52+
- `query` - Full SQL access (SELECT, INSERT, UPDATE, DELETE)
53+
54+
```yaml
55+
databases:
56+
main:
57+
access:
58+
api: [query]
59+
analytics: [query]
60+
```
61+
62+
## Least Privilege
63+
64+
Suga encourages and follows the principle of least privilege:
65+
- By default, services cannot access other resources
66+
- Services only get permissions they need
67+
- No wildcards or overly broad policies
68+
- Separate identities per service
69+
70+
When using the standard Suga AWS Platforms (`suga/aws`), here is an example of the kind of IAM policy that will be generated:
71+
72+
```json
73+
{
74+
"Version": "2012-10-17",
75+
"Statement": [
76+
{
77+
"Effect": "Allow",
78+
"Action": [
79+
"s3:GetObject",
80+
"s3:PutObject"
81+
],
82+
"Resource": "arn:aws:s3:::my-app-uploads/*"
83+
}
84+
]
85+
}
86+
```
87+
88+
<Note>
89+
If you use your own Suga [resource plugins](/foundations/plugins), you're free to construct the IAM, roles, etc. as you see fit.
90+
</Note>
91+
92+
## Best Practices
93+
94+
1. **Grant minimum permissions** - Only what each service needs
95+
2. **Separate services** - Different services for different roles
96+
3. **Review access patterns** - Regularly audit who accesses what
97+
4. **Use read-only when possible** - Many services only need read access
98+
99+
## Learn More
100+
101+
<CardGroup cols={2}>
102+
<Card title="Services" icon="server" href="/develop/services">
103+
Service configuration
104+
</Card>
105+
106+
<Card title="Buckets" icon="box" href="/develop/buckets">
107+
Bucket permissions
108+
</Card>
109+
110+
<Card title="Databases" icon="database" href="/develop/databases">
111+
Database access
112+
</Card>
113+
114+
<Card title="AWS Deployment" icon="aws" href="/deploy/aws">
115+
AWS IAM details
116+
</Card>
117+
</CardGroup>

0 commit comments

Comments
 (0)