How to Create Launch Configuration for autoscaling on Amazon Web Service(AWS).

A launch configuration is a template that an EC2 Auto Scaling group uses to launch EC2 instances. When you create a launch configuration, you specify information for the instances such as the ID of the Amazon Machine Image (AMI), the instance type, a key pair, one or more security groups, and a block device mapping.

 

  • Login to aws portal.
  • Click on Services.

 

Fig 1

 

  • Under Compute select EC2.

 

Fig 2

 

  • Click on Launch Configurations.

 

Fig. 3

 

  • Click on Create Launch configuration.

 

Fig. 4

 

  • Provide launch configuration name.
  • Select AMI(Amazon Machine Image) like : Ubuntu 18.04 or centos 8 .

 

Fig. 5

 

  • Click on Choose Instance type.

 

Fig. 6

 

  • Select number of vCPUs & memory as per requirement.

 

Fig. 7

 

  • Enable Monitoring for instance logs within Cloudwatch.
  • Click on Advance details.

 

Fig. 8

 

  • Leave the all configuration.

 

Fig 9

 

  • User Data can be used to perform common automated configuration tasks and even run scripts after the instance starts. You can pass two types of user data to Amazon EC2: shell scripts and cloud-init directives.
  • Assign IP address type: auto-assign or custom .

 

Fig 10

 

  • Provide Storage(volume) for instance.
  • We can increase or decrease volume as per requirement.

 

Fig 11

 

  • Create or Select existing security group.
  • We can Add more rules like:- SSH ,HTTP or HTTPS .

 

Fig 12

 

  • Create or Select Existing Key Pair.
  • Then click on Create Launch Configuration.

 

Fig 13

 

  • After sometime Launch Configuration is ready.

 

Fig 14

 

 

Create Launch Configuration using Shell

 1: To create a launch configuration.

       aws autoscaling create-launch-configuration –launch-configuration-name launch_config_name  –image-id image_ami  –instance-type instance_type

 

 2: To create a launch configuration.

       aws autoscaling create-launch-configuration  –launch-configuration-name launch-config_name –key-name key-pair_name –instance-id instance_id –security-groups security_group_id  –instance-type m1.small  –user-data path_of_the_file 

 

Leave a Reply

Your email address will not be published.