Clear Linux is available on the AWS marketplace. However, it may not be the latest version because we only update the marketplace on a periodic basis, as often as weekly or but maybe monthly as well. If you want to use the latest release from us or upload your own custom image, follow this guide.
- Prerequisites
- Download or create a |CL| image for AWS
- Create an S3 bucket
- Upload the |CL| image into the bucket
- Add a user to IAM with AWS_CLI privilege
- Install and configure the AWS CLI tool on your system
- Import a snapshot of the |CL| image
- Create an AMI from the snapshot
- Launch an instance
- Connect to your |CL| instance
- Related topics
- You are familiar with AWS and how to use it
Download or create a |CL| image for AWS
Obtain an AWS |CL| image using one of these methods.
- Go to the Downloads page and download the Amazon* Web Services (AWS) image.
- Uncompress it.
On a |CL| system, open a terminal.
Install the clr-installer bundle.
sudo swupd bundle-add clr-installer
Download a sample aws.yaml configuration file.
Make changes to the configuration file as needed. See Installer YAML Syntax for more information on clr-installer configuration YAML syntax.
Download the AWS image post-install script and make it executable.
Produce an image with clr-installer.
clr-installer --template $PWD/aws.yaml
Log into AWS.
Go to :guilabel:`Services`, :guilabel:`Storage`, and select :guilabel:`S3`. See Figure 1.
Click :guilabel:`+ Create bucket`.
Set a bucket name and select a region. See Figure 3.
Leave the :guilabel:`Configure options` and :guilabel:`Set permissions` settings as is or configure as desired. See Figure 4 and 5.
At the :guilabel:`Review` screen, click :guilabel:`Create bucket`.
The created bucket should appear. See Figure 7.
Upload the |CL| image into the bucket
Click on the bucket. See Figure 8.
Click :guilabel:`Upload`. See Figure 9.
Click :guilabel:`Add files` and select the |CL| image file to upload. See Figure 10.
Click :guilabel:`Next`. Leave remaining settings as is or set as desired. See Figure 11, Figure 12, and Figure 13.
Click :guilabel:`Upload` to upload the image. See Figure 14.
Go to :guilabel:`Services`, :guilabel:`Security, Identity, & Compliance`, and select :guilabel:`IAM`. See Figure 15.
On the left navigation bar under :guilabel:`Access management`, select :guilabel:`Users`. See Figure 16.
Click :guilabel:`Add user`. See Figure 17.
Under the :guilabel:`Set user details` section, enter a user name. See Figure 18.
Under the :guilabel:`Select AWS access type` section, checkmark :guilabel:`Programmatic access`. See Figure 18.
Under :guilabel:`Set permissions`, select :guilabel:`Add user to group`. See Figure 19.
Under :guilabel:`Add user to group`, enter AWS_CLI into search window. Checkmark :guilabel:`AWS_CLI`. See Figure 19.
Click :guilabel:`Next: Tags`.
Click :guilabel:`Next: Review`.
Click :guilabel:`Create user`. See Figure 20.
After the user is successfully added, save the :guilabel:`Access key ID` and the :guilabel:`Secret access key`. These will be used when setting up the AWS CLI tool at a later step. See Figure 21.
Click :guilabel:`Close`.
To install the tool on |CL|, simply run:
sudo swupd bundle-add cloud-api
Configure it with your security credentials, default region, and default output format. See Configuring the AWS CLI for more information.
aws configure
Below is an example (using the security credentials that was created in the previous section):
AWS Access Key ID [None]: AKIA5LEGQPQ3EUB3JMS7 AWS Secret Access Key [None]: EcvbWpWr+Gp7NhBoVEacwR3EifzN7xTTg8B1PHvO Default region name [None]: us-west-2 Default output format [None]: json
Verify your credentials are good.
aws iam list-access-keys
If you get something like the example below, then make sure you set your system date and time properly.
An error occurred (SignatureDoesNotMatch) when calling the ListAccessKeys operation: Signature expired: 20200305T153154Z is now earlier than 20200305T231847Z (20200305T233347Z - 15 min.)
Import a snapshot of the |CL| image
Create a :file:`container.json` with the description of the image to import. Specify the name of the S3 bucket that was created earlier for the S3Bucket field and the name of |CL| image that was uploaded to the S3 bucket for the S3Key.
Here's an example:
{ "Description": "My Clear Linux AWS 32400 Image", "Format": "raw", "UserBucket": { "S3Bucket": "my-clearlinux-bucket", "S3Key": "clear-32400-aws.img" } }
Import a snapshot of the image.
aws ec2 import-snapshot \ --description "My Clear Linux AWS 32400 Snapshot" \ --disk-container file://container.jsonYou should get an output similar this example:
{ "Description": "My Clear Linux AWS 32400 Snapshot", "ImportTaskId": "import-snap-00fa9ccd98e9b8378", "SnapshotTaskDetail": { "Description": "My Clear Linux AWS 32400 Snapshot", "DiskImageSize": 0.0, "Format": "RAW", "Progress": "3", "Status": "active", "StatusMessage": "pending", "UserBucket": { "S3Bucket": "my-clearlinux-bucket", "S3Key": "clear-32400-aws.img" } } }
Using the ImportTaskId from the previous step, check the status of the import. For example:
snapshot_id=$(aws ec2 describe-import-snapshot-tasks \ --import-task-ids "import-snap-00fa9ccd98e9b8378" \ | grep SnapshotId | awk -F '"' '{print $4}')
Wait for the Status field to show completed before proceeding.
The resulting snapshot_id will be used to create an AMI in the next section.
There are 2 methods to create an AMI from the snapshot.
AWS CLI Method:
aws ec2 register-image \ --name "My-Clear-Linux-32400-AMI" \ --description "My Clear Linux 32400 AMI" \ --architecture x86_64 \ --virtualization-type hvm \ --ena-support \ --root-device-name "/dev/sda1" \ --block-device-mappings "[ { \”Deviceame\": \"/dev/sda1\", \"Ebs\": { \"SnapshotId\": \"$snapshot_id\" } } ]"
GUI Method:
Go to :guilabel:`Services`, :guilabel:`Compute`, and select :guilabel:`EC2`. See Figure 22.
Click :guilabel:`Snapshots`. See Figure 23.
Locate the snaphot using the Snapshot ID. See Figure 24.
Right-click it and select :guilabel:`Create Image`.
Configure as follows:
- Enter the name in the :guilabel:`Name` field
- Enter the description in the :guilabel:`Description` field
- Set the :guilabel:`Architecture` as x86_64
- Set the :guilabel:`Virtualization type` as Hardware-assisted virtualization
- Set the :guilabel:`Root device name` as /dev/sda1
See Figure 25.
Click :guilabel:`Create`.
Go to :guilabel:`Services`, :guilabel:`Compute`, and select :guilabel:`EC2`. See Figure 26.
Click the :guilabel:`Launch Instance` dropdown and select :guilabel:`Launch Instance`. See Figure 27.
On the left navigation bar, select :guilabel:`My AMIs`. See Figure 28.
Find your AMI and click :guilabel:`Select`.
From here onward, configure the details of your instance as desired and launch it.
Connect to your |CL| instance
- Follow these steps to :ref:`connect to your instance<aws-web-connect>`.



























