diff --git a/README.md b/README.md
index e3b4e890..56306e00 100644
--- a/README.md
+++ b/README.md
@@ -200,6 +200,9 @@ Now you're ready to go!
| `ec2-instance-type` | Required if you use the `start` mode. | EC2 Instance Type. |
| `subnet-id` | Required if you use the `start` mode. | VPC Subnet Id.
The subnet should belong to the same VPC as the specified security group. |
| `security-group-id` | Required if you use the `start` mode. | EC2 Security Group Id.
The security group should belong to the same VPC as the specified subnet.
Only the outbound traffic for port 443 should be allowed. No inbound traffic is required. |
+| `key-name` | Required if you use the `start` mode. | EC2 Key Pair name.
Can be assigned to the EC2 instance so user can SSH in for debuging. |
+| `storage-path` | Required if you use the `start` mode. | EC2 Block Storage Volume.
Used for configuring the mount path of the volume if you're overriding the default volume size of the EC2 instance. The parameter `storage-size` must also be configured when using this parameter. |
+| `storage-size` | Required if you use the `start` mode. | EC2 Block Storage Volume.
Used for overriding volume size of the machine if your project exceed the 8GiB default storage. The parameter `storage-path` must also be configured when using this parameter. |
| `label` | Required if you use the `stop` mode. | Name of the unique label assigned to the runner.
The label is provided by the output of the action in the `start` mode.
The label is used to remove the runner from GitHub when the runner is not needed anymore. |
| `ec2-instance-id` | Required if you use the `stop` mode. | EC2 Instance Id of the created runner.
The id is provided by the output of the action in the `start` mode.
The id is used to terminate the EC2 instance when the runner is not needed anymore. |
| `iam-role-name` | Optional. Used only with the `start` mode. | IAM role name to attach to the created EC2 runner.
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.
Setting this requires additional AWS permissions for the role launching the instance (see above). |
diff --git a/action.yml b/action.yml
index 09fa9591..54de0cbf 100644
--- a/action.yml
+++ b/action.yml
@@ -37,6 +37,23 @@ inputs:
The runner doesn't require any inbound traffic. However, outbound traffic should be allowed.
This input is required if you use the 'start' mode.
required: false
+ key-name:
+ description: >-
+ EC2 Key Pair name.
+ Can be assigned to the EC2 instance so user can SSH in for debuging.
+ required: false
+ storage-path:
+ description: >-
+ EC2 Block Storage Volume.
+ Used for configuring the mount path of the volume if you're overriding the default volume size of the EC2 instance.
+ The parameter `storage-size` must also be configured when using this parameter.
+ required: false
+ storage-size:
+ description: >-
+ EC2 Block Storage Volume.
+ Used for overriding volume size of the machine if your project exceed the 8GiB default storage.
+ The parameter `storage-path` must also be configured when using this parameter.
+ required: false
label:
description: >-
Name of the unique label assigned to the runner.
diff --git a/src/aws.js b/src/aws.js
index bcf53646..6b416485 100644
--- a/src/aws.js
+++ b/src/aws.js
@@ -47,6 +47,17 @@ async function startEc2Instance(label, githubRegistrationToken) {
SecurityGroupIds: [config.input.securityGroupId],
IamInstanceProfile: { Name: config.input.iamRoleName },
TagSpecifications: config.tagSpecifications,
+ KeyName: config.keyName,
+ BlockDeviceMappings: [
+ {
+ DeviceName: config.storagePath,
+ Ebs: {
+ DeleteOnTermination: true,
+ VolumeSize: config.storageSize,
+ },
+ },
+ ],
+
};
try {
diff --git a/src/config.js b/src/config.js
index 1100f51e..da1a98ef 100644
--- a/src/config.js
+++ b/src/config.js
@@ -10,6 +10,9 @@ class Config {
ec2InstanceType: core.getInput('ec2-instance-type'),
subnetId: core.getInput('subnet-id'),
securityGroupId: core.getInput('security-group-id'),
+ keyName: core.getInput('key-name'),
+ storagePath: core.getInput('storage-path'),
+ storageSize: core.getInput('storage-size'),
label: core.getInput('label'),
ec2InstanceId: core.getInput('ec2-instance-id'),
iamRoleName: core.getInput('iam-role-name'),