To make things further complicated, the steps on the CHR AWS Installation page proved to be outdated and of little use.
So to help the next guy with this problem, here are the steps I used to get there:
- Download the latest raw disk image from the the normal download page. The current version is called chr-6.41.2.img.zip at this moment
- Extract the zip
- Download and install QEmu
- Use QEmu to resize the image to whatever size you want, in this case, 16GB
qemu-img resize -f raw chr-6.41.2.img 16G
- Upload the resulting file to your AWS S3 bucket however you want. I used S3 Express since it supported multipart uploading.
put chr-6.41.2.img <your bucket>/chr-6.41.2.img -mul:50 -t:4
- Create a text file called container.json that specifies where the images is in S3, and what you want to call it.
{
"Description": "Mikrotik CHR 6.41.2 (16GB)",
"Format": "raw",
"UserBucket": {
"S3Bucket": "<your bucket name>",
"S3Key": "chr-6.41.2.img"
}
} - Import the uploaded file as a snapshot in EC2 - this returns a ImportTaskId which you will need for the next step
aws ec2 import-snapshot --description "Mikrotik CHR 6.41.2 (16GB)" --disk-container file://containers.json
- Use the ImportTaskId to check the import status periodically. This took me about 10mins for this to complete. When this is done it will give you a SnapshotId which you will need for the next step
aws ec2 describe-import-snapshot-tasks --import-task-ids <ImportTaskId>
- Use the SnapshotId to create an AMI from the snapshot
aws ec2 register-image --name "Mikrotik CHR 6.41.2 (16GB)" --architecture x86_64 --root-device-name /dev/sda1 --virtualization-type hvm --block-device-mappings DeviceName="/dev/sda1",Ebs={SnapshotId=<SnapshotId>}
- Tada! You now have a AMI that you can launch to create your CHR.