0
t2實例僅適用於VPC(如此處所述:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html#t2-instances-vpc-support)。所以當通過AWS CLI運行時,如何在命令行上指定VPC?我已經按照這裏(http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-set-up-new-instance.html)的文件,並有概括的命令行設置:使用AWS CLI指定t2實例VPC
aws ec2 run-instances \
--image-id amiID \
--key-name keyName \
--user-data file://instance-setup.sh \
--count 1 \
--instance-type instanceType \
--iam-instance-profile Name=CodeDeployDemo-EC2-Instance-Profile
我意識到使用M3實例正常工作,但我想一個t2.micro,因爲這種情況下僅會用於部署。
您需要設置命令的' - subnet-id'。完整文檔:http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html – datasage