@vertile-ai/iac 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +73 -37
  2. package/docs/README.md +3 -2
  3. package/docs/index.html +2 -2
  4. package/docs/manifest.md +38 -5
  5. package/examples/bun-hono-api/README.md +9 -0
  6. package/examples/bun-hono-api/infrastructure/iac/iac.do.json +87 -0
  7. package/examples/bun-hono-api/infrastructure/iac/iac.json +107 -0
  8. package/examples/bun-hono-api/package.json +15 -0
  9. package/examples/bun-hono-api/src/index.ts +7 -0
  10. package/examples/go-api/README.md +8 -0
  11. package/examples/go-api/cmd/server/main.go +16 -0
  12. package/examples/go-api/go.mod +3 -0
  13. package/examples/go-api/infrastructure/iac/iac.do.json +90 -0
  14. package/examples/go-api/infrastructure/iac/iac.json +106 -0
  15. package/examples/next-monorepo/README.md +22 -0
  16. package/examples/next-monorepo/apps/admin/package.json +7 -0
  17. package/examples/next-monorepo/apps/web/package.json +7 -0
  18. package/examples/next-monorepo/infrastructure/iac/iac.aws.json +172 -0
  19. package/examples/next-monorepo/infrastructure/iac/iac.do.json +129 -0
  20. package/examples/{dynomic → next-monorepo}/infrastructure/iac/iac.json +102 -23
  21. package/examples/next-monorepo/infrastructure/iac/iac.vercel.json +109 -0
  22. package/examples/{dynomic → next-monorepo}/package.json +2 -2
  23. package/examples/node-api/README.md +8 -0
  24. package/examples/node-api/infrastructure/iac/iac.aws.json +132 -0
  25. package/examples/node-api/infrastructure/iac/iac.json +111 -0
  26. package/examples/node-api/package.json +12 -0
  27. package/examples/node-api/src/server.js +8 -0
  28. package/examples/python-fastapi-api/README.md +8 -0
  29. package/examples/python-fastapi-api/app/main.py +8 -0
  30. package/examples/python-fastapi-api/infrastructure/iac/iac.aws.json +129 -0
  31. package/examples/python-fastapi-api/infrastructure/iac/iac.json +113 -0
  32. package/examples/python-fastapi-api/pyproject.toml +10 -0
  33. package/examples/react-spa/README.md +8 -0
  34. package/examples/react-spa/index.html +2 -0
  35. package/examples/react-spa/infrastructure/iac/iac.aws.json +115 -0
  36. package/examples/react-spa/infrastructure/iac/iac.json +111 -0
  37. package/examples/react-spa/infrastructure/iac/iac.vercel.json +76 -0
  38. package/examples/react-spa/package.json +19 -0
  39. package/examples/react-spa/src/main.jsx +8 -0
  40. package/examples/sveltekit-web/README.md +9 -0
  41. package/examples/sveltekit-web/infrastructure/iac/iac.json +76 -0
  42. package/examples/sveltekit-web/infrastructure/iac/iac.vercel.json +74 -0
  43. package/examples/sveltekit-web/package.json +19 -0
  44. package/examples/sveltekit-web/src/routes/+page.svelte +3 -0
  45. package/examples/sveltekit-web/svelte.config.js +7 -0
  46. package/package.json +1 -1
  47. package/schema/iac.schema.json +83 -2
  48. package/src/apply.mjs +3 -4
  49. package/src/cli.mjs +1 -0
  50. package/src/core/context.mjs +4 -2
  51. package/src/core/deployments.mjs +39 -0
  52. package/src/core/env-files.mjs +38 -0
  53. package/src/core/env-source.mjs +5 -0
  54. package/src/core/hcl.mjs +2 -1
  55. package/src/core/manifest.mjs +15 -1
  56. package/src/core/render.mjs +19 -8
  57. package/src/core/vercel-manifests.mjs +5 -11
  58. package/src/plan.mjs +3 -4
  59. package/src/providers/aws/index.mjs +43 -24
  60. package/src/provision-env.mjs +72 -24
  61. package/src/render.mjs +3 -4
  62. package/src/shared.mjs +0 -4
  63. package/src/sync-env.mjs +33 -38
  64. package/examples/dynomic/README.md +0 -22
  65. package/examples/dynomic/apps/admin/package.json +0 -7
  66. package/examples/dynomic/apps/web/package.json +0 -7
  67. /package/examples/{dynomic → next-monorepo}/apps/admin/vercel.json +0 -0
  68. /package/examples/{dynomic → next-monorepo}/apps/web/vercel.json +0 -0
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "../../../../schema/iac.schema.json",
3
+ "version": 1,
4
+ "project": {
5
+ "key": "next-monorepo",
6
+ "name": "next-monorepo"
7
+ },
8
+ "environments": [
9
+ "development",
10
+ "test",
11
+ "uat",
12
+ "nightly",
13
+ "staging",
14
+ "preview",
15
+ "production"
16
+ ],
17
+ "providers": {
18
+ "vercel": {
19
+ "teamSlug": "vertile-ai",
20
+ "projectDefaults": {
21
+ "nodeVersion": "20.x",
22
+ "enableAffectedProjectsDeployments": true
23
+ }
24
+ }
25
+ },
26
+ "env": {
27
+ "sourceDir": "infrastructure",
28
+ "sync": {
29
+ "apps": [
30
+ "web",
31
+ "admin"
32
+ ],
33
+ "sharedKey": "shared"
34
+ },
35
+ "environments": {
36
+ "development": {
37
+ "files": [
38
+ ".env.development"
39
+ ]
40
+ },
41
+ "test": {
42
+ "files": [
43
+ ".env.test"
44
+ ]
45
+ },
46
+ "uat": {
47
+ "files": [
48
+ ".env.uat"
49
+ ]
50
+ },
51
+ "nightly": {
52
+ "files": [
53
+ ".env.nightly"
54
+ ]
55
+ },
56
+ "staging": {
57
+ "files": [
58
+ ".env.staging"
59
+ ]
60
+ },
61
+ "production": {
62
+ "files": [
63
+ ".env.production"
64
+ ]
65
+ }
66
+ }
67
+ },
68
+ "apps": [
69
+ {
70
+ "key": "web",
71
+ "id": "prj_next_monorepo_web_placeholder",
72
+ "name": "next-monorepo-web",
73
+ "framework": "nextjs",
74
+ "rootDirectory": "apps/web",
75
+ "nodeVersion": "20.x",
76
+ "domains": [
77
+ "next-monorepo.example.com",
78
+ {
79
+ "name": "preview.next-monorepo.example.com",
80
+ "gitBranch": "preview"
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "key": "admin",
86
+ "id": "prj_next_monorepo_admin_placeholder",
87
+ "name": "next-monorepo-admin",
88
+ "framework": "nextjs",
89
+ "rootDirectory": "apps/admin",
90
+ "nodeVersion": "20.x",
91
+ "domains": [
92
+ "admin.next-monorepo.example.com",
93
+ {
94
+ "name": "admin-preview.next-monorepo.example.com",
95
+ "gitBranch": "preview"
96
+ }
97
+ ],
98
+ "env": {
99
+ "sharedPrefix": "ADMIN_"
100
+ }
101
+ }
102
+ ],
103
+ "domains": [
104
+ {
105
+ "name": "www.next-monorepo.example.com",
106
+ "app": "web"
107
+ }
108
+ ]
109
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "dynomic",
2
+ "name": "next-monorepo",
3
3
  "private": true,
4
4
  "scripts": {
5
5
  "iac:env:dry-run": "vertile-iac env --repo-root . --targets=preview,production",
@@ -12,6 +12,6 @@
12
12
  "iac:render": "vertile-iac render --repo-root . --target=vercel --env=production"
13
13
  },
14
14
  "devDependencies": {
15
- "@vertile-ai/iac": "0.0.1"
15
+ "@vertile-ai/iac": "0.1.0"
16
16
  }
17
17
  }
@@ -0,0 +1,8 @@
1
+ # Node API
2
+
3
+ Single-package Node.js HTTP API example with AWS and DigitalOcean targets.
4
+
5
+ ```bash
6
+ vertile-iac render --repo-root examples/node-api --target=all --deployment=prod
7
+ vertile-iac render --repo-root examples/node-api --iac-manifest infrastructure/iac/iac.aws.json --target=aws --deployment=prod
8
+ ```
@@ -0,0 +1,132 @@
1
+ {
2
+ "$schema": "../../../../schema/iac.schema.json",
3
+ "version": 1,
4
+ "project": {
5
+ "key": "node-api",
6
+ "name": "node-api"
7
+ },
8
+ "environments": [
9
+ "development",
10
+ "test",
11
+ "uat",
12
+ "nightly",
13
+ "staging",
14
+ "preview",
15
+ "production"
16
+ ],
17
+ "providers": {
18
+ "aws": {
19
+ "region": "us-east-1",
20
+ "defaultTags": {
21
+ "Example": "node-api",
22
+ "Runtime": "node"
23
+ },
24
+ "resources": [
25
+ {
26
+ "type": "aws_cloudwatch_log_group",
27
+ "name": "api",
28
+ "values": {
29
+ "name": "/examples/node-api",
30
+ "retention_in_days": 7
31
+ }
32
+ }
33
+ ],
34
+ "deployments": {
35
+ "dev": {
36
+ "environment": "development",
37
+ "region": "us-east-1",
38
+ "profile": "node-api-dev",
39
+ "tags": {
40
+ "Stage": "dev"
41
+ }
42
+ },
43
+ "uat": {
44
+ "environment": "uat",
45
+ "region": "us-east-1",
46
+ "profile": "node-api-uat",
47
+ "tags": {
48
+ "Stage": "uat"
49
+ }
50
+ },
51
+ "nightly": {
52
+ "environment": "nightly",
53
+ "region": "us-east-1",
54
+ "profile": "node-api-nightly",
55
+ "tags": {
56
+ "Stage": "nightly"
57
+ }
58
+ },
59
+ "prod": {
60
+ "environment": "production",
61
+ "region": "us-east-1",
62
+ "profile": "node-api-prod",
63
+ "tags": {
64
+ "Stage": "prod"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "apps": [
71
+ {
72
+ "key": "api",
73
+ "name": "node-api",
74
+ "framework": "node",
75
+ "rootDirectory": "."
76
+ }
77
+ ],
78
+ "queues": [
79
+ {
80
+ "key": "jobs",
81
+ "providers": {
82
+ "aws": {
83
+ "visibilityTimeoutSeconds": 45
84
+ }
85
+ }
86
+ }
87
+ ],
88
+ "sandboxes": [
89
+ {
90
+ "key": "api-runner",
91
+ "providers": {
92
+ "aws": {
93
+ "instanceType": "t3.micro"
94
+ }
95
+ }
96
+ }
97
+ ],
98
+ "env": {
99
+ "environments": {
100
+ "development": {
101
+ "files": [
102
+ ".env.development"
103
+ ]
104
+ },
105
+ "test": {
106
+ "files": [
107
+ ".env.test"
108
+ ]
109
+ },
110
+ "uat": {
111
+ "files": [
112
+ ".env.uat"
113
+ ]
114
+ },
115
+ "nightly": {
116
+ "files": [
117
+ ".env.nightly"
118
+ ]
119
+ },
120
+ "staging": {
121
+ "files": [
122
+ ".env.staging"
123
+ ]
124
+ },
125
+ "production": {
126
+ "files": [
127
+ ".env.production"
128
+ ]
129
+ }
130
+ }
131
+ }
132
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "../../../../schema/iac.schema.json",
3
+ "version": 1,
4
+ "project": {
5
+ "key": "node-api",
6
+ "name": "node-api"
7
+ },
8
+ "environments": [
9
+ "development",
10
+ "test",
11
+ "uat",
12
+ "nightly",
13
+ "staging",
14
+ "preview",
15
+ "production"
16
+ ],
17
+ "providers": {
18
+ "aws": {
19
+ "region": "us-east-1",
20
+ "deployments": {
21
+ "dev": {
22
+ "environment": "development",
23
+ "region": "us-east-1",
24
+ "profile": "node-api-dev",
25
+ "tags": {
26
+ "Stage": "dev"
27
+ }
28
+ },
29
+ "uat": {
30
+ "environment": "uat",
31
+ "region": "us-east-1",
32
+ "profile": "node-api-uat",
33
+ "tags": {
34
+ "Stage": "uat"
35
+ }
36
+ },
37
+ "nightly": {
38
+ "environment": "nightly",
39
+ "region": "us-east-1",
40
+ "profile": "node-api-nightly",
41
+ "tags": {
42
+ "Stage": "nightly"
43
+ }
44
+ },
45
+ "prod": {
46
+ "environment": "production",
47
+ "region": "us-east-1",
48
+ "profile": "node-api-prod",
49
+ "tags": {
50
+ "Stage": "prod"
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "digitalocean": {
56
+ "region": "nyc3"
57
+ }
58
+ },
59
+ "apps": [
60
+ {
61
+ "key": "api",
62
+ "name": "node-api",
63
+ "framework": "node",
64
+ "rootDirectory": "."
65
+ }
66
+ ],
67
+ "queues": [
68
+ {
69
+ "key": "jobs"
70
+ }
71
+ ],
72
+ "sandboxes": [
73
+ {
74
+ "key": "api-runner"
75
+ }
76
+ ],
77
+ "env": {
78
+ "environments": {
79
+ "development": {
80
+ "files": [
81
+ ".env.development"
82
+ ]
83
+ },
84
+ "test": {
85
+ "files": [
86
+ ".env.test"
87
+ ]
88
+ },
89
+ "uat": {
90
+ "files": [
91
+ ".env.uat"
92
+ ]
93
+ },
94
+ "nightly": {
95
+ "files": [
96
+ ".env.nightly"
97
+ ]
98
+ },
99
+ "staging": {
100
+ "files": [
101
+ ".env.staging"
102
+ ]
103
+ },
104
+ "production": {
105
+ "files": [
106
+ ".env.production"
107
+ ]
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "node-api",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "start": "node src/server.js",
7
+ "iac:render": "vertile-iac render --repo-root . --target=all --deployment=prod"
8
+ },
9
+ "devDependencies": {
10
+ "@vertile-ai/iac": "0.1.0"
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ import http from 'node:http'
2
+
3
+ const server = http.createServer((_request, response) => {
4
+ response.writeHead(200, { 'content-type': 'application/json' })
5
+ response.end(JSON.stringify({ ok: true, runtime: 'node' }))
6
+ })
7
+
8
+ server.listen(process.env.PORT || 3000)
@@ -0,0 +1,8 @@
1
+ # Python FastAPI API
2
+
3
+ Python backend example with PostgreSQL and provider-specific AWS settings.
4
+
5
+ ```bash
6
+ vertile-iac render --repo-root examples/python-fastapi-api --target=all --deployment=prod
7
+ vertile-iac render --repo-root examples/python-fastapi-api --iac-manifest infrastructure/iac/iac.aws.json --target=aws --deployment=prod
8
+ ```
@@ -0,0 +1,8 @@
1
+ from fastapi import FastAPI
2
+
3
+ app = FastAPI()
4
+
5
+
6
+ @app.get("/health")
7
+ def health():
8
+ return {"ok": True, "runtime": "python"}
@@ -0,0 +1,129 @@
1
+ {
2
+ "$schema": "../../../../schema/iac.schema.json",
3
+ "version": 1,
4
+ "project": {
5
+ "key": "python-fastapi-api",
6
+ "name": "python-fastapi-api"
7
+ },
8
+ "environments": [
9
+ "development",
10
+ "test",
11
+ "uat",
12
+ "nightly",
13
+ "staging",
14
+ "preview",
15
+ "production"
16
+ ],
17
+ "providers": {
18
+ "aws": {
19
+ "region": "us-east-1",
20
+ "defaultTags": {
21
+ "Example": "python-fastapi-api",
22
+ "Runtime": "python"
23
+ },
24
+ "deployments": {
25
+ "dev": {
26
+ "environment": "development",
27
+ "region": "us-east-1",
28
+ "profile": "python-fastapi-api-dev",
29
+ "tags": {
30
+ "Stage": "dev"
31
+ }
32
+ },
33
+ "uat": {
34
+ "environment": "uat",
35
+ "region": "us-east-1",
36
+ "profile": "python-fastapi-api-uat",
37
+ "tags": {
38
+ "Stage": "uat"
39
+ }
40
+ },
41
+ "nightly": {
42
+ "environment": "nightly",
43
+ "region": "us-east-1",
44
+ "profile": "python-fastapi-api-nightly",
45
+ "tags": {
46
+ "Stage": "nightly"
47
+ }
48
+ },
49
+ "prod": {
50
+ "environment": "production",
51
+ "region": "us-east-1",
52
+ "profile": "python-fastapi-api-prod",
53
+ "tags": {
54
+ "Stage": "prod"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ },
60
+ "apps": [
61
+ {
62
+ "key": "api",
63
+ "name": "python-fastapi-api",
64
+ "framework": "fastapi",
65
+ "rootDirectory": "."
66
+ }
67
+ ],
68
+ "databases": [
69
+ {
70
+ "key": "appdb",
71
+ "engine": "postgres",
72
+ "providers": {
73
+ "aws": {
74
+ "engineVersion": "16",
75
+ "instanceClass": "db.t4g.micro",
76
+ "allocatedStorage": 20,
77
+ "databaseName": "fastapi",
78
+ "username": "fastapi",
79
+ "skipFinalSnapshot": true
80
+ }
81
+ }
82
+ }
83
+ ],
84
+ "clusters": [
85
+ {
86
+ "key": "workers",
87
+ "size": 2,
88
+ "providers": {
89
+ "aws": {
90
+ "instanceType": "t3.micro"
91
+ }
92
+ }
93
+ }
94
+ ],
95
+ "env": {
96
+ "environments": {
97
+ "development": {
98
+ "files": [
99
+ ".env.development"
100
+ ]
101
+ },
102
+ "test": {
103
+ "files": [
104
+ ".env.test"
105
+ ]
106
+ },
107
+ "uat": {
108
+ "files": [
109
+ ".env.uat"
110
+ ]
111
+ },
112
+ "nightly": {
113
+ "files": [
114
+ ".env.nightly"
115
+ ]
116
+ },
117
+ "staging": {
118
+ "files": [
119
+ ".env.staging"
120
+ ]
121
+ },
122
+ "production": {
123
+ "files": [
124
+ ".env.production"
125
+ ]
126
+ }
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "$schema": "../../../../schema/iac.schema.json",
3
+ "version": 1,
4
+ "project": {
5
+ "key": "python-fastapi-api",
6
+ "name": "python-fastapi-api"
7
+ },
8
+ "environments": [
9
+ "development",
10
+ "test",
11
+ "uat",
12
+ "nightly",
13
+ "staging",
14
+ "preview",
15
+ "production"
16
+ ],
17
+ "providers": {
18
+ "aws": {
19
+ "region": "us-east-1",
20
+ "deployments": {
21
+ "dev": {
22
+ "environment": "development",
23
+ "region": "us-east-1",
24
+ "profile": "python-fastapi-api-dev",
25
+ "tags": {
26
+ "Stage": "dev"
27
+ }
28
+ },
29
+ "uat": {
30
+ "environment": "uat",
31
+ "region": "us-east-1",
32
+ "profile": "python-fastapi-api-uat",
33
+ "tags": {
34
+ "Stage": "uat"
35
+ }
36
+ },
37
+ "nightly": {
38
+ "environment": "nightly",
39
+ "region": "us-east-1",
40
+ "profile": "python-fastapi-api-nightly",
41
+ "tags": {
42
+ "Stage": "nightly"
43
+ }
44
+ },
45
+ "prod": {
46
+ "environment": "production",
47
+ "region": "us-east-1",
48
+ "profile": "python-fastapi-api-prod",
49
+ "tags": {
50
+ "Stage": "prod"
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "digitalocean": {
56
+ "region": "nyc3"
57
+ }
58
+ },
59
+ "apps": [
60
+ {
61
+ "key": "api",
62
+ "name": "python-fastapi-api",
63
+ "framework": "fastapi",
64
+ "rootDirectory": "."
65
+ }
66
+ ],
67
+ "databases": [
68
+ {
69
+ "key": "appdb",
70
+ "engine": "postgres"
71
+ }
72
+ ],
73
+ "clusters": [
74
+ {
75
+ "key": "workers",
76
+ "size": 2
77
+ }
78
+ ],
79
+ "env": {
80
+ "environments": {
81
+ "development": {
82
+ "files": [
83
+ ".env.development"
84
+ ]
85
+ },
86
+ "test": {
87
+ "files": [
88
+ ".env.test"
89
+ ]
90
+ },
91
+ "uat": {
92
+ "files": [
93
+ ".env.uat"
94
+ ]
95
+ },
96
+ "nightly": {
97
+ "files": [
98
+ ".env.nightly"
99
+ ]
100
+ },
101
+ "staging": {
102
+ "files": [
103
+ ".env.staging"
104
+ ]
105
+ },
106
+ "production": {
107
+ "files": [
108
+ ".env.production"
109
+ ]
110
+ }
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,10 @@
1
+ [project]
2
+ name = "python-fastapi-api"
3
+ version = "0.0.0"
4
+ dependencies = [
5
+ "fastapi",
6
+ "uvicorn",
7
+ ]
8
+
9
+ [tool.vertile]
10
+ example = true
@@ -0,0 +1,8 @@
1
+ # React SPA
2
+
3
+ Vite React single-page application example with Vercel and AWS variants.
4
+
5
+ ```bash
6
+ vertile-iac render --repo-root examples/react-spa --target=all --deployment=prod
7
+ vertile-iac render --repo-root examples/react-spa --iac-manifest infrastructure/iac/iac.vercel.json --target=vercel --env=production
8
+ ```
@@ -0,0 +1,2 @@
1
+ <div id="root"></div>
2
+ <script type="module" src="/src/main.jsx"></script>