#!/bin/bash#Autoscaling config nameAC_CONFIG="my-lc-bycli"#Autoscaling group nameAC_GROUP_NAME="my-lb-asg-bycli"#desired-capacityDC="1"#security groupSG="sg-9b3a8bfe"#which key pariKP="ELB"#specify machine typeINSTANCE_TYPE="t2.micro"#which AMI you wanna use in autoscalingAMI_ID="ami-501a1402"GP_MAX="1"GP_MIN="1"aws autoscaling create-launch-configuration --launch-configuration-name $AC_CONFIG \ --p_w_picpath-id $AMI_ID --instance-type $INSTANCE_TYPE \ --security-groups "$SG" \ --key-name $KP \ --associate-public-ip-addressaws autoscaling create-auto-scaling-group --auto-scaling-group-name $AC_GROUP_NAME \ --launch-configuration-name $AC_CONFIG \ --availability-zones "ap-southeast-1b" \ --max-size $GP_MAX --min-size $GP_MIN --desired-capacity $DC \ --vpc-zone-identifier "subnet-07ee4c62" #--load-balancer-names "my-lb"
在vpc-zone-identifier 与 associate-public-ip-address 要注意一下。