Skip to content

Commit 69a9f36

Browse files
committed
try several subnets in random order until one succeeds. Minimize the InsufficientInstanceCapacity error
Ref machulav#60
1 parent d637152 commit 69a9f36

File tree

3 files changed

+1279
-4657
lines changed

3 files changed

+1279
-4657
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Now you're ready to go!
198198
| `github-token` | Always required. | GitHub Personal Access Token with the `repo` scope assigned. |
199199
| `ec2-image-id` | Required if you use the `start` mode. | EC2 Image Id (AMI). <br><br> The new runner will be launched from this image. <br><br> The action is compatible with Amazon Linux 2 images. |
200200
| `ec2-instance-type` | Required if you use the `start` mode. | EC2 Instance Type. |
201-
| `subnet-id` | Required if you use the `start` mode. | VPC Subnet Id. <br><br> The subnet should belong to the same VPC as the specified security group. |
201+
| `subnet-id` | Required if you use the `start` mode. | VPC Subnet Id or Json-encoded array of Subnet ids. <br><br> The subnet should belong to the same VPC as the specified security group. |
202202
| `security-group-id` | Required if you use the `start` mode. | EC2 Security Group Id. <br><br> The security group should belong to the same VPC as the specified subnet. <br><br> Only the outbound traffic for port 443 should be allowed. No inbound traffic is required. |
203203
| `label` | Required if you use the `stop` mode. | Name of the unique label assigned to the runner. <br><br> The label is provided by the output of the action in the `start` mode. <br><br> The label is used to remove the runner from GitHub when the runner is not needed anymore. |
204204
| `ec2-instance-id` | Required if you use the `stop` mode. | EC2 Instance Id of the created runner. <br><br> The id is provided by the output of the action in the `start` mode. <br><br> The id is used to terminate the EC2 instance when the runner is not needed anymore. |
@@ -250,13 +250,14 @@ jobs:
250250
aws-region: ${{ secrets.AWS_REGION }}
251251
- name: Start EC2 runner
252252
id: start-ec2-runner
253-
uses: machulav/ec2-github-runner@v2
253+
uses: shiphero/ec2-github-runner@v2
254254
with:
255255
mode: start
256256
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
257257
ec2-image-id: ami-123
258258
ec2-instance-type: t3.nano
259-
subnet-id: subnet-123
259+
subnet-id: > # will try each value in a random order until one succeeds.
260+
["subnet-123", "subnet-456"]
260261
security-group-id: sg-123
261262
iam-role-name: my-role-name # optional, requires additional permissions
262263
aws-resource-tags: > # optional, requires additional permissions

0 commit comments

Comments
 (0)