1
votes

I have an AWS Educate stater account. I want to create an instances via the AWS command line.

Command:

aws2 ec2 run-instances --image-id ami-0bba96c31d87e65d9 --count 1 --instance-type t2.micro --key-name awskey --security-group-ids sg-1830914d --subnet-id subnet-a5d2def9 --region us-east-1 --placement AvailabilityZone=us-east-1d

This is the error I get:

An error occurred (Unsupported) when calling the RunInstances operation: The requested configuration is currently not supported. Please check the documentation for supported configurations.`

I am new to AWS, your help would highly be appreciated. Thanks

1
What attempts have you made so far to fix this? I also suggest changing your request type to t3.microabdullahalali
I did it doesn't work. but I get another error message <code>when calling the RunInstances operation: You are not authorized to perform this operation. Encoded authorization failure message: zyWnlpq-ebISW7Od4p............</code>Aziz Qadeer
placement option would be json format.Lamanus
Is there anything non-standard about your VPC? Like dedicated tenancy?jarmod
Thank you for your reply. I don't know anything else non-standard, but my VPC is default.Aziz Qadeer

1 Answers

3
votes

There are few things you should check. First you should check that you have enough rights for your user to work with the ec2 section.

The next thing is that you should use the last version of the aws cli to prevent some problems.

Here is an example command how to run an instance from an AMI.

aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type t2.micro --key-name MyKeyPair --security-group-ids sg-903004f8 --subnet-id subnet-6e7f829e

So your line looks pretty fine.

Actual version of the CLI is 1.16. You use version 2 which is still in development. This could be the reason why you get some messages that the functions aren't supported at this moment. Perhaps you name is only "aws2".

https://pypi.org/project/awscli/#history