1

I'm trying to import a vmdk image using ec2-import-instance command but it returns below error:

usage: aws [options] [parameters] aws: error: argument command: Invalid choice, valid choices are:

autoscaling | cloudformation cloudfront
| cloudhsm cloudsearch | cloudsearchdomain etc..

My command is here:

aws ec2-import-instance "C:\AWS-TEST-VM\aws-test-vm-01\aws-test-vm-01-disk1.vmdk" -f vmdk -t m1.small -a x86_64 -b bucket_name -o Access Key –w Secret+Access+Key -p Linux --ignore-region-affinity

1 Answer 1

1

It appears that you are mixing up two different command-line interfaces.

The 'older-style' commands have hyphenated words, eg:

ec2-import-instance -t instance_type [-g group] -f file_format -a architecture [-p platform_name] -b s3_bucket_name ...

The newer AWS Command-Line Interface (CLI) uses the syntax of aws <service> <command> <parameters>, for example:

aws ec2 import-image [--description <value>] [--disk-containers <value>] [--license-type <value>] ...

See:

Sign up to request clarification or add additional context in comments.

2 Comments

@john : Do boto or boto3 have some api for import-image?
The AWS CLI uses boto, so it is definitely in there! This seems to be the one for boto3: boto3.readthedocs.org/en/latest/reference/services/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.