2.2. Manually uploading an AMI image to AWS by using the CLI
You can use RHEL image builder to build ami images and manually upload them directly to the Amazon AWS Cloud service provider by using the CLI.
Prerequisites
Procedure
Build the image:
# image-builder build ami \ --blueprint blueprint-name \ --aws-region us-east-1 \ --aws-bucket <example-bucket> \ --aws-ami-name <image-name> \Upload the image to AWS:
# image-builder upload <image-name> \- Check the image available EC2 in the AWS console and selecting the correct region.
- On the dashboard, select your image and click .
Troubleshooting
- If the build or upload command fails with an authentication or permission error, you must confirm that your AWS CLI profile has valid credentials and that your IAM user or role can access the S3 bucket and the EC2 VM Import/Export API.
-
If the command reports that the bucket is missing, not accessible, or in the wrong location, you must verify that the bucket name matches
--aws-bucketand that the bucket exists in the same AWS Region you pass to--aws-region. -
If AWS rejects the import with a service role error, you must create the
vmimportIAM role and trust policy that VM Import/Export requires, as described in Required service role to import a VM.