loft-sh / devpod-provider-aws

DevPod on AWS
Mozilla Public License 2.0
13 stars 8 forks source link

Add AWS_ROOT_DEVICE for systems that do not use /dev/sda1 #24

Closed dlacosteGFM closed 9 months ago

dlacosteGFM commented 10 months ago

If you use AWS_DISK_SIZE, it adds an EBS VolumeMapping to the new size.

Unfortunately, while Ubuntu (which would have been MY preference) uses /dev/sda1, Amazon Linux uses /dev/xda1 and the net result is that you end up with a second volume rather than enlarging the first one.

This code tries to get around that by querying the AMI (after it has been configured) and getting the root device name from the AMI definition. When you pass it in this way, the image ends up on that disk rather than creating a second volume for the instance.

I tested this on our Amazon Linux (yeah, I know....) image and it works fine, but I haven't written much go in the past year so please let me know if there are any changes you would like to see!