Is it possible to create an EC2 instance from a startup configuration via a command line interface or API?

Amazon AWS allows you to create launch configurations that will be used with auto-scaling groups. However, how can you deploy an instance of a single instance based on a launch configuration?

+6
source share
5 answers

You will need to create an ASG to create an instance from the launch configuration following the command. Change the minimum, maximum and desired capacities according to your needs. Refer to the document .

aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --launch-configuration-name my-launch-config --min-size 0 --max-size 1 --desired-capacity 1 --vpc-zone-identifier subnet-41767929c

ASG.

aws autoscaling detach-instances --instance-ids i-2a2d8978 --auto-scaling-group-name my-asg --should-decrement-desired-capacity

ASG

aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-asg

PLS , - AWS. , Cloud.

+1

, AWS CloudFormation. CloudFormation CLI API CloudFormation . .

, AWS CloudFormation AutoScaling, this. CloudFormation.

0
0

2017 . Auto Scale Group.

:

aws ec2 run-instances --launch-template LaunchTemplateId=lt-0abcd290751193123,Version=1

See AWS for details at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#launch-instance-from-launch-template.

0
source
aws ec2 run-instances --launch-template LaunchTemplateId=lt-123456789,Version=1

where lt-123456789is the identifier of your startup template

0
source

All Articles