Skip to content

Commit dfdcdaf

Browse files
docs(compute-providers): document Lambda MicroVM provider
1 parent a68129d commit dfdcdaf

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

  • lambdas/libs/compute-providers/aws/microvm
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Lambda MicroVM compute provider
2+
3+
This provider manages a compatible AWS Lambda MicroVM image through the control-plane Lambda. It currently supports ephemeral JIT runners only.
4+
5+
The MicroVM image `/run` hook receives this `runHookPayload`:
6+
7+
```json
8+
{
9+
"version": 1,
10+
"runnerConfigSsmPath": "/github-action-runners/example/token"
11+
}
12+
```
13+
14+
Lambda adds `microvmId` beside that payload. The image must poll the SecureString parameter at `<runnerConfigSsmPath>/<microvmId>`, start the GitHub runner with its encoded JIT configuration, delete the parameter after reading it, and terminate the MicroVM after the job completes.
15+
16+
The control-plane Lambda requires these provider environment variables:
17+
18+
- `MICROVM_IMAGE_ARN`
19+
- `MICROVM_EXECUTION_ROLE_ARN`
20+
- `MICROVM_IMAGE_VERSION` (optional)
21+
- `MICROVM_INGRESS_NETWORK_CONNECTORS` (optional JSON array or comma-separated list)
22+
- `MICROVM_EGRESS_NETWORK_CONNECTORS` (optional JSON array or comma-separated list)
23+
- `MICROVM_MAXIMUM_DURATION_IN_SECONDS` (optional, defaults to 3600)
24+
- `MICROVM_LOG_GROUP` (optional)
25+
26+
## Dynamic labels
27+
28+
When a runner matcher enables dynamic labels, workflow jobs can override the
29+
following `RunMicrovm` inputs:
30+
31+
| Label | Override |
32+
| --------------------------------------------------- | ---------------------------------------------- |
33+
| `ghr-microvm-egress-network-connectors:<arn>` | One egress network connector ARN |
34+
| `ghr-microvm-image-arn:<arn>` | MicroVM image ARN |
35+
| `ghr-microvm-image-version:<version>` | MicroVM image version |
36+
| `ghr-microvm-maximum-duration-in-seconds:<seconds>` | Maximum lifetime from 1 through 28,800 seconds |
37+
38+
Repeat `ghr-microvm-egress-network-connectors:<arn>` to attach multiple
39+
connectors. Specify one ARN per label; `RunMicrovm` accepts at most 10. These
40+
labels replace the compute provider's configured
41+
`MICROVM_EGRESS_NETWORK_CONNECTORS` value for that job.
42+
43+
Lambda MicroVM does not expose CPU or memory as `RunMicrovm` inputs. Select an
44+
image and version with the required resources instead. Labels such as
45+
`ghr-microvm-memory` are rejected.
46+
47+
Execution roles, ingress network connectors, logging, idle policy, run hook
48+
payloads, and client tokens remain deployment-controlled. Egress connector
49+
overrides change the runner's network boundary and should be restricted to
50+
approved connector ARNs with `awsDynamicLabelsPolicy`.
51+
52+
Use the matcher's `awsDynamicLabelsPolicy` to restrict values accepted from
53+
workflow jobs. The MicroVM policy keys are `egress-network-connectors`,
54+
`image-arn`, `image-version`, and `maximum-duration-in-seconds`. For example:
55+
56+
```json
57+
{
58+
"restricted_keys": {
59+
"egress-network-connectors": {
60+
"allowed": ["arn:aws:lambda:eu-west-1:123456789012:network-connector:github-runner-*"]
61+
},
62+
"image-arn": {
63+
"allowed": ["arn:aws:lambda:eu-west-1:123456789012:microvm-image:github-runner-*"]
64+
},
65+
"maximum-duration-in-seconds": {
66+
"max": 3600
67+
}
68+
}
69+
}
70+
```

0 commit comments

Comments
 (0)