Hi, Thanks for help. I did exactly the same.
Below you can see that I completely deleted VPC files.
After that, I followed same instructions and still I get same error. Below I post. Would appreciate your help
klnde@DESKTOP-KTQUM43 ~
$ pip install awscli
-bash: pip: command not found
klnde@DESKTOP-KTQUM43 ~
$ pip2 install awscli
Requirement already satisfied: awscli in /usr/lib/python2.7/site-packages
Requirement already satisfied: PyYAML<=3.12,>=3.10 in /usr/lib/python2.7/site-pa ckages (from awscli)
Requirement already satisfied: rsa<=3.5.0,>=3.1.2 in /usr/lib/python2.7/site-pac kages (from awscli)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.12 in /usr/lib/python2.7/s ite-packages (from awscli)
Requirement already satisfied: botocore==1.8.20 in /usr/lib/python2.7/site-packa ges (from awscli)
Requirement already satisfied: colorama<=0.3.7,>=0.2.5 in /usr/lib/python2.7/sit e-packages (from awscli)
Requirement already satisfied: docutils>=0.10 in /usr/lib/python2.7/site-package s (from awscli)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/lib/python2.7/site-packages (from rsa<=3.5.0,>=3.1.2->awscli)
Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == “2.6” or python_version == “2.7” in /usr/lib/python2.7/site-packages (from s3transfer<0. 2.0,>=0.1.12->awscli)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/lib/python2.7 /site-packages (from botocore==1.8.20->awscli)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/lib/python2.7/site -packages (from botocore==1.8.20->awscli)
Requirement already satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (fro m python-dateutil<3.0.0,>=2.1->botocore==1.8.20->awscli)
klnde@DESKTOP-KTQUM43 ~
$ aws
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: too few arguments
klnde@DESKTOP-KTQUM43 ~
$ aws configure
AWS Access Key ID [****************DQPA]: AKIAIMJPMJM7CPJCDQPA
AWS Secret Access Key [****************7sbC]: zbBK/t4cP+WCFa/NqKS1j3pE8O+bj0jsJs Nk7sbC
Default region name [us-west-2]: us-west-2
Default output format [text]: text
klnde@DESKTOP-KTQUM43 ~
$ wget http://files.fast.ai/files/setup_p2.sh
–2017-12-30 09:49:30-- http://files.fast.ai/files/setup_p2.sh
Resolving files.fast.ai (files.fast.ai)… 67.205.15.147
Connecting to files.fast.ai (files.fast.ai)|67.205.15.147|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 2520 (2.5K) [application/x-sh]
Saving to: ‘setup_p2.sh.3’
setup_p2.sh.3 100%[===================>] 2.46K --.-KB/s in 0s
2017-12-30 09:49:33 (40.0 MB/s) - ‘setup_p2.sh.3’ saved [2520/2520]
klnde@DESKTOP-KTQUM43 ~
$ cat setup_p2.sh
export vpcId=aws ec2 create-vpc --cidr-block 10.0.0.0/28 --query 'Vpc.VpcId' -- output text
aws ec2 modify-vpc-attribute --vpc-id $vpcId --enable-dns-support “{“Value”:tr ue}”
aws ec2 modify-vpc-attribute --vpc-id $vpcId --enable-dns-hostnames “{“Value”: true}”
export internetGatewayId=aws ec2 create-internet-gateway --query 'InternetGatew ay.InternetGatewayId' --output text
aws ec2 attach-internet-gateway --internet-gateway-id $internetGatewayId --vpc-i d $vpcId
export subnetId=aws ec2 create-subnet --vpc-id $vpcId --cidr-block 10.0.0.0/28 --query 'Subnet.SubnetId' --output text
export routeTableId=aws ec2 create-route-table --vpc-id $vpcId --query 'RouteTa ble.RouteTableId' --output text
aws ec2 associate-route-table --route-table-id $routeTableId --subnet-id $subnet Id
aws ec2 create-route --route-table-id $routeTableId --destination-cidr-block 0.0 .0.0/0 --gateway-id $internetGatewayId
export securityGroupId=aws ec2 create-security-group --group-name my-security-g roup --description "Generated by setup_vpn.sh" --vpc-id $vpcId --query 'GroupId' --output text
aws ec2 authorize-security-group-ingress --group-id $securityGroupId --protocol tcp --port 22 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $securityGroupId --protocol tcp --port 8888-8898 --cidr 0.0.0.0/0
aws ec2 create-key-pair --key-name aws-key --query ‘KeyMaterial’ --output text > ~/.ssh/aws-key.pem
chmod 400 ~/.ssh/aws-key.pem
export instanceId=aws ec2 run-instances --image-id ami-bc508adc --count 1 --ins tance-type p2.xlarge --key-name aws-key --security-group-ids $securityGroupId -- subnet-id $subnetId --associate-public-ip-address --block-device-mapping "[ { \" DeviceName\": \"/dev/sda1\", \"Ebs\": { \"VolumeSize\": 128, \"VolumeType\": \"g p2\" } } ]" --query 'Instances[0].InstanceId' --output text
export allocAddr=aws ec2 allocate-address --domain vpc --query 'AllocationId' - -output text
echo Waiting for instance start…
aws ec2 wait instance-running --instance-ids $instanceId
sleep 10 # wait for ssh service to start running too
export assocId=aws ec2 associate-address --instance-id $instanceId --allocation -id $allocAddr --query 'AssociationId' --output text
export instanceUrl=aws ec2 describe-instances --instance-ids $instanceId --quer y 'Reservations[0].Instances[0].PublicDnsName' --output text
echo securityGroupId=$securityGroupId
echo subnetId=$subnetId
echo instanceId=$instanceId
echo instanceUrl=$instanceUrl
echo Connect: ssh -i ~/.ssh/aws-key.pem ubuntu@$instanceUrl
klnde@DESKTOP-KTQUM43 ~
$ bash setup_p2.sh
An error occurred (VpcLimitExceeded) when calling the CreateVpc operation: The m aximum number of VPCs has been reached.
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --vpc-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --vpc-id: expected one argument
An error occurred (InternetGatewayLimitExceeded) when calling the CreateInternetGateway operation: The maximum number of in ternet gateways has been reached.
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --internet-gateway-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --vpc-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --vpc-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --route-table-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --route-table-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --vpc-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --group-id: expected one argument
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --group-id: expected one argument
setup_p2.sh: line 13: /home/klnde/.ssh/aws-key.pem: No such file or directory
chmod: cannot access ‘/home/klnde/.ssh/aws-key.pem’: No such file or directory
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --subnet-id: expected one argument
An error occurred (AddressLimitExceeded) when calling the AllocateAddress operation: The maximum number of addresses has be en reached.
Waiting for instance start…
Waiter InstanceRunning failed: Max attempts exceeded
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --instance-id: expected one argument
securityGroupId=
subnetId=
instanceId=
instanceUrl=None
Connect: ssh -i /home/klnde/.ssh/aws-key.pem ubuntu@None
klnde@DESKTOP-KTQUM43 ~
$
klnde@DESKTOP-KTQUM43 ~