@computesdk/aws-ecs 1.1.7 → 1.1.8

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 (2) hide show
  1. package/README.md +27 -8
  2. package/package.json +2 -2
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 provider = fargate({
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 provider.sandbox.create({ runtime: 'node' });
43
- console.log(`Created sandbox: ${sandbox.sandboxId}`);
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 provider.sandbox.list();
68
+ const sandboxes = await compute.sandbox.list();
50
69
 
51
70
  // Destroy the sandbox
52
- await provider.sandbox.destroy(sandbox.sandboxId);
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.7",
3
+ "version": "1.1.8",
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.1"
22
+ "computesdk": "1.10.2"
23
23
  },
24
24
  "keywords": [
25
25
  "computesdk",