Use the following put-role-policy command to attach the policy to the role created in the preceding step.
ADDITIONAL INFORMATION:
Ensure that you specify the full path to the location of the role-policy.json file.
aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file://role-policy.json
To import the OVA for conversion, type the following command: aws ec2 import-image --cli-input-json "{ \"Description\": \"<Server OVA>\", \"DiskContainers\": [ { \"Description\": \"<text description of task>\", \"UserBucket\": { \"S3Bucket\": \"<your_bucket_name>\", \"S3Key\" : \"<server.ova>\" } } ]}"
ADDITIONAL INFORMATION:
Ensure to replace appropriate values wherever brackets <> are present in preceding command.
The system displays the Status and the ImportTaskId parameters.
To check the status of the import image, run the following command: aws ec2 describe-import-image-tasks --cli-input-json "{ \"ImportTaskIds\": [\"<Your_ImportTaskId>\"], \"NextToken\": \"abc\", \"MaxResults\": 10 } "
ADDITIONAL INFORMATION:
Where, ImportTaskId is the one from the output of Step 8. For example, import-ami-ffmanv5x.
The conversion process takes up to 30 minutes. You can run the preceding command repeatedly. When the AMI conversion is successful, the system displays the Status as completed and ImageId.
In the following example, the process is at the update stage and is 30% complete.