Getting started on AWS
Getting started on AWS¶
Set up your development environment with the prerequisite tools and repositories you need to quickly start building AutoSD images on Amazon Web Services (AWS).
Quick start: Running pre-built AutoSD images on AWS¶
To run an AutoSD image on AWS, you need access to the AWS web console, through a staging account for development and testing purposes, and an active account for production.
Prerequisites
- An active AWS account or staging account
Procedure
- On the AWS Console menu, navigate to All services → Compute → EC2.
- Click on the Launch Instance button.
- Set a name of your choice and click on Browse More AMIs.
- Select Community AMIs. In the Search field, type
autosd
, and choose an architecture.- Set a Key pair.
- Specify other instance configurations of your choice i.e storage. Click Advanced details for more opetions.
- Click Launch instance.
- Connect to your instance using any of these options: EC2 Instance Connect, Session Manager, SSH client or EC2 serial console.
-
Verify your instance connection in the AMI:
```console
hostnamectl¶
```
Quick start: Uploading a custom AutoSD image to AWS¶
To upload a custom image on AWS, you need an active AWS account for access to the AWS web console. Use a sample manifest files from the images directory to help build images locally.
Prerequisites
- You have installed AWSCLI2
- You have access to an Amazon S3 bucket
- You have installed jq
- A local clone of the AutoSD sample-images repository
- The
automotive-image-builder
tool. For more information, see Installing theautomotive-image-builder
tool
Procedure
-
Build an image with
automotive-image-builder
:console $ sudo automotive-image-builder build \ --target aws --export image \ sample-images/images/simple-developer.aib.yml <my-image>.raw
-
Copy the image to your Amazon S3 bucket:
console $ aws s3 cp <my_image.raw> s3://<my_bucket>/
-
Create an image-snapshot:
console $ aws ec2 import-snapshot \ --disk-container 'Format=raw,UserBucket={S3Bucket=<my_bucket>,S3Key=<my_image.raw>}' | jq -r .ImportTaskId
-
Monitor the image-snapshot task:
Note
Find the
import-snap
value from the previous command results. Run this command several times to monitor the the image-snapshot task until the status is "Complete"console $ aws ec2 describe-import-snapshot-tasks --import-task-ids import-snap-<d2d8855fdf3fa3f1t>
-
Register the image to EC2 web console with your requirement:
Note
Find the
snap
value for this prompt from the previous commnad results when complete.console $ aws ec2 register-image --name <my_instance> \ --virtualization-type hvm --root-device-name /dev/sda1 \ --ena-support --boot-mode uefi \ --block-device-mappings '[{"DeviceName": "/dev/sda1", "Ebs": { "SnapshotId": "snap-<03c8ab5708d7d3e2f>" } }]'
-
Connect to your Amazon EC2 instance with
ssh
:console $ ssh -i <my_sshkey>.pem ec2-user@<public_IP>
-
Verify your
ssh
connection:console $ whoami