Skip to content

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

  1. On the AWS Console menu, navigate to All servicesComputeEC2.
  2. Click on the Launch Instance button.
  3. On the nagivation bar, set your region to us-east-2.
  4. Set a name of your choice and click on Browse More AMIs.
  5. Select Community AMIs. In the search field, type auto-osbuild and choose an architecture of your choice;
    1. Set a Key pair.
    2. Specify other instance configurations of your choice i.e storage. Click Advanced details for more opetions.
  6. Click Launch instance.
  7. Connect to your instance using any of these options: EC2 Instance Connect, Session Manager, SSH client or EC2 serial console.
  8. Verify your instance connection in the AMI:

    # 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

Procedure

  1. Build an image with automotive-image-builder:

    $ sudo automotive-image-builder build \
    --target aws --export image \
    sample-images/images/simple-developer.aib.yml <my-image>.raw
    
  2. Copy the image to your Amazon S3 bucket:

    $ aws s3 cp <my_image.raw> s3://<my_bucket>/
    
  3. Create an image-snapshot:

    $  aws ec2 import-snapshot \
    --disk-container 'Format=raw,UserBucket={S3Bucket=<my_bucket>,S3Key=<my_image.raw>}' | jq -r .ImportTaskId
    
  4. 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”

    $ aws ec2 describe-import-snapshot-tasks --import-task-ids import-snap-<d2d8855fdf3fa3f1t>
    
  5. 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.

    $ 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>" } }]'
    
  6. Connect to your Amazon EC2 instance with ssh:

    ssh -i <my_sshkey>.pem ec2-user@<public_IP>
    
  7. Verify your ssh connection:

    $ whoami
    

© Red Hat