Skip to content

Commit dcd20a8

Browse files
authored
Document market-type (#211)
* Document `market-type` * Fix blank line * Fix note * Try to fix note syntax
1 parent 28fbe1c commit dcd20a8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,19 @@ Use the following steps to prepare your workflow for running on your EC2 self-ho
141141

142142
These example policies above are provided as a guide. They can and most likely should be limited even more by specifying the resources you use.
143143

144+
144145
2. Add the keys to GitHub secrets.
145146
3. Use the [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) action to set up the keys as environment variables.
146147

148+
> [!IMPORTANT]
149+
> If you are planning on using Spot instances for your runner, AWS uses a service-linked role to provision the instances.
150+
>
151+
> For this to work, at least one of the following must be true:
152+
> - The service-linked role exists already. This happens if you request a Spot instance via the AWS Console interface.
153+
> - You create the service-linked role via the Console, AWS CLI or AWS API.
154+
> - You grant the IAM role above permissions to create the service-linked role at runtime.
155+
> See the docs [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create-service-linked-role.html) and [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/service-linked-roles-spot-instance-requests.html) for more details.
156+
147157
**2. Prepare GitHub personal access token**
148158

149159
1. Create a new GitHub personal access token with the `repo` scope.
@@ -205,8 +215,8 @@ Now you're ready to go!
205215
| `iam-role-name` | Optional. Used only with the `start` mode. | IAM role name to attach to the created EC2 runner. <br><br> This allows the runner to have permissions to run additional actions within the AWS account, without having to manage additional GitHub secrets and AWS users. <br><br> Setting this requires additional AWS permissions for the role launching the instance (see above). |
206216
| `aws-resource-tags` | Optional. Used only with the `start` mode. | Specifies tags to add to the EC2 instance and any attached storage. <br><br> This field is a stringified JSON array of tag objects, each containing a `Key` and `Value` field (see example below). <br><br> Setting this requires additional AWS permissions for the role launching the instance (see above). |
207217
| `runner-home-dir` | Optional. Used only with the `start` mode. | Specifies a directory where pre-installed actions-runner software and scripts are located.<br><br> |
208-
| `pre-runner-script` | Optional. Used only with the `start` mode. | Specifies bash commands to run before the runner starts. It's useful for installing dependencies with apt-get, yum, dnf, etc. For example:<pre> - name: Start EC2 runner<br> with:<br> mode: start<br> ...<br> pre-runner-script: \|<br> sudo yum update -y && \ <br> sudo yum install docker git libicu -y<br> sudo systemctl enable docker</pre>
209-
<br><br> |
218+
| `pre-runner-script` | Optional. Used only with the `start` mode. | Specifies bash commands to run before the runner starts. It's useful for installing dependencies with apt-get, yum, dnf, etc. For example:<pre> - name: Start EC2 runner<br> with:<br> mode: start<br> ...<br> pre-runner-script: \|<br> sudo yum update -y && \ <br> sudo yum install docker git libicu -y<br> sudo systemctl enable docker</pre> |
219+
| `market-type` | Optional. Used only with the `start` mode. | The only valid option is `spot`. If `spot` is specified, a Spot instance will be requested. If left unspecified, an on-demand instance will be provisioned. |
210220

211221
### Environment variables
212222

0 commit comments

Comments
 (0)