@computesdk/aws-ecs 1.1.7 → 1.1.9
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 +27 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -27,10 +27,32 @@ AWS_SECURITY_GROUPS=sg-xxx
|
|
|
27
27
|
|
|
28
28
|
## Usage
|
|
29
29
|
|
|
30
|
+
### Gateway Mode (Recommended)
|
|
31
|
+
|
|
32
|
+
Use the gateway for zero-config auto-detection:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { compute } from 'computesdk';
|
|
36
|
+
|
|
37
|
+
// Auto-detects AWS ECS from AWS credentials and environment variables
|
|
38
|
+
const sandbox = await compute.sandbox.create();
|
|
39
|
+
console.log(`Created sandbox: ${sandbox.id}`);
|
|
40
|
+
|
|
41
|
+
// List all running sandboxes
|
|
42
|
+
const sandboxes = await compute.sandbox.list();
|
|
43
|
+
|
|
44
|
+
// Destroy the sandbox
|
|
45
|
+
await sandbox.destroy();
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Direct Mode
|
|
49
|
+
|
|
50
|
+
For direct SDK usage without the gateway:
|
|
51
|
+
|
|
30
52
|
```typescript
|
|
31
53
|
import { fargate } from '@computesdk/aws';
|
|
32
54
|
|
|
33
|
-
const
|
|
55
|
+
const compute = fargate({
|
|
34
56
|
cluster: 'my-ecs-cluster',
|
|
35
57
|
taskDefinition: 'my-task-definition',
|
|
36
58
|
subnets: ['subnet-12345', 'subnet-67890'],
|
|
@@ -39,17 +61,14 @@ const provider = fargate({
|
|
|
39
61
|
});
|
|
40
62
|
|
|
41
63
|
// Create a sandbox (ECS task)
|
|
42
|
-
const sandbox = await
|
|
43
|
-
console.log(`Created sandbox: ${sandbox.
|
|
44
|
-
|
|
45
|
-
// Get sandbox by ID
|
|
46
|
-
const retrieved = await provider.sandbox.getById(sandbox.sandboxId);
|
|
64
|
+
const sandbox = await compute.sandbox.create({ runtime: 'node' });
|
|
65
|
+
console.log(`Created sandbox: ${sandbox.id}`);
|
|
47
66
|
|
|
48
67
|
// List all running sandboxes
|
|
49
|
-
const sandboxes = await
|
|
68
|
+
const sandboxes = await compute.sandbox.list();
|
|
50
69
|
|
|
51
70
|
// Destroy the sandbox
|
|
52
|
-
await
|
|
71
|
+
await sandbox.destroy();
|
|
53
72
|
```
|
|
54
73
|
|
|
55
74
|
## Currently Implemented
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@computesdk/aws-ecs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "AWS ECS provider for ComputeSDK - scalable containerized sandboxes using Fargate",
|
|
5
5
|
"author": "ComputeSDK Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-sdk/client-ecs": "^3.943.0",
|
|
22
|
-
"computesdk": "1.10.
|
|
22
|
+
"computesdk": "1.10.2"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"computesdk",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"tsup": "^8.0.0",
|
|
51
51
|
"typescript": "^5.0.0",
|
|
52
52
|
"vitest": "^1.0.0",
|
|
53
|
-
"@computesdk/test-utils": "1.5.
|
|
53
|
+
"@computesdk/test-utils": "1.5.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsup",
|