@mavogel/cdk-vscode-server 0.0.64 → 0.0.66
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/.jsii +121 -39
- package/API.md +147 -0
- package/CLAUDE.md +46 -2
- package/README.md +63 -0
- package/examples/custom/main.ts +24 -2
- package/examples/custom-install-steps/main.ts +201 -0
- package/lib/idle-monitor/idle-monitor.js +1 -1
- package/lib/installer/installer.d.ts +7 -1
- package/lib/installer/installer.js +20 -4
- package/lib/vscode-server.d.ts +52 -0
- package/lib/vscode-server.js +4 -2
- package/node_modules/node-html-parser/CHANGELOG.md +23 -0
- package/node_modules/node-html-parser/README.md +12 -4
- package/node_modules/node-html-parser/dist/main.js +72 -8
- package/node_modules/node-html-parser/dist/nodes/html.d.ts +14 -1
- package/node_modules/node-html-parser/dist/nodes/html.js +68 -8
- package/node_modules/node-html-parser/package.json +3 -2
- package/package.json +2 -2
package/API.md
CHANGED
|
@@ -45,6 +45,7 @@ new IdleMonitor(scope: Construct, id: string, props: IdleMonitorProps)
|
|
|
45
45
|
| **Name** | **Description** |
|
|
46
46
|
| --- | --- |
|
|
47
47
|
| <code><a href="#@mavogel/cdk-vscode-server.IdleMonitor.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
48
|
+
| <code><a href="#@mavogel/cdk-vscode-server.IdleMonitor.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
48
49
|
|
|
49
50
|
---
|
|
50
51
|
|
|
@@ -56,6 +57,27 @@ public toString(): string
|
|
|
56
57
|
|
|
57
58
|
Returns a string representation of this construct.
|
|
58
59
|
|
|
60
|
+
##### `with` <a name="with" id="@mavogel/cdk-vscode-server.IdleMonitor.with"></a>
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
public with(mixins: ...IMixin[]): IConstruct
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Applies one or more mixins to this construct.
|
|
67
|
+
|
|
68
|
+
Mixins are applied in order. The list of constructs is captured at the
|
|
69
|
+
start of the call, so constructs added by a mixin will not be visited.
|
|
70
|
+
Use multiple `with()` calls if subsequent mixins should apply to added
|
|
71
|
+
constructs.
|
|
72
|
+
|
|
73
|
+
###### `mixins`<sup>Required</sup> <a name="mixins" id="@mavogel/cdk-vscode-server.IdleMonitor.with.parameter.mixins"></a>
|
|
74
|
+
|
|
75
|
+
- *Type:* ...constructs.IMixin[]
|
|
76
|
+
|
|
77
|
+
The mixins to apply.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
59
81
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
60
82
|
|
|
61
83
|
| **Name** | **Description** |
|
|
@@ -186,6 +208,7 @@ new VSCodeServer(scope: Construct, id: string, props?: VSCodeServerProps)
|
|
|
186
208
|
| **Name** | **Description** |
|
|
187
209
|
| --- | --- |
|
|
188
210
|
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServer.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
211
|
+
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServer.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
189
212
|
|
|
190
213
|
---
|
|
191
214
|
|
|
@@ -197,6 +220,27 @@ public toString(): string
|
|
|
197
220
|
|
|
198
221
|
Returns a string representation of this construct.
|
|
199
222
|
|
|
223
|
+
##### `with` <a name="with" id="@mavogel/cdk-vscode-server.VSCodeServer.with"></a>
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
public with(mixins: ...IMixin[]): IConstruct
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Applies one or more mixins to this construct.
|
|
230
|
+
|
|
231
|
+
Mixins are applied in order. The list of constructs is captured at the
|
|
232
|
+
start of the call, so constructs added by a mixin will not be visited.
|
|
233
|
+
Use multiple `with()` calls if subsequent mixins should apply to added
|
|
234
|
+
constructs.
|
|
235
|
+
|
|
236
|
+
###### `mixins`<sup>Required</sup> <a name="mixins" id="@mavogel/cdk-vscode-server.VSCodeServer.with.parameter.mixins"></a>
|
|
237
|
+
|
|
238
|
+
- *Type:* ...constructs.IMixin[]
|
|
239
|
+
|
|
240
|
+
The mixins to apply.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
200
244
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
201
245
|
|
|
202
246
|
| **Name** | **Description** |
|
|
@@ -312,6 +356,65 @@ The IdleMonitor construct (only present if enableAutoStop is true).
|
|
|
312
356
|
|
|
313
357
|
## Structs <a name="Structs" id="Structs"></a>
|
|
314
358
|
|
|
359
|
+
### CustomInstallStep <a name="CustomInstallStep" id="@mavogel/cdk-vscode-server.CustomInstallStep"></a>
|
|
360
|
+
|
|
361
|
+
Custom installation step for SSM document Allows users to extend the installer with additional shell commands.
|
|
362
|
+
|
|
363
|
+
#### Initializer <a name="Initializer" id="@mavogel/cdk-vscode-server.CustomInstallStep.Initializer"></a>
|
|
364
|
+
|
|
365
|
+
```typescript
|
|
366
|
+
import { CustomInstallStep } from '@mavogel/cdk-vscode-server'
|
|
367
|
+
|
|
368
|
+
const customInstallStep: CustomInstallStep = { ... }
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
372
|
+
|
|
373
|
+
| **Name** | **Type** | **Description** |
|
|
374
|
+
| --- | --- | --- |
|
|
375
|
+
| <code><a href="#@mavogel/cdk-vscode-server.CustomInstallStep.property.commands">commands</a></code> | <code>string[]</code> | Shell commands to run for this step Each command will be executed in sequence. |
|
|
376
|
+
| <code><a href="#@mavogel/cdk-vscode-server.CustomInstallStep.property.name">name</a></code> | <code>string</code> | Name of the installation step Must be unique within the SSM document. |
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
##### `commands`<sup>Required</sup> <a name="commands" id="@mavogel/cdk-vscode-server.CustomInstallStep.property.commands"></a>
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
public readonly commands: string[];
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
- *Type:* string[]
|
|
387
|
+
|
|
388
|
+
Shell commands to run for this step Each command will be executed in sequence.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
*Example*
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
['#!/bin/bash', 'echo "Installing custom tool"', 'apt-get install -y my-tool']
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
##### `name`<sup>Required</sup> <a name="name" id="@mavogel/cdk-vscode-server.CustomInstallStep.property.name"></a>
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
public readonly name: string;
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
- *Type:* string
|
|
406
|
+
|
|
407
|
+
Name of the installation step Must be unique within the SSM document.
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
*Example*
|
|
412
|
+
|
|
413
|
+
```typescript
|
|
414
|
+
'InstallCustomTool'
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
|
|
315
418
|
### IdleMonitorProps <a name="IdleMonitorProps" id="@mavogel/cdk-vscode-server.IdleMonitorProps"></a>
|
|
316
419
|
|
|
317
420
|
Props for IdleMonitor construct.
|
|
@@ -423,6 +526,7 @@ const vSCodeServerProps: VSCodeServerProps = { ... }
|
|
|
423
526
|
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.autoCreateCertificate">autoCreateCertificate</a></code> | <code>boolean</code> | Auto-create ACM certificate with DNS validation in us-east-1 region Requires hostedZoneId to be provided for DNS validation Cannot be used together with certificateArn Certificate will automatically be created in us-east-1 as required by CloudFront. |
|
|
424
527
|
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.branchZipS3Path">branchZipS3Path</a></code> | <code>string</code> | S3 path to a zip file containing git branches to create in the home folder repository. |
|
|
425
528
|
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.certificateArn">certificateArn</a></code> | <code>string</code> | ARN of existing ACM certificate for the domain Certificate must be in us-east-1 region for CloudFront Cannot be used together with autoCreateCertificate. |
|
|
529
|
+
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.customInstallSteps">customInstallSteps</a></code> | <code><a href="#@mavogel/cdk-vscode-server.CustomInstallStep">CustomInstallStep</a>[]</code> | Custom installation steps to extend the SSM document. |
|
|
426
530
|
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.devServerBasePath">devServerBasePath</a></code> | <code>string</code> | Base path for the application to be added to Nginx sites-available list. |
|
|
427
531
|
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.devServerPort">devServerPort</a></code> | <code>number</code> | Port for the DevServer. |
|
|
428
532
|
| <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.domainName">domainName</a></code> | <code>string</code> | Custom domain name for the VS Code server When provided, creates a CloudFront distribution with this domain name and sets up Route53 A record pointing to the distribution. |
|
|
@@ -543,6 +647,49 @@ ARN of existing ACM certificate for the domain Certificate must be in us-east-1
|
|
|
543
647
|
|
|
544
648
|
---
|
|
545
649
|
|
|
650
|
+
##### `customInstallSteps`<sup>Optional</sup> <a name="customInstallSteps" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.customInstallSteps"></a>
|
|
651
|
+
|
|
652
|
+
```typescript
|
|
653
|
+
public readonly customInstallSteps: CustomInstallStep[];
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
- *Type:* <a href="#@mavogel/cdk-vscode-server.CustomInstallStep">CustomInstallStep</a>[]
|
|
657
|
+
- *Default:* no custom installation steps
|
|
658
|
+
|
|
659
|
+
Custom installation steps to extend the SSM document.
|
|
660
|
+
|
|
661
|
+
Allows you to add additional shell commands that run after the standard installation steps.
|
|
662
|
+
Useful for installing workshop-specific tools, configuring custom environments, or running
|
|
663
|
+
setup scripts.
|
|
664
|
+
|
|
665
|
+
Each step will be executed in the order provided, after all standard installation steps complete.
|
|
666
|
+
|
|
667
|
+
---
|
|
668
|
+
|
|
669
|
+
*Example*
|
|
670
|
+
|
|
671
|
+
```typescript
|
|
672
|
+
customInstallSteps: [
|
|
673
|
+
{
|
|
674
|
+
name: 'InstallCustomTool',
|
|
675
|
+
commands: [
|
|
676
|
+
'#!/bin/bash',
|
|
677
|
+
'echo "Installing my custom tool"',
|
|
678
|
+
'curl -O https://example.com/tool.sh',
|
|
679
|
+
'bash tool.sh',
|
|
680
|
+
],
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
name: 'ConfigureWorkshopEnv',
|
|
684
|
+
commands: [
|
|
685
|
+
'#!/bin/bash',
|
|
686
|
+
'echo "export MY_VAR=value" >> /home/participant/.bashrc',
|
|
687
|
+
],
|
|
688
|
+
},
|
|
689
|
+
]
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
|
|
546
693
|
##### `devServerBasePath`<sup>Optional</sup> <a name="devServerBasePath" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.devServerBasePath"></a>
|
|
547
694
|
|
|
548
695
|
```typescript
|
package/CLAUDE.md
CHANGED
|
@@ -173,6 +173,10 @@ aws ssm get-parameters --names \
|
|
|
173
173
|
- `idleCheckIntervalMinutes` - How often to check (default: 5)
|
|
174
174
|
- `skipStatusChecks` - Skip EC2 status checks before stopping (for testing only)
|
|
175
175
|
|
|
176
|
+
**Custom Installation**:
|
|
177
|
+
- `customInstallSteps` - Array of custom shell commands that run after standard installation
|
|
178
|
+
- `repoUrl` - Git repository to clone into home folder during setup
|
|
179
|
+
|
|
176
180
|
**Extensions**:
|
|
177
181
|
- `additionalInstanceRolePolicies`, `additionalTags`
|
|
178
182
|
|
|
@@ -182,6 +186,7 @@ aws ssm get-parameters --names \
|
|
|
182
186
|
- All public APIs must be JSII-compatible (no TS-specific types)
|
|
183
187
|
- Bundled dependencies (like `node-html-parser`) must be in `.projenrc.ts` `bundledDeps`
|
|
184
188
|
- Lambda functions use esbuild bundling configured via Projen (auto-discovered in `src/**/*.lambda.ts`)
|
|
189
|
+
- **@example JSDoc blocks must NOT use code fences** (```) - JSII will fail with "must be code only, no code block fences allowed"
|
|
185
190
|
|
|
186
191
|
## CDK-nag Integration
|
|
187
192
|
|
|
@@ -239,11 +244,50 @@ Projen automatically discovers Lambda functions matching `src/**/*.lambda.ts` pa
|
|
|
239
244
|
3. Run `npx projen` - auto-discovers and creates bundle task
|
|
240
245
|
4. Import in construct: `import { MyFeatureFunction } from './my-feature/my-feature-function'`
|
|
241
246
|
|
|
247
|
+
### Adding Custom Installation Steps
|
|
248
|
+
|
|
249
|
+
Custom steps are appended to SSM document `mainSteps` array in `createSSMDocument()`:
|
|
250
|
+
|
|
251
|
+
1. **Define interface** (if needed) in `src/vscode-server.ts`:
|
|
252
|
+
```typescript
|
|
253
|
+
export interface CustomInstallStep {
|
|
254
|
+
readonly name: string;
|
|
255
|
+
readonly commands: string[];
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
2. **Add prop** to `VSCodeServerProps` with JSDoc documentation (no code fences!)
|
|
260
|
+
|
|
261
|
+
3. **Pass to Installer** in both Ubuntu and Amazon Linux paths:
|
|
262
|
+
```typescript
|
|
263
|
+
installer = Installer.ubuntu({
|
|
264
|
+
// ... other options
|
|
265
|
+
customInstallSteps: customInstallSteps,
|
|
266
|
+
})._bind(this);
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
4. **Update `createSSMDocument()`** in `src/installer/installer.ts` to accept and use custom steps:
|
|
270
|
+
```typescript
|
|
271
|
+
...(customInstallSteps?.map((step) => ({
|
|
272
|
+
action: 'aws:runShellScript' as const,
|
|
273
|
+
name: step.name,
|
|
274
|
+
inputs: {
|
|
275
|
+
runCommand: step.commands,
|
|
276
|
+
},
|
|
277
|
+
})) ?? []),
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
5. **Write unit tests** in `test/vscode-server.test.ts` covering normal usage, without steps, and empty array
|
|
281
|
+
|
|
282
|
+
6. **Update documentation** in README.md with practical examples and add to `examples/` directory
|
|
283
|
+
|
|
242
284
|
### Modifying VSCodeServer Props
|
|
243
285
|
|
|
244
286
|
1. Edit `src/vscode-server.ts` - update `VSCodeServerProps` interface
|
|
245
|
-
2.
|
|
246
|
-
3.
|
|
287
|
+
2. If adding new types/interfaces, export them from `src/vscode-server.ts`
|
|
288
|
+
3. Run `npx projen build` - regenerates JSII artifacts + API docs
|
|
289
|
+
4. Update README.md with usage examples and feature section
|
|
290
|
+
5. Add example usage in `examples/` directory
|
|
247
291
|
|
|
248
292
|
### Testing Changes
|
|
249
293
|
|
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ we implement new features. Therefore make sure you use an exact version in your
|
|
|
24
24
|
- [Pre-populate with Git Repository](#pre-populate-with-git-repository)
|
|
25
25
|
- [Custom Domain Configuration](#custom-domain-configuration)
|
|
26
26
|
- [Auto-Stop Configuration](#auto-stop-configuration)
|
|
27
|
+
- [Custom Installation Steps](#custom-installation-steps)
|
|
27
28
|
- [Solution Design](#solution-design)
|
|
28
29
|
- [Inspiration](#inspiration)
|
|
29
30
|
|
|
@@ -34,6 +35,7 @@ we implement new features. Therefore make sure you use an exact version in your
|
|
|
34
35
|
- 🤹♂️ **Pre-installed packages**: Besides the [vscode](https://code.visualstudio.com/) server, other tools and software packages such as `git`, `docker`, `awscli` `nodejs` and `python` are pre-installed on the EC2 instance.
|
|
35
36
|
- 🌐 **Custom Domain Support**: Use your own domain name with automatic ACM certificate creation and Route53 DNS configuration, or bring your existing certificate.
|
|
36
37
|
- 💰 **Auto-Stop**: Automatically stop EC2 instances after inactivity with Elastic IP retention - save up to 75% on costs for development environments.
|
|
38
|
+
- 🔧 **Custom Install Steps**: Extend the standard installation with your own shell commands to install workshop-specific tools, configure environments, or run setup scripts.
|
|
37
39
|
- 🏗️ **Extensibility**: Pass in properties to the construct, which start with `additional*`. They allow you to extend the configuration to your needs. There are more to come...
|
|
38
40
|
|
|
39
41
|
## Usage
|
|
@@ -261,6 +263,67 @@ Run integration tests with:
|
|
|
261
263
|
npm run integ-test
|
|
262
264
|
```
|
|
263
265
|
|
|
266
|
+
### Custom Installation Steps
|
|
267
|
+
|
|
268
|
+
Extend the standard VS Code Server installation with your own custom shell commands - perfect for installing workshop-specific tools, configuring development environments, or running setup scripts:
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
new VSCodeServer(this, 'vscode', {
|
|
272
|
+
// Add custom installation steps that run after standard setup
|
|
273
|
+
customInstallSteps: [
|
|
274
|
+
{
|
|
275
|
+
name: 'InstallWorkshopTools',
|
|
276
|
+
commands: [
|
|
277
|
+
'#!/bin/bash',
|
|
278
|
+
'echo "Installing workshop-specific tools"',
|
|
279
|
+
|
|
280
|
+
// Install additional software
|
|
281
|
+
'curl -fsSL https://get.docker.com | sh',
|
|
282
|
+
'usermod -aG docker ubuntu',
|
|
283
|
+
|
|
284
|
+
// Configure environment
|
|
285
|
+
'echo "export WORKSHOP_ENV=production" >> /home/ubuntu/.bashrc',
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: 'CloneStarterCode',
|
|
290
|
+
commands: [
|
|
291
|
+
'#!/bin/bash',
|
|
292
|
+
'cd /home/ubuntu',
|
|
293
|
+
'git clone https://github.com/my-org/workshop-starter.git',
|
|
294
|
+
'chown -R ubuntu:ubuntu workshop-starter',
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
});
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Key Features:**
|
|
302
|
+
- **Execute After Standard Setup**: Custom steps run after VS Code Server installation completes
|
|
303
|
+
- **Multiple Steps**: Add as many installation steps as needed, executed in order
|
|
304
|
+
- **Full Shell Access**: Run any shell commands with root privileges
|
|
305
|
+
- **Workshop-Friendly**: Pre-install tools, configure environments, or download starter code
|
|
306
|
+
|
|
307
|
+
**Common Use Cases:**
|
|
308
|
+
- Install additional development tools (Docker, kubectl, terraform)
|
|
309
|
+
- Configure workshop-specific environments and credentials
|
|
310
|
+
- Clone starter code repositories with specific permissions
|
|
311
|
+
- Set up databases or services required for training
|
|
312
|
+
- Download and prepare datasets or assets
|
|
313
|
+
- Configure IDE extensions or settings
|
|
314
|
+
|
|
315
|
+
**Supported Operating Systems:**
|
|
316
|
+
- Ubuntu 22/24/25
|
|
317
|
+
- Amazon Linux 2023
|
|
318
|
+
|
|
319
|
+
**Requirements:**
|
|
320
|
+
- Commands execute with root privileges during instance initialization
|
|
321
|
+
- Use absolute paths or ensure proper working directory context
|
|
322
|
+
- Consider idempotency if instance might be restarted
|
|
323
|
+
- Commands run synchronously in the order specified
|
|
324
|
+
|
|
325
|
+
For complete examples, see [examples/custom-install-steps/main.ts](./examples/custom-install-steps/main.ts).
|
|
326
|
+
|
|
264
327
|
## Solution Design
|
|
265
328
|
|
|
266
329
|
<details>
|
package/examples/custom/main.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class MyStack extends Stack {
|
|
|
17
17
|
instanceVolumeSize: 8,
|
|
18
18
|
instanceClass: ec2.InstanceClass.M7G,
|
|
19
19
|
instanceSize: ec2.InstanceSize.LARGE,
|
|
20
|
-
instanceOperatingSystem: LinuxFlavorType.UBUNTU_24,
|
|
20
|
+
instanceOperatingSystem: LinuxFlavorType.UBUNTU_24, // Supports UBUNTU_22, UBUNTU_24, UBUNTU_25, AMAZON_LINUX_2023
|
|
21
21
|
instanceCpuArchitecture: LinuxArchitectureType.ARM,
|
|
22
22
|
|
|
23
23
|
// 👇🏽 or if you want to give the InstanceRole more permissions
|
|
@@ -31,7 +31,29 @@ export class MyStack extends Stack {
|
|
|
31
31
|
`arn:aws:codebuild:*:${Stack.of(this).account}:*/*`,
|
|
32
32
|
],
|
|
33
33
|
}),
|
|
34
|
-
]
|
|
34
|
+
],
|
|
35
|
+
|
|
36
|
+
// 👇🏽 Add custom installation steps to extend the standard setup
|
|
37
|
+
customInstallSteps: [
|
|
38
|
+
{
|
|
39
|
+
name: 'InstallCodeBuildTools',
|
|
40
|
+
commands: [
|
|
41
|
+
'#!/bin/bash',
|
|
42
|
+
'echo "Installing CodeBuild-related tools..."',
|
|
43
|
+
// Install AWS CodeBuild local agent for testing
|
|
44
|
+
'docker pull public.ecr.aws/codebuild/local-builds:latest',
|
|
45
|
+
// Create helper script
|
|
46
|
+
'cat > /usr/local/bin/codebuild-local << EOF',
|
|
47
|
+
'#!/bin/bash',
|
|
48
|
+
'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock \\',
|
|
49
|
+
' -e "IMAGE_NAME=public.ecr.aws/codebuild/local-builds:latest" \\',
|
|
50
|
+
' public.ecr.aws/codebuild/local-builds:latest',
|
|
51
|
+
'EOF',
|
|
52
|
+
'chmod +x /usr/local/bin/codebuild-local',
|
|
53
|
+
'echo "CodeBuild tools installed successfully"',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
35
57
|
|
|
36
58
|
// and more... 💡
|
|
37
59
|
});
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { App, Stack, StackProps } from 'aws-cdk-lib';
|
|
2
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
import {
|
|
5
|
+
CustomInstallStep,
|
|
6
|
+
LinuxArchitectureType,
|
|
7
|
+
LinuxFlavorType,
|
|
8
|
+
VSCodeServer,
|
|
9
|
+
} from '../../src/index';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Example: VS Code Server with Custom Installation Steps
|
|
13
|
+
*
|
|
14
|
+
* This example demonstrates how to extend the standard VS Code Server installation
|
|
15
|
+
* with custom shell commands. Perfect for:
|
|
16
|
+
* - Installing workshop-specific tools
|
|
17
|
+
* - Configuring development environments
|
|
18
|
+
* - Running setup scripts
|
|
19
|
+
* - Preparing datasets or assets
|
|
20
|
+
* - Setting up databases or services
|
|
21
|
+
*
|
|
22
|
+
* All custom steps execute with root privileges after the standard installation completes.
|
|
23
|
+
*/
|
|
24
|
+
export class CustomInstallStepsExampleStack extends Stack {
|
|
25
|
+
constructor(scope: Construct, id: string, props: StackProps = {}) {
|
|
26
|
+
super(scope, id, props);
|
|
27
|
+
|
|
28
|
+
// Define custom installation steps
|
|
29
|
+
const customSteps: CustomInstallStep[] = [
|
|
30
|
+
// Step 1: Install additional development tools
|
|
31
|
+
{
|
|
32
|
+
name: 'InstallDevelopmentTools',
|
|
33
|
+
commands: [
|
|
34
|
+
'#!/bin/bash',
|
|
35
|
+
'set -e', // Exit on error
|
|
36
|
+
'echo "Installing development tools..."',
|
|
37
|
+
|
|
38
|
+
// Install Docker (if not already installed)
|
|
39
|
+
'if ! command -v docker &> /dev/null; then',
|
|
40
|
+
' curl -fsSL https://get.docker.com | sh',
|
|
41
|
+
' usermod -aG docker ubuntu',
|
|
42
|
+
' systemctl enable docker',
|
|
43
|
+
' systemctl start docker',
|
|
44
|
+
'fi',
|
|
45
|
+
|
|
46
|
+
// Install kubectl
|
|
47
|
+
'curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"',
|
|
48
|
+
'install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl',
|
|
49
|
+
'rm kubectl',
|
|
50
|
+
|
|
51
|
+
// Install terraform
|
|
52
|
+
'wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg',
|
|
53
|
+
'echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list',
|
|
54
|
+
'apt-get update && apt-get install -y terraform',
|
|
55
|
+
|
|
56
|
+
'echo "Development tools installed successfully"',
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Step 2: Configure workshop environment
|
|
61
|
+
{
|
|
62
|
+
name: 'ConfigureWorkshopEnvironment',
|
|
63
|
+
commands: [
|
|
64
|
+
'#!/bin/bash',
|
|
65
|
+
'set -e',
|
|
66
|
+
'echo "Configuring workshop environment..."',
|
|
67
|
+
|
|
68
|
+
// Set environment variables
|
|
69
|
+
'cat >> /home/ubuntu/.bashrc << EOF',
|
|
70
|
+
'',
|
|
71
|
+
'# Workshop environment variables',
|
|
72
|
+
'export WORKSHOP_NAME="AWS CDK Workshop"',
|
|
73
|
+
'export WORKSHOP_VERSION="2.0"',
|
|
74
|
+
'export AWS_REGION="${AWS::Region}"',
|
|
75
|
+
'export AWS_ACCOUNT_ID="${AWS::AccountId}"',
|
|
76
|
+
'',
|
|
77
|
+
'# Custom aliases',
|
|
78
|
+
'alias k="kubectl"',
|
|
79
|
+
'alias tf="terraform"',
|
|
80
|
+
'alias ll="ls -la"',
|
|
81
|
+
'EOF',
|
|
82
|
+
|
|
83
|
+
// Create workshop directories
|
|
84
|
+
'mkdir -p /home/ubuntu/workshop',
|
|
85
|
+
'mkdir -p /home/ubuntu/workshop/code',
|
|
86
|
+
'mkdir -p /home/ubuntu/workshop/data',
|
|
87
|
+
|
|
88
|
+
// Set proper ownership
|
|
89
|
+
'chown -R ubuntu:ubuntu /home/ubuntu/workshop',
|
|
90
|
+
'chown ubuntu:ubuntu /home/ubuntu/.bashrc',
|
|
91
|
+
|
|
92
|
+
'echo "Workshop environment configured successfully"',
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Step 3: Clone and prepare workshop starter code
|
|
97
|
+
{
|
|
98
|
+
name: 'PrepareWorkshopCode',
|
|
99
|
+
commands: [
|
|
100
|
+
'#!/bin/bash',
|
|
101
|
+
'set -e',
|
|
102
|
+
'echo "Preparing workshop starter code..."',
|
|
103
|
+
|
|
104
|
+
// Clone workshop repository
|
|
105
|
+
'cd /home/ubuntu/workshop/code',
|
|
106
|
+
'git clone https://github.com/aws-samples/aws-cdk-examples.git',
|
|
107
|
+
|
|
108
|
+
// Download sample datasets
|
|
109
|
+
'cd /home/ubuntu/workshop/data',
|
|
110
|
+
'curl -o sample-data.json https://raw.githubusercontent.com/aws-samples/aws-cdk-examples/main/package.json',
|
|
111
|
+
|
|
112
|
+
// Create a README for participants
|
|
113
|
+
'cat > /home/ubuntu/workshop/README.md << EOF',
|
|
114
|
+
'# Welcome to the AWS CDK Workshop!',
|
|
115
|
+
'',
|
|
116
|
+
'## Getting Started',
|
|
117
|
+
'',
|
|
118
|
+
'1. Navigate to the code directory: `cd ~/workshop/code`',
|
|
119
|
+
'2. Explore the examples: `ls -la aws-cdk-examples`',
|
|
120
|
+
'3. Run your first CDK app',
|
|
121
|
+
'',
|
|
122
|
+
'## Resources',
|
|
123
|
+
'',
|
|
124
|
+
'- AWS CDK Documentation: https://docs.aws.amazon.com/cdk',
|
|
125
|
+
'- Workshop Guide: [TBD]',
|
|
126
|
+
'',
|
|
127
|
+
'## Installed Tools',
|
|
128
|
+
'',
|
|
129
|
+
'- Node.js $(node --version)',
|
|
130
|
+
'- Python $(python3 --version)',
|
|
131
|
+
'- Docker $(docker --version)',
|
|
132
|
+
'- kubectl $(kubectl version --client --short 2>/dev/null || echo "installed")',
|
|
133
|
+
'- Terraform $(terraform version | head -n1)',
|
|
134
|
+
'EOF',
|
|
135
|
+
|
|
136
|
+
// Set ownership
|
|
137
|
+
'chown -R ubuntu:ubuntu /home/ubuntu/workshop',
|
|
138
|
+
|
|
139
|
+
'echo "Workshop code prepared successfully"',
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
// Step 4: Install VS Code extensions
|
|
144
|
+
{
|
|
145
|
+
name: 'InstallVSCodeExtensions',
|
|
146
|
+
commands: [
|
|
147
|
+
'#!/bin/bash',
|
|
148
|
+
'set -e',
|
|
149
|
+
'echo "Installing VS Code extensions..."',
|
|
150
|
+
|
|
151
|
+
// Switch to ubuntu user to install extensions
|
|
152
|
+
'sudo -u ubuntu bash << EOF',
|
|
153
|
+
'export HOME=/home/ubuntu',
|
|
154
|
+
|
|
155
|
+
// Wait for code-server to be ready
|
|
156
|
+
'sleep 5',
|
|
157
|
+
|
|
158
|
+
// Install useful extensions (examples - adjust based on your needs)
|
|
159
|
+
'# Note: Extension installation via CLI requires code-server to be running',
|
|
160
|
+
'# These would typically be installed through the VS Code UI after first login',
|
|
161
|
+
|
|
162
|
+
'echo "VS Code extensions configured successfully"',
|
|
163
|
+
'EOF',
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
// Create VS Code Server with custom installation steps
|
|
169
|
+
new VSCodeServer(this, 'vscode-custom-install', {
|
|
170
|
+
// Instance configuration
|
|
171
|
+
instanceClass: ec2.InstanceClass.M7G,
|
|
172
|
+
instanceSize: ec2.InstanceSize.XLARGE,
|
|
173
|
+
instanceVolumeSize: 50, // Larger volume for additional tools
|
|
174
|
+
instanceOperatingSystem: LinuxFlavorType.UBUNTU_24, // Supports UBUNTU_22, UBUNTU_24, UBUNTU_25, AMAZON_LINUX_2023
|
|
175
|
+
instanceCpuArchitecture: LinuxArchitectureType.ARM,
|
|
176
|
+
|
|
177
|
+
// VS Code configuration
|
|
178
|
+
homeFolder: '/workshop',
|
|
179
|
+
vscodeUser: 'ubuntu',
|
|
180
|
+
|
|
181
|
+
// 🔧 Custom installation steps
|
|
182
|
+
customInstallSteps: customSteps,
|
|
183
|
+
|
|
184
|
+
// Additional configuration
|
|
185
|
+
additionalTags: {
|
|
186
|
+
Workshop: 'AWS-CDK-Workshop',
|
|
187
|
+
Environment: 'Training',
|
|
188
|
+
CustomInstallSteps: 'Enabled',
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const env = {
|
|
195
|
+
account: process.env.CDK_DEFAULT_ACCOUNT || '123456789012',
|
|
196
|
+
region: process.env.CDK_DEFAULT_REGION || 'eu-west-1',
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const app = new App();
|
|
200
|
+
new CustomInstallStepsExampleStack(app, 'vscode-custom-install-example', { env });
|
|
201
|
+
app.synth();
|
|
@@ -83,5 +83,5 @@ class IdleMonitor extends constructs_1.Construct {
|
|
|
83
83
|
}
|
|
84
84
|
exports.IdleMonitor = IdleMonitor;
|
|
85
85
|
_a = JSII_RTTI_SYMBOL_1;
|
|
86
|
-
IdleMonitor[_a] = { fqn: "@mavogel/cdk-vscode-server.IdleMonitor", version: "0.0.
|
|
86
|
+
IdleMonitor[_a] = { fqn: "@mavogel/cdk-vscode-server.IdleMonitor", version: "0.0.66" };
|
|
87
87
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRsZS1tb25pdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2lkbGUtbW9uaXRvci9pZGxlLW1vbml0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw2QkFBNkI7QUFDN0IsNkNBQThDO0FBRzlDLHVEQUF3RDtBQUN4RCx1RUFBd0Y7QUFDeEYsaURBQXNEO0FBQ3RELHVEQUFtRjtBQUNuRixxQ0FBMEM7QUFDMUMsMkNBQXVDO0FBcUN2Qzs7R0FFRztBQUNILE1BQWEsV0FBWSxTQUFRLHNCQUFTO0lBV3hDLFlBQVksS0FBZ0IsRUFBRSxFQUFVLEVBQUUsS0FBdUI7UUFDL0QsS0FBSyxDQUFDLEtBQUssRUFBRSxFQUFFLENBQUMsQ0FBQztRQUVqQixJQUFJLENBQUMsUUFBUSxHQUFHLElBQUkscUJBQWMsQ0FBQyxJQUFJLEVBQUUsVUFBVSxFQUFFO1lBQ25ELE9BQU8sRUFBRSxvQkFBTyxDQUFDLFdBQVc7WUFDNUIsT0FBTyxFQUFFLGVBQWU7WUFDeEIsSUFBSSxFQUFFLGlCQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLCtDQUErQyxDQUFDLENBQUM7WUFDM0YsT0FBTyxFQUFFLHNCQU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mYWxzZSwgLy8gU3RhcnQgZGlzYWJsZWQsIHdpbGwgYmUgZW5hYmxlZCBhZnRlciBpbnN0YWxsYXRpb25cbiAgICB9KTtcblxuICAgIHRoaXMuc2NoZWR1bGVSdWxlLmFkZFRhcmdldChuZXcgTGFtYmRhRnVuY3Rpb25UYXJnZXQodGhpcy5mdW5jdGlvbikpO1xuXG4gICAgLy8gQ0RLLW5hZyBzdXBwcmVzc2lvbnNcbiAgICBOYWdTdXBwcmVzc2lvbnMuYWRkUmVzb3VyY2VTdXBwcmVzc2lvbnMoXG4gICAgICB0aGlzLmZ1bmN0aW9uLFxuICAgICAgW1xuICAgICAgICB7XG4gICAgICAgICAgaWQ6ICdBd3NTb2x1dGlvbnMtSUFNNCcsXG4gICAgICAgICAgcmVhc29uOiAnTWFuYWdlZCBwb2xpY2llcyBhY2NlcHRhYmxlIGZvciB3b3Jrc2hvcCBMYW1iZGEgZnVuY3Rpb25zJyxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIGlkOiAnQXdzU29sdXRpb25zLUlBTTUnLFxuICAgICAgICAgIHJlYXNvbjogJ0Nsb3VkV2F0Y2ggbWV0cmljcyByZXF1aXJlIHdpbGRjYXJkIHBlcm1pc3Npb25zJyxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIGlkOiAnQXdzU29sdXRpb25zLUwxJyxcbiAgICAgICAgICByZWFzb246ICdMYXRlc3QgcnVudGltZSBub3QgcmVxdWlyZWQgZm9yIHRoaXMgZnVuY3Rpb24nLFxuICAgICAgICB9LFxuICAgICAgXSxcbiAgICAgIHRydWUsXG4gICAgKTtcbiAgfVxufVxuIl19
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Construct } from 'constructs';
|
|
2
|
-
import { LinuxFlavorType } from '../vscode-server';
|
|
2
|
+
import { LinuxFlavorType, CustomInstallStep } from '../vscode-server';
|
|
3
3
|
interface InstallerOptionsBase {
|
|
4
4
|
/**
|
|
5
5
|
* The ec2 instance id to install the ssm document on
|
|
@@ -92,6 +92,12 @@ interface InstallerOptionsBase {
|
|
|
92
92
|
* @default - no folders created
|
|
93
93
|
*/
|
|
94
94
|
readonly folderZipS3Path?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Custom installation steps to extend the SSM document
|
|
97
|
+
*
|
|
98
|
+
* @default - no custom installation steps
|
|
99
|
+
*/
|
|
100
|
+
readonly customInstallSteps?: CustomInstallStep[];
|
|
95
101
|
}
|
|
96
102
|
export interface InstallerOptions extends InstallerOptionsBase {
|
|
97
103
|
}
|