[Feature Request] Add Support to Configure EBS Disk Size
Based on AWS SDK for Javascript, EBS disk size can be configured using BlockDeviceMappings parameter. I'm only interested to setup the BlockDeviceMappings.Ebs.VolumeSize field. I was thinking if we can add an optional parameter ebs-volume-size with integer type which will be passed to BlockDeviceMappings.Ebs.VolumeSize that will be really helpful.
Its in progress: https://github.com/machulav/ec2-github-runner/pull/189
I need this.. my plan was
ImageId: config.input.ec2ImageId,
InstanceType: config.input.ec2InstanceType,
MinCount: 1,
MaxCount: 1,
UserData: Buffer.from(userData.join('\n')).toString('base64'),
SubnetId: config.input.subnetId,
SecurityGroupIds: [config.input.securityGroupId],
IamInstanceProfile: { Name: config.input.iamRoleName, Arn: config.input.iamRoleArn },
TagSpecifications: config.tagSpecifications,
// Define the root volume size
BlockDeviceMappings: [
{
DeviceName: "/dev/xvda", // Default root volume device name
Ebs: {
VolumeSize: config.input.volumeSize || 8, // Set the volume size, default to 8 GiB if not specified
VolumeType: "gp2", // General Purpose SSD (you can choose gp3 or other types as needed)
DeleteOnTermination: true, // Optionally delete volume on instance termination
},
},
],
};
try {
const result = await ec2.runInstances(params).promise();
const ec2InstanceId = result.Instances[0].InstanceId;
core.info(`AWS EC2 instance ${ec2InstanceId} is started`);
return ec2InstanceId;
} catch (error) {
core.error('AWS EC2 instance starting error');
throw error;
}
}
I'm adding support to pass the full BlockDeviceMappings settings in https://github.com/machulav/ec2-github-runner/pull/229
@FaisalPathboxAI See also #212. Can you test #229 and report back?