@kirschbaum-development/sst-laravel 0.3.2 → 0.3.4
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/README.md +15 -1
- package/dist/bin/cli.js +2 -0
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/commands/command-run.d.ts +3 -0
- package/dist/bin/commands/command-run.js +69 -0
- package/dist/bin/commands/command-run.js.map +1 -0
- package/docs/api.md +19 -1
- package/laravel-sst.ts +68 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,6 +88,21 @@ const app = new LaravelService('MyLaravelApp', {
|
|
|
88
88
|
|
|
89
89
|
Check all the `web` options [here](https://github.com/kirschbaum-development/sst-laravel/blob/main/docs/api.md#web).
|
|
90
90
|
|
|
91
|
+
#### Load balancer health check
|
|
92
|
+
|
|
93
|
+
Laravel ships a built-in `/up` health endpoint. Point the load balancer at it via `web.healthCheck` — a shortcut over `loadBalancer.health` that targets the default forward port for you:
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
const app = new LaravelService('MyLaravelApp', {
|
|
97
|
+
web: {
|
|
98
|
+
domain: { name: 'app.example.com' },
|
|
99
|
+
healthCheck: { path: '/up' },
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
All [`loadBalancer.health` options](https://sst.dev/docs/component/aws/service/#loadbalancer-health) are supported (`interval`, `timeout`, `healthyThreshold`, `unhealthyThreshold`, `successCodes`). If you set `web.loadBalancer` explicitly, `healthCheck` is ignored — configure `loadBalancer.health` directly there.
|
|
105
|
+
|
|
91
106
|
### Reverb
|
|
92
107
|
|
|
93
108
|
You can deploy a dedicated Laravel Reverb service for WebSocket traffic. Reverb runs as a worker-style container using `php artisan reverb:start`, but SST Laravel also attaches a load balancer so you can give it its own public domain.
|
|
@@ -514,7 +529,6 @@ In case your specified environment file does not contain the `APP_URL` variable,
|
|
|
514
529
|
* Ability to extend base Docker images;
|
|
515
530
|
* Add support for Inertia SSR;
|
|
516
531
|
* Add support for Octane with FrankedPHP;
|
|
517
|
-
* Add support for Laravel Reverb;
|
|
518
532
|
* Dev mode;
|
|
519
533
|
* ...what else are we missing?
|
|
520
534
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as fs from 'fs';
|
|
|
4
4
|
import * as path from 'path';
|
|
5
5
|
import { initCommand } from './commands/init.js';
|
|
6
6
|
import { deployCommand } from './commands/deploy.js';
|
|
7
|
+
import { commandRunCommand } from './commands/command-run.js';
|
|
7
8
|
import { sshCommand } from './commands/ssh.js';
|
|
8
9
|
import { logsCommand } from './commands/logs.js';
|
|
9
10
|
import { githubIamCommand } from './commands/github-iam.js';
|
|
@@ -21,6 +22,7 @@ program
|
|
|
21
22
|
.version(version);
|
|
22
23
|
program.addCommand(initCommand);
|
|
23
24
|
program.addCommand(deployCommand);
|
|
25
|
+
program.addCommand(commandRunCommand);
|
|
24
26
|
program.addCommand(sshCommand);
|
|
25
27
|
program.addCommand(logsCommand);
|
|
26
28
|
program.addCommand(githubIamCommand);
|
package/dist/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CA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OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEnC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { ECSClient } from '@aws-sdk/client-ecs';
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { findClusterArn, findTask } from '../utils/ecs.js';
|
|
5
|
+
export function buildCommandToRun(commandParts, raw) {
|
|
6
|
+
if (commandParts.length === 0) {
|
|
7
|
+
throw new Error('Command is required.');
|
|
8
|
+
}
|
|
9
|
+
const command = commandParts.join(' ');
|
|
10
|
+
return raw ? command : `php artisan ${command}`;
|
|
11
|
+
}
|
|
12
|
+
export const commandRunCommand = new Command('command:run')
|
|
13
|
+
.description('Run a command in a running ECS task')
|
|
14
|
+
.argument('<command...>', 'Artisan command signature and options to run')
|
|
15
|
+
.allowUnknownOption(true)
|
|
16
|
+
.option('-s, --stage <stage>', 'SST stage name (required)')
|
|
17
|
+
.option('-c, --cluster <cluster>', 'ECS cluster name (optional, auto-detected from SST config)')
|
|
18
|
+
.option('-r, --region <region>', 'AWS region', process.env.AWS_REGION || 'us-east-1')
|
|
19
|
+
.option('--service <service>', 'Service to run the command against (web, worker, or worker name)', 'web')
|
|
20
|
+
.option('--container <container>', 'Container name override')
|
|
21
|
+
.option('--raw', 'Run the provided command instead of prefixing it with "php artisan"', false)
|
|
22
|
+
.action(async (commandParts, options) => {
|
|
23
|
+
try {
|
|
24
|
+
const region = options.region;
|
|
25
|
+
const stage = options.stage;
|
|
26
|
+
if (!stage) {
|
|
27
|
+
console.error('Error: Stage is required. Use --stage flag to specify the SST stage.');
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
const ecsClient = new ECSClient({ region });
|
|
31
|
+
const clusterArn = await findClusterArn(ecsClient, stage, options.cluster);
|
|
32
|
+
const matchingTask = await findTask(ecsClient, clusterArn, options.service, 'Select a task to run the command in:');
|
|
33
|
+
const taskId = matchingTask.taskArn?.split('/').pop();
|
|
34
|
+
const containerName = options.container || matchingTask.containers?.[0]?.name;
|
|
35
|
+
const command = buildCommandToRun(commandParts, options.raw);
|
|
36
|
+
if (!taskId) {
|
|
37
|
+
console.error('Error: Could not determine ECS task ID.');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
if (!containerName) {
|
|
41
|
+
console.error('Error: Could not determine ECS container name.');
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
console.log(`Running command in task: ${taskId}`);
|
|
45
|
+
console.log(`Container: ${containerName}`);
|
|
46
|
+
console.log(`Command: ${command}`);
|
|
47
|
+
console.log('');
|
|
48
|
+
const awsCommand = spawn('aws', [
|
|
49
|
+
'ecs',
|
|
50
|
+
'execute-command',
|
|
51
|
+
'--cluster', clusterArn,
|
|
52
|
+
'--task', taskId,
|
|
53
|
+
'--container', containerName,
|
|
54
|
+
'--interactive',
|
|
55
|
+
'--command', command,
|
|
56
|
+
], {
|
|
57
|
+
stdio: 'inherit',
|
|
58
|
+
env: { ...process.env, AWS_REGION: region },
|
|
59
|
+
});
|
|
60
|
+
awsCommand.on('exit', (code) => {
|
|
61
|
+
process.exit(code || 0);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.error('Error:', error.message);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=command-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-run.js","sourceRoot":"","sources":["../../../bin/commands/command-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,E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a,EAAE,aAAa;YAC5B,eAAe;YACf,WAAW,EAAE,OAAO;SACrB,EAAE;YACD,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE;SAC5C,CAAC,CAAC;QAEH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/docs/api.md
CHANGED
|
@@ -259,7 +259,25 @@ web: {
|
|
|
259
259
|
|
|
260
260
|
#### `web.health`
|
|
261
261
|
- **Type:** `ServiceArgs["health"]`
|
|
262
|
-
- **Description:**
|
|
262
|
+
- **Description:** ECS container-level health check for the web service. Distinct from `web.healthCheck` (load balancer).
|
|
263
|
+
|
|
264
|
+
#### `web.healthCheck`
|
|
265
|
+
- **Type:** `Input<LaravelHealthCheck>`
|
|
266
|
+
- **Description:** Load balancer health check applied to the default forward port (`8080/http`). Shorthand so you don't have to override the full `loadBalancer` config just to set a path. Ignored when `loadBalancer` is provided — configure `loadBalancer.health` directly in that case.
|
|
267
|
+
|
|
268
|
+
**Example:**
|
|
269
|
+
```typescript
|
|
270
|
+
web: {
|
|
271
|
+
domain: { name: 'app.example.com' },
|
|
272
|
+
healthCheck: {
|
|
273
|
+
path: '/up',
|
|
274
|
+
successCodes: '200',
|
|
275
|
+
interval: '30 seconds',
|
|
276
|
+
healthyThreshold: 2,
|
|
277
|
+
unhealthyThreshold: 3,
|
|
278
|
+
},
|
|
279
|
+
}
|
|
280
|
+
```
|
|
263
281
|
|
|
264
282
|
#### `web.executionRole`
|
|
265
283
|
- **Type:** `ServiceArgs["executionRole"]`
|
package/laravel-sst.ts
CHANGED
|
@@ -132,11 +132,72 @@ export interface LaravelServiceArgs {
|
|
|
132
132
|
>;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Shorthand for the load balancer health check applied to the default forward
|
|
137
|
+
* port. Mirrors the inner shape of SST's `loadBalancer.health` entry, minus the
|
|
138
|
+
* per-port keying which the package fills in for you.
|
|
139
|
+
*
|
|
140
|
+
* Not used when {@link LaravelWebArgs.loadBalancer} is provided — in that case
|
|
141
|
+
* configure `loadBalancer.health` directly.
|
|
142
|
+
*/
|
|
143
|
+
export interface LaravelHealthCheck {
|
|
144
|
+
/**
|
|
145
|
+
* The URL path the load balancer pings for health checks.
|
|
146
|
+
* @default `"/"`
|
|
147
|
+
*/
|
|
148
|
+
path?: Input<string>;
|
|
149
|
+
/**
|
|
150
|
+
* Time between health check requests. Between `5 seconds` and `300 seconds`.
|
|
151
|
+
* @default `"30 seconds"`
|
|
152
|
+
*/
|
|
153
|
+
interval?: Input<`${number} ${'second' | 'seconds' | 'minute' | 'minutes'}`>;
|
|
154
|
+
/**
|
|
155
|
+
* Per-request timeout. Between `2 seconds` and `120 seconds`.
|
|
156
|
+
* @default `"5 seconds"`
|
|
157
|
+
*/
|
|
158
|
+
timeout?: Input<`${number} ${'second' | 'seconds' | 'minute' | 'minutes'}`>;
|
|
159
|
+
/**
|
|
160
|
+
* Consecutive successes required to mark a target healthy. Between 2 and 10.
|
|
161
|
+
* @default `5`
|
|
162
|
+
*/
|
|
163
|
+
healthyThreshold?: Input<number>;
|
|
164
|
+
/**
|
|
165
|
+
* Consecutive failures required to mark a target unhealthy. Between 2 and 10.
|
|
166
|
+
* @default `2`
|
|
167
|
+
*/
|
|
168
|
+
unhealthyThreshold?: Input<number>;
|
|
169
|
+
/**
|
|
170
|
+
* HTTP response codes treated as successful (e.g. `"200"`, `"200-299"`).
|
|
171
|
+
* @default `"200"`
|
|
172
|
+
*/
|
|
173
|
+
successCodes?: Input<string>;
|
|
174
|
+
}
|
|
175
|
+
|
|
135
176
|
export interface LaravelWebArgs extends LaravelServiceArgs {
|
|
136
177
|
/**
|
|
137
178
|
* Custom domain for the web layer. (if you don't provide a domain name, you will be able to use the load balancer domain for testing (http only))
|
|
138
179
|
*/
|
|
139
180
|
domain?: LaravelDomain;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Load balancer health check for the web service. The package wires this
|
|
184
|
+
* to the default forward port (`8080/http`), so you only specify the
|
|
185
|
+
* check itself — not the per-port key.
|
|
186
|
+
*
|
|
187
|
+
* Distinct from {@link LaravelServiceArgs.health}, which is the ECS
|
|
188
|
+
* container-level health check.
|
|
189
|
+
*
|
|
190
|
+
* Ignored when `loadBalancer` is set — configure `loadBalancer.health`
|
|
191
|
+
* yourself in that case.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```js
|
|
195
|
+
* web: {
|
|
196
|
+
* healthCheck: { path: '/up' },
|
|
197
|
+
* }
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
healthCheck?: Input<LaravelHealthCheck>;
|
|
140
201
|
}
|
|
141
202
|
|
|
142
203
|
export interface LaravelReverbArgs extends LaravelServiceArgs {
|
|
@@ -415,6 +476,13 @@ export class LaravelService extends Component {
|
|
|
415
476
|
ports: getDefaultPublicPorts(
|
|
416
477
|
args.web?.domain,
|
|
417
478
|
),
|
|
479
|
+
...(args.web?.healthCheck
|
|
480
|
+
? {
|
|
481
|
+
health: {
|
|
482
|
+
'8080/http': args.web.healthCheck,
|
|
483
|
+
},
|
|
484
|
+
}
|
|
485
|
+
: {}),
|
|
418
486
|
},
|
|
419
487
|
|
|
420
488
|
dev: {
|
package/package.json
CHANGED