#!/bin/bash #Autoscaling config name AC_CONFIG="my-lc-bycli" #Autoscaling group name AC_GROUP_NAME="my-lb-asg-bycli" #desired-capacity DC="1" #security group SG="sg-9b3a8bfe" #which key pari KP="ELB" #specify machine type INSTANCE_TYPE="t2.micro" #which AMI you wanna use in autoscaling AMI_ID="ami-501a1402" GP_MAX="1" GP_MIN="1" aws autoscaling create-launch-configuration --launch-configuration-name $AC_CONFIG --image-id $AMI_ID --instance-type $INSTANCE_TYPE --security-groups "$SG" --key-name $KP --associate-public-ip-address aws 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 要注意一下。
时间: 2024-10-09 11:06:21