Import the FortiDeceptor image to AWS AMI
Go to IAM Service and create users and roles with proper permissions. Then get the Access Key ID/Secret Key from the My Security Credentials menu. You can only get the Secret Key at the time you create the Access Key.
Click this link https://docs.aws.amazon.com/vm- import/latest/userguide/vmie_prereqs.html#vmimport-role for information about creating a vmimport role to import/export VM images.
You can import the FortiDeceptor one of two ways:
Importing the FortiDeceptor image with python script
Install Python3, boto3 in Linux, and copy the import script to any work folder. Execute the script to import the FortiDeceptor image into AWS as AMI private image.
To get a copy of the Python script, see Python script for importing the FortiDeceptor image.
Before you begin, make sure you have copied the fdc.aws.vhd file to the current directory. To get a copy of the file, see Python script for importing the FortiDeceptor image. |
Example command:
python3 FDC_import_as_AWS_AMI.py \ -f /fdc.aws.vhd \ -n fdcv4.1.0b0090 \ -a x86_64 \ -s 1 \ -r us-west-2 \ -i AKIA2UEJLWR3DIUPLLF8 \ -k Uj8QO8TKpgHX5krbR88GkWwnQm2Ko4kl4cpUhk99 \ -b fdcbucket-akiaibf7bhp6ha4r4ypq
Importing the FortiDeceptor image with AWS EC2 toolkit
To upload the image to a storage bucket:
- Install the AWS CLI.
- In the Buckets list, open the bucket you created in the previous step.
- Click Upload and navigate to
fdc.aws.vhd
on your device. - Click Upload. The upload Status should display Succeeded.
Importing the uploaded VHD file as snapshot
Use the import-snapshot
command to import a disk.
To import a disk:
- Run
import-snapshot --description "My FDC VM" --disk-container
.Specify the URL of the S3 bucket, or provide the S3 bucket name and key.
- Use the
describe-import-snapshot-tasks
command to check the status of an import snapshot task.The snapshot is ready to use when the
status
iscomplete
.
The following image shows the response of above command. The status shown is active
, which means that the import is in progress.
Creating AMI from a snapshot
You can create an AMI with either the CLI or the AWS Management Console.
To create the AMI with the CLI:
aws ec2 register-image --name fdc-img-cm --architecture x86_64 --root-device-name /dev/sda1 --virtualization-type hvm --ena-support --block-device-mappings DeviceName=/dev/sda1,Ebs={SnapshotId=snap- 083a9220a5876cf77,VolumeSize=1,VolumeType=gp2,DeleteOnTermination=true} DeviceName=/dev/sdb,Ebs={VolumeType=gp2,VolumeSize=80,DeleteOnTermination=true}
To create the AMI with the AWS web console:
- Choose Snapshots in the navigation pane of EC2.
- Select the snapshot you imported.
- Click Create image from snapshot in the Actions menu.
- Enter the Image Name and Description.
- Configure the Block device mappings information, and click Create Image.