Commit dbb63c8
authored
feat(ec2): add
## Summary
Adds an `tags` prop to `Ec2RunnerProvider` that merges extra tags into the existing `RunInstances` `TagSpecifications` (instance + volume).
**Why launch-time tags (not job hooks):** security monitoring that enrolls hosts by tag needs the tag present from the moment the instance exists. Tagging from `ACTIONS_RUNNER_HOOK_JOB_STARTED` (the workaround from #524) runs only after the job starts, which is too late for short-lived ephemeral runners — the instance may terminate before the agent is installed. `cdk.Tags.of()` also does not help, because these instances are created dynamically by Step Functions, not as CloudFormation resources.
This builds on the tags already applied in #909 (`Name`, `GitHubRunners:*`) and makes the same mechanism extensible.
## API
```ts
new Ec2RunnerProvider(this, 'EC2', {
labels: ['ec2'],
tags: {
SecurityMonitoring: 'enabled',
},
});
```
## Testing
- Unit tests cover TagSpecifications merge for instance + volume, and reserved-key rejection
- `pnpm exec jest test/providers.test.ts` passes
- `API.md` regenerated via `pnpm docgen`
Related: #524 (custom EC2 tags at launch time).
Made with [Cursor](https://cursor.com)tags option to Ec2RunnerProvider (#961)1 parent 5ef725b commit dbb63c8
4 files changed
Lines changed: 110 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
332 | 342 | | |
333 | 343 | | |
334 | 344 | | |
| |||
410 | 420 | | |
411 | 421 | | |
412 | 422 | | |
| 423 | + | |
413 | 424 | | |
414 | 425 | | |
415 | 426 | | |
| |||
425 | 436 | | |
426 | 437 | | |
427 | 438 | | |
| 439 | + | |
428 | 440 | | |
429 | 441 | | |
430 | 442 | | |
| |||
517 | 529 | | |
518 | 530 | | |
519 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
520 | 541 | | |
521 | 542 | | |
522 | 543 | | |
| |||
577 | 598 | | |
578 | 599 | | |
579 | 600 | | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
| 601 | + | |
598 | 602 | | |
599 | 603 | | |
600 | 604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 304 | + | |
315 | 305 | | |
316 | 306 | | |
317 | 307 | | |
| |||
353 | 343 | | |
354 | 344 | | |
355 | 345 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 346 | + | |
368 | 347 | | |
369 | 348 | | |
370 | 349 | | |
| |||
428 | 407 | | |
429 | 408 | | |
430 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
431 | 462 | | |
432 | 463 | | |
433 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments