stacks 0.58.55 → 0.58.57
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.
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +1 -1
- package/core/ai/package.json +1 -1
- package/core/alias/package.json +1 -1
- package/core/analytics/package.json +1 -1
- package/core/api/package.json +1 -1
- package/core/arrays/package.json +1 -1
- package/core/auth/package.json +1 -1
- package/core/buddy/dist/{chunk-d52e40a990b45728.js → chunk-e9c0ec1a3b7be088.js} +120 -92
- package/core/buddy/dist/cli.js +1 -1
- package/core/buddy/dist/index.js +1 -1
- package/core/buddy/package.json +1 -1
- package/core/buddy/src/commands/configure.ts +38 -27
- package/core/buddy/src/commands/deploy.ts +81 -56
- package/core/buddy/src/commands/setup.ts +11 -9
- package/core/build/package.json +1 -1
- package/core/bun-create/bud/package.json +1 -1
- package/core/bun-create/buddy/package.json +1 -1
- package/core/bun-create/stack/package.json +1 -1
- package/core/bun-create/stacks/package.json +1 -1
- package/core/bun-create/stx/package.json +1 -1
- package/core/bun-plugin-yaml/package.json +1 -1
- package/core/cache/package.json +1 -1
- package/core/chat/package.json +1 -1
- package/core/cli/dist/index.js +7 -1
- package/core/cli/package.json +1 -1
- package/core/cli/src/exec.ts +8 -0
- package/core/cloud/deploy.ts +3 -2
- package/core/cloud/dist/index.js +131 -70
- package/core/cloud/package.json +1 -1
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +1 -1
- package/core/cloud/src/cloud/index.ts +76 -50
- package/core/cloud/src/cloud/queue.ts +86 -29
- package/core/cloud/src/cloud/router-layer/nodejs/package.json +2 -2
- package/core/collections/package.json +1 -1
- package/core/config/package.json +1 -1
- package/core/database/package.json +1 -1
- package/core/datetime/package.json +1 -1
- package/core/desktop/package.json +1 -1
- package/core/development/package.json +1 -1
- package/core/dns/package.json +1 -1
- package/core/docs/package.json +1 -1
- package/core/email/package.json +1 -1
- package/core/enums/package.json +1 -1
- package/core/env/package.json +1 -1
- package/core/env/src/types.ts +1 -1
- package/core/error-handling/package.json +1 -1
- package/core/eslint-config/package.json +1 -1
- package/core/events/package.json +1 -1
- package/core/faker/package.json +1 -1
- package/core/git/package.json +1 -1
- package/core/health/package.json +1 -1
- package/core/http/package.json +1 -1
- package/core/lint/package.json +1 -1
- package/core/logging/dist/index.js +161 -4
- package/core/logging/package.json +1 -1
- package/core/logging/src/index.ts +55 -12
- package/core/notifications/package.json +1 -1
- package/core/objects/package.json +1 -1
- package/core/orm/package.json +1 -1
- package/core/path/dist/index.js +1 -1
- package/core/path/package.json +1 -1
- package/core/path/src/index.ts +1 -1
- package/core/payments/package.json +1 -1
- package/core/push/package.json +1 -1
- package/core/query-builder/package.json +1 -1
- package/core/queue/dist/index.js +3 -1
- package/core/queue/package.json +1 -1
- package/core/queue/src/index.ts +3 -1
- package/core/raycast/package.json +1 -1
- package/core/realtime/package.json +1 -1
- package/core/repl/package.json +1 -1
- package/core/router/package.json +1 -1
- package/core/scheduler/package.json +1 -1
- package/core/search-engine/package.json +1 -1
- package/core/security/package.json +1 -1
- package/core/server/package.json +1 -1
- package/core/signals/package.json +1 -1
- package/core/slug/package.json +1 -1
- package/core/sms/package.json +1 -1
- package/core/storage/package.json +1 -1
- package/core/strings/package.json +1 -1
- package/core/tables/package.json +1 -1
- package/core/testing/package.json +1 -1
- package/core/tinker/package.json +1 -1
- package/core/tunnel/package.json +1 -1
- package/core/types/dist/index.js +8 -3
- package/core/types/package.json +1 -1
- package/core/types/src/configure.ts +7 -0
- package/core/types/src/cron-jobs.ts +8 -3
- package/core/ui/package.json +1 -1
- package/core/utils/dist/index.js +1 -1
- package/core/utils/package.json +1 -1
- package/core/validation/package.json +1 -1
- package/core/vite/dist/index.js +1 -1
- package/core/vite/package.json +1 -1
- package/core/whois/package.json +1 -1
- package/core/x-ray/package.json +1 -1
- package/core/zsh-buddy/package.json +1 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import process from 'node:process'
|
|
|
3
3
|
import { ExitCode } from '@stacksjs/types'
|
|
4
4
|
import type { CLI, DeployOptions } from '@stacksjs/types'
|
|
5
5
|
import { runAction } from '@stacksjs/actions'
|
|
6
|
-
import { intro, italic, log, outro } from '@stacksjs/cli'
|
|
6
|
+
import { intro, italic, log, outro, runCommand } from '@stacksjs/cli'
|
|
7
7
|
import { Action } from '@stacksjs/enums'
|
|
8
8
|
import { app } from '@stacksjs/config'
|
|
9
9
|
import { addDomain, hasUserDomainBeenAddedToCloud } from '@stacksjs/dns'
|
|
@@ -25,72 +25,24 @@ export function deploy(buddy: CLI) {
|
|
|
25
25
|
const domain = options.domain || app.url
|
|
26
26
|
|
|
27
27
|
if (!domain) {
|
|
28
|
-
log.info('
|
|
29
|
-
log.info('Please
|
|
30
|
-
|
|
31
|
-
log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
|
|
32
|
-
console.log('')
|
|
33
|
-
log.info(' ➡️ Example: `buddy deploy --domain example.com`')
|
|
34
|
-
console.log('')
|
|
28
|
+
log.info('No domain found in your .env or ./config/app.ts')
|
|
29
|
+
log.info('Please ensure your domain is properly configured.')
|
|
30
|
+
log.info('For more info, check out the docs or join our Discord.')
|
|
35
31
|
process.exit(ExitCode.FatalError)
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
// TODO: add check for whether the local APP_ENV is getting deployed, if so, ask if the user meant to deploy `dev`
|
|
40
|
-
if (domain.includes('localhost')) {
|
|
41
|
-
log.info('You are deploying to a local environment.')
|
|
42
|
-
log.info('Please set your .env or ./config/app.ts properly.')
|
|
43
|
-
console.log('')
|
|
44
|
-
log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
|
|
45
|
-
console.log('')
|
|
46
|
-
log.info(' ➡️ Example: `buddy deploy --domain example.com`')
|
|
47
|
-
console.log('')
|
|
48
|
-
process.exit(ExitCode.FatalError)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (await hasUserDomainBeenAddedToCloud(domain)) {
|
|
52
|
-
log.info('Domain is properly configured')
|
|
53
|
-
log.info('Your cloud is deploying...')
|
|
54
|
-
|
|
55
|
-
log.info(`${italic('This may take a while...')}`)
|
|
56
|
-
options.domain = domain
|
|
34
|
+
await checkIfAwsIsConfigured()
|
|
57
35
|
|
|
58
|
-
|
|
59
|
-
const result = await runAction(Action.Deploy, options)
|
|
60
|
-
|
|
61
|
-
if (result.isErr()) {
|
|
62
|
-
await outro('While running the `buddy deploy`, there was an issue', { startTime, useSeconds: true }, result.error)
|
|
63
|
-
process.exit(ExitCode.FatalError)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
await outro('Deployment succeeded.', { startTime, useSeconds: true })
|
|
67
|
-
|
|
68
|
-
process.exit(ExitCode.Success)
|
|
69
|
-
}
|
|
36
|
+
options.domain = await configureDomain(domain, options, startTime)
|
|
70
37
|
|
|
71
|
-
|
|
72
|
-
// and then exit the process with prompts for the user to update their nameservers
|
|
73
|
-
console.log('')
|
|
74
|
-
log.info(` 👋 It appears to be your first ${italic(domain)} deployment.`)
|
|
75
|
-
console.log('')
|
|
76
|
-
log.info(italic('Let’s ensure it is all connected properly.'))
|
|
77
|
-
log.info(italic('One moment...'))
|
|
78
|
-
console.log('')
|
|
79
|
-
|
|
80
|
-
options.domain = domain
|
|
81
|
-
const result = await addDomain({
|
|
82
|
-
...options,
|
|
83
|
-
deploy: true,
|
|
84
|
-
startTime,
|
|
85
|
-
})
|
|
38
|
+
const result = await runAction(Action.Deploy, options)
|
|
86
39
|
|
|
87
40
|
if (result.isErr()) {
|
|
88
41
|
await outro('While running the `buddy deploy`, there was an issue', { startTime, useSeconds: true }, result.error)
|
|
89
42
|
process.exit(ExitCode.FatalError)
|
|
90
43
|
}
|
|
91
44
|
|
|
92
|
-
await outro('
|
|
93
|
-
process.exit(ExitCode.Success)
|
|
45
|
+
await outro('Project deployed.', { startTime, useSeconds: true })
|
|
94
46
|
})
|
|
95
47
|
|
|
96
48
|
buddy.on('deploy:*', () => {
|
|
@@ -98,3 +50,76 @@ export function deploy(buddy: CLI) {
|
|
|
98
50
|
process.exit(1)
|
|
99
51
|
})
|
|
100
52
|
}
|
|
53
|
+
|
|
54
|
+
async function configureDomain(domain: string, options: DeployOptions, startTime: number) {
|
|
55
|
+
if (!domain) {
|
|
56
|
+
log.info('We could not identify a domain to deploy to.')
|
|
57
|
+
log.info('Please set your .env or ./config/app.ts properly.')
|
|
58
|
+
console.log('')
|
|
59
|
+
log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
|
|
60
|
+
console.log('')
|
|
61
|
+
log.info(' ➡️ Example: `buddy deploy --domain example.com`')
|
|
62
|
+
console.log('')
|
|
63
|
+
process.exit(ExitCode.FatalError)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// TODO: we can improve this check at some point, otherwise domains that legitimately include the word localhost will fail
|
|
67
|
+
// TODO: add check for whether the local APP_ENV is getting deployed, if so, ask if the user meant to deploy `dev`
|
|
68
|
+
if (domain.includes('localhost')) {
|
|
69
|
+
log.info('You are deploying to a local environment.')
|
|
70
|
+
log.info('Please set your .env or ./config/app.ts properly.')
|
|
71
|
+
console.log('')
|
|
72
|
+
log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
|
|
73
|
+
console.log('')
|
|
74
|
+
log.info(' ➡️ Example: `buddy deploy --domain example.com`')
|
|
75
|
+
console.log('')
|
|
76
|
+
process.exit(ExitCode.FatalError)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (await hasUserDomainBeenAddedToCloud(domain)) {
|
|
80
|
+
log.info('Domain is properly configured')
|
|
81
|
+
log.info('Your cloud is deploying...')
|
|
82
|
+
|
|
83
|
+
log.info(`${italic('This may take a while...')}`)
|
|
84
|
+
|
|
85
|
+
return domain
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// if the domain hasn't been added to the user's (AWS) cloud, we will add it for them
|
|
89
|
+
// and then exit the process with prompts for the user to update their nameservers
|
|
90
|
+
console.log('')
|
|
91
|
+
log.info(` 👋 It appears to be your first ${italic(domain)} deployment.`)
|
|
92
|
+
console.log('')
|
|
93
|
+
log.info(italic('Let’s ensure it is all connected properly.'))
|
|
94
|
+
log.info(italic('One moment...'))
|
|
95
|
+
console.log('')
|
|
96
|
+
|
|
97
|
+
const result = await addDomain({
|
|
98
|
+
...options,
|
|
99
|
+
deploy: true,
|
|
100
|
+
startTime,
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
if (result.isErr()) {
|
|
104
|
+
await outro('While running the `buddy deploy`, there was an issue', { startTime, useSeconds: true }, result.error)
|
|
105
|
+
process.exit(ExitCode.FatalError)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
await outro('Added your domain.', { startTime, useSeconds: true })
|
|
109
|
+
process.exit(ExitCode.Success)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async function checkIfAwsIsConfigured() {
|
|
113
|
+
log.info('Ensuring AWS is configured...')
|
|
114
|
+
const result = await runCommand('buddy configure:aws --quiet', {
|
|
115
|
+
silent: true,
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
if (result.isErr()) {
|
|
119
|
+
log.error('AWS is not configured properly.')
|
|
120
|
+
log.error('Please run `buddy configure:aws` to set up your AWS credentials.')
|
|
121
|
+
process.exit(ExitCode.FatalError)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
log.success('AWS is configured')
|
|
125
|
+
}
|
|
@@ -79,9 +79,11 @@ export function setup(buddy: CLI) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
log.success('Oh My Zsh setup complete
|
|
82
|
+
log.success('Oh My Zsh setup complete')
|
|
83
83
|
log.info('To see changes reflect, you may need to:')
|
|
84
|
-
|
|
84
|
+
// if on vscode show the message
|
|
85
|
+
// log.info('⌘⇧P workbench.action.reloadWindow')
|
|
86
|
+
// else show the message
|
|
85
87
|
})
|
|
86
88
|
|
|
87
89
|
buddy.on('setup:*', () => {
|
|
@@ -149,14 +151,14 @@ async function initializeProject(options: CliOptions): Promise<void> {
|
|
|
149
151
|
|
|
150
152
|
log.info('Ensuring AWS is connected...')
|
|
151
153
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
const awsResult = await runCommand('buddy configure:aws', {
|
|
155
|
+
cwd: options.cwd || p.projectPath(),
|
|
156
|
+
})
|
|
155
157
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
if (awsResult.isErr()) {
|
|
159
|
+
handleError(awsResult.error)
|
|
160
|
+
process.exit(ExitCode.FatalError)
|
|
161
|
+
}
|
|
160
162
|
|
|
161
163
|
log.success('Configured AWS')
|
|
162
164
|
|
package/core/build/package.json
CHANGED
package/core/cache/package.json
CHANGED
package/core/chat/package.json
CHANGED
package/core/cli/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ async function installStack(name, options) {
|
|
|
14
14
|
// src/cli.ts
|
|
15
15
|
import cac from "cac";
|
|
16
16
|
// package.json
|
|
17
|
-
var version = "0.58.
|
|
17
|
+
var version = "0.58.57";
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
20
20
|
function cli(name, options) {
|
|
@@ -58,6 +58,12 @@ async function exec(command, options) {
|
|
|
58
58
|
process.exit(exitCode);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
+
if (options?.stdin === "pipe" && options.input) {
|
|
62
|
+
if (proc.stdin) {
|
|
63
|
+
proc.stdin.write(options.input);
|
|
64
|
+
proc.stdin.end();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
61
67
|
const exited = await proc.exited;
|
|
62
68
|
if (exited === ExitCode.Success)
|
|
63
69
|
return ok(proc);
|
package/core/cli/package.json
CHANGED
package/core/cli/src/exec.ts
CHANGED
|
@@ -46,6 +46,14 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
|
|
|
46
46
|
},
|
|
47
47
|
})
|
|
48
48
|
|
|
49
|
+
// Check if we need to write to stdin
|
|
50
|
+
if (options?.stdin === 'pipe' && options.input) {
|
|
51
|
+
if (proc.stdin) {
|
|
52
|
+
proc.stdin.write(options.input)
|
|
53
|
+
proc.stdin.end()
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
49
57
|
const exited = await proc.exited
|
|
50
58
|
if (exited === ExitCode.Success)
|
|
51
59
|
return ok(proc)
|
package/core/cloud/deploy.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-new */
|
|
2
1
|
import 'source-map-support/register'
|
|
3
2
|
import process from 'node:process'
|
|
4
3
|
import { config } from '@stacksjs/config'
|
|
@@ -76,9 +75,11 @@ export const options = {
|
|
|
76
75
|
timestamp,
|
|
77
76
|
} satisfies CloudOptions
|
|
78
77
|
|
|
79
|
-
new Cloud(app, name, {
|
|
78
|
+
const cloud = new Cloud(app, name, {
|
|
80
79
|
...options,
|
|
81
80
|
description: `The Stacks Cloud`,
|
|
82
81
|
})
|
|
83
82
|
|
|
83
|
+
await cloud.init()
|
|
84
|
+
|
|
84
85
|
app.synth()
|
package/core/cloud/dist/index.js
CHANGED
|
@@ -1795,107 +1795,168 @@ class ComputeStack {
|
|
|
1795
1795
|
|
|
1796
1796
|
// src/cloud/queue.ts
|
|
1797
1797
|
import {aws_ec2 as ec24} from "aws-cdk-lib";
|
|
1798
|
+
import {pascalCase, slug as slug2} from "@stacksjs/strings";
|
|
1799
|
+
import {fs} from "@stacksjs/storage";
|
|
1800
|
+
import {path as path6} from "@stacksjs/path";
|
|
1798
1801
|
import {Rule, Schedule} from "aws-cdk-lib/aws-events";
|
|
1799
1802
|
import {EcsTask} from "aws-cdk-lib/aws-events-targets";
|
|
1800
1803
|
|
|
1801
1804
|
class QueueStack {
|
|
1805
|
+
scope;
|
|
1806
|
+
props;
|
|
1802
1807
|
constructor(scope, props) {
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
{
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
{
|
|
1819
|
-
|
|
1820
|
-
|
|
1808
|
+
this.scope = scope;
|
|
1809
|
+
this.props = props;
|
|
1810
|
+
}
|
|
1811
|
+
async init() {
|
|
1812
|
+
const jobsDir = path6.jobsPath();
|
|
1813
|
+
try {
|
|
1814
|
+
const files = await fs.readdir(jobsDir);
|
|
1815
|
+
for (const file of files) {
|
|
1816
|
+
if (file.endsWith(".ts")) {
|
|
1817
|
+
const filePath = path6.jobsPath(file);
|
|
1818
|
+
const jobModule = await this.loadJobModule(filePath);
|
|
1819
|
+
const rate = jobModule.default.rate || "* * * * *";
|
|
1820
|
+
const schedule = Schedule.cron(this.cronScheduleFromRate(rate));
|
|
1821
|
+
const id = `QueueRule${pascalCase(file.replace(".ts", ""))}`;
|
|
1822
|
+
const rule = new Rule(this.scope, id, {
|
|
1823
|
+
ruleName: `${this.props.appName}-${this.props.appEnv}-queue-rule-${slug2(file.replace(".ts", ""))}`,
|
|
1824
|
+
schedule
|
|
1825
|
+
});
|
|
1826
|
+
rule.addTarget(new EcsTask({
|
|
1827
|
+
cluster: this.props.cluster,
|
|
1828
|
+
taskDefinition: this.props.taskDefinition,
|
|
1829
|
+
containerOverrides: [
|
|
1830
|
+
{
|
|
1831
|
+
containerName: `${this.props.appName}-${this.props.appEnv}-api`,
|
|
1832
|
+
environment: [
|
|
1833
|
+
{
|
|
1834
|
+
name: "QUEUE_WORKER",
|
|
1835
|
+
value: "true"
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
name: "JOB",
|
|
1839
|
+
value: file
|
|
1840
|
+
}
|
|
1841
|
+
]
|
|
1842
|
+
}
|
|
1843
|
+
],
|
|
1844
|
+
retryAttempts: 3,
|
|
1845
|
+
subnetSelection: {
|
|
1846
|
+
subnetType: ec24.SubnetType.PUBLIC
|
|
1821
1847
|
}
|
|
1822
|
-
|
|
1848
|
+
}));
|
|
1823
1849
|
}
|
|
1824
|
-
],
|
|
1825
|
-
retryAttempts: 3,
|
|
1826
|
-
subnetSelection: {
|
|
1827
|
-
subnetType: ec24.SubnetType.PUBLIC
|
|
1828
1850
|
}
|
|
1829
|
-
})
|
|
1851
|
+
} catch (err2) {
|
|
1852
|
+
console.error("Error reading the jobs directory:", err2);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
cronScheduleFromRate(rate) {
|
|
1856
|
+
const parts = rate.split(" ");
|
|
1857
|
+
return {
|
|
1858
|
+
minute: parts[0],
|
|
1859
|
+
hour: parts[1],
|
|
1860
|
+
month: parts[2],
|
|
1861
|
+
weekDay: parts[3],
|
|
1862
|
+
year: parts[4]
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
async loadJobModule(filePath) {
|
|
1866
|
+
const jobModule = await import(filePath);
|
|
1867
|
+
return jobModule;
|
|
1830
1868
|
}
|
|
1831
1869
|
}
|
|
1832
1870
|
|
|
1833
1871
|
// src/cloud/index.ts
|
|
1834
1872
|
class Cloud extends Stack2 {
|
|
1873
|
+
dns;
|
|
1874
|
+
security;
|
|
1875
|
+
storage;
|
|
1876
|
+
network;
|
|
1877
|
+
fileSystem;
|
|
1878
|
+
jumpBox;
|
|
1879
|
+
docs;
|
|
1880
|
+
email;
|
|
1881
|
+
redirects;
|
|
1882
|
+
permissions;
|
|
1883
|
+
ai;
|
|
1884
|
+
cli;
|
|
1885
|
+
api;
|
|
1886
|
+
cdn;
|
|
1887
|
+
queue;
|
|
1888
|
+
deployment;
|
|
1889
|
+
scope;
|
|
1890
|
+
props;
|
|
1835
1891
|
constructor(scope, id, props) {
|
|
1836
1892
|
super(scope, id, props);
|
|
1837
|
-
|
|
1838
|
-
|
|
1893
|
+
this.scope = scope;
|
|
1894
|
+
this.props = props;
|
|
1895
|
+
this.dns = new DnsStack(this, props);
|
|
1896
|
+
this.security = new SecurityStack(this, {
|
|
1839
1897
|
...props,
|
|
1840
|
-
zone:
|
|
1898
|
+
zone: this.dns.zone
|
|
1841
1899
|
});
|
|
1842
|
-
|
|
1900
|
+
this.storage = new StorageStack(this, {
|
|
1843
1901
|
...props,
|
|
1844
|
-
kmsKey:
|
|
1902
|
+
kmsKey: this.security.kmsKey
|
|
1845
1903
|
});
|
|
1846
|
-
|
|
1847
|
-
|
|
1904
|
+
this.network = new NetworkStack(this, props);
|
|
1905
|
+
this.fileSystem = new FileSystemStack(this, {
|
|
1848
1906
|
...props,
|
|
1849
|
-
vpc:
|
|
1907
|
+
vpc: this.network.vpc
|
|
1850
1908
|
});
|
|
1851
|
-
new JumpBoxStack(this, {
|
|
1909
|
+
this.jumpBox = new JumpBoxStack(this, {
|
|
1852
1910
|
...props,
|
|
1853
|
-
vpc:
|
|
1854
|
-
fileSystem: fileSystem.fileSystem
|
|
1911
|
+
vpc: this.network.vpc,
|
|
1912
|
+
fileSystem: this.fileSystem.fileSystem
|
|
1855
1913
|
});
|
|
1856
|
-
|
|
1857
|
-
new EmailStack(this, {
|
|
1914
|
+
this.docs = new DocsStack(this, props);
|
|
1915
|
+
this.email = new EmailStack(this, {
|
|
1858
1916
|
...props,
|
|
1859
|
-
zone:
|
|
1917
|
+
zone: this.dns.zone
|
|
1860
1918
|
});
|
|
1861
|
-
new RedirectsStack(this, props);
|
|
1862
|
-
new PermissionsStack(this);
|
|
1863
|
-
|
|
1919
|
+
this.redirects = new RedirectsStack(this, props);
|
|
1920
|
+
this.permissions = new PermissionsStack(this);
|
|
1921
|
+
this.ai = new AiStack(this, props);
|
|
1922
|
+
this.cli = new CliStack(this, props);
|
|
1923
|
+
}
|
|
1924
|
+
async init() {
|
|
1864
1925
|
if (config20.cloud.api?.deploy) {
|
|
1865
|
-
|
|
1926
|
+
const props = this.props;
|
|
1927
|
+
this.api = new ComputeStack(this, {
|
|
1866
1928
|
...props,
|
|
1867
|
-
vpc:
|
|
1868
|
-
fileSystem: fileSystem.fileSystem,
|
|
1869
|
-
zone:
|
|
1870
|
-
certificate:
|
|
1929
|
+
vpc: this.network.vpc,
|
|
1930
|
+
fileSystem: this.fileSystem.fileSystem,
|
|
1931
|
+
zone: this.dns.zone,
|
|
1932
|
+
certificate: this.security.certificate
|
|
1871
1933
|
});
|
|
1872
|
-
new QueueStack(this, {
|
|
1934
|
+
this.queue = new QueueStack(this, {
|
|
1873
1935
|
...props,
|
|
1874
|
-
cluster: api.cluster,
|
|
1875
|
-
taskDefinition: api.taskDefinition
|
|
1936
|
+
cluster: this.api.cluster,
|
|
1937
|
+
taskDefinition: this.api.taskDefinition
|
|
1938
|
+
});
|
|
1939
|
+
await this.queue.init();
|
|
1940
|
+
this.cdn = new CdnStack(this, {
|
|
1941
|
+
...props,
|
|
1942
|
+
publicBucket: this.storage.publicBucket,
|
|
1943
|
+
logBucket: this.storage.logBucket,
|
|
1944
|
+
certificate: this.security.certificate,
|
|
1945
|
+
firewall: this.security.firewall,
|
|
1946
|
+
originRequestFunction: this.docs.originRequestFunction,
|
|
1947
|
+
zone: this.dns.zone,
|
|
1948
|
+
cliSetupUrl: this.cli.cliSetupUrl,
|
|
1949
|
+
askAiUrl: this.ai.askAiUrl,
|
|
1950
|
+
summarizeAiUrl: this.ai.summarizeAiUrl,
|
|
1951
|
+
lb: this.api?.lb
|
|
1952
|
+
});
|
|
1953
|
+
this.deployment = new DeploymentStack(this, {
|
|
1954
|
+
...props,
|
|
1955
|
+
publicBucket: this.storage.publicBucket,
|
|
1956
|
+
privateBucket: this.storage.privateBucket,
|
|
1957
|
+
cdn: this.cdn.distribution
|
|
1876
1958
|
});
|
|
1877
1959
|
}
|
|
1878
|
-
const ai2 = new AiStack(this, props);
|
|
1879
|
-
const cli2 = new CliStack(this, props);
|
|
1880
|
-
const cdn2 = new CdnStack(this, {
|
|
1881
|
-
...props,
|
|
1882
|
-
publicBucket: storage5.publicBucket,
|
|
1883
|
-
logBucket: storage5.logBucket,
|
|
1884
|
-
certificate: security2.certificate,
|
|
1885
|
-
firewall: security2.firewall,
|
|
1886
|
-
originRequestFunction: docs2.originRequestFunction,
|
|
1887
|
-
zone: dns2.zone,
|
|
1888
|
-
cliSetupUrl: cli2.cliSetupUrl,
|
|
1889
|
-
askAiUrl: ai2.askAiUrl,
|
|
1890
|
-
summarizeAiUrl: ai2.summarizeAiUrl,
|
|
1891
|
-
lb: api?.lb
|
|
1892
|
-
});
|
|
1893
|
-
new DeploymentStack(this, {
|
|
1894
|
-
...props,
|
|
1895
|
-
publicBucket: storage5.publicBucket,
|
|
1896
|
-
privateBucket: storage5.privateBucket,
|
|
1897
|
-
cdn: cdn2.distribution
|
|
1898
|
-
});
|
|
1899
1960
|
}
|
|
1900
1961
|
}
|
|
1901
1962
|
export {
|
package/core/cloud/package.json
CHANGED