EC2 Instance
There are differences between growing a launch configuration from scratch and growing a launch configuration from a present EC2 example. When creating a release configuration from scratch, you specify the photo ID, instance type, non-obligatory assets (such as storage gadgets), and non-compulsory settings (like monitoring). When you create a release configuration from taking walks instance, Amazon EC2 Auto Scaling derives attributes for the release configuration from the desired model. Features are also derived from the block device mapping for the AMI from which the instance became released, ignoring any more block gadgets brought after launch. When you create a release configuration using a walking illustration, you can override the subsequent attributes with the aid of specifying them as a part of the identical request: AMI, block devices, key pair, instance profile, instance type, kernel, example tracking, placement tenancy, ramdisk, protection corporations, Spot (max) charge, patron records, whether the instance has a public IP deal with, and whether the model is EBS-optimized.
Create a Launch Configuration using an EC2 instance
To make a launch configuration, use the attributes of a current EC2 model, and specify the ID of the example.
Console
You can use the console to create a release configuration and an Auto Scaling group from a strolling EC2 example and add the instance to the new Auto Scaling group. For extra records, see Attach EC2 instances on your Auto Scaling company.
AWS CLI
Select the create-launch-configuration command to create a launch configuration from an example using identical attributes as the instance. Any block devices delivered after launch are omitted.
AWS autoscaling create-launch-configuration --launch-configuration-name my-lc-from-instance --instance-id i-a8e09d9c
We can use the following describe-launch-configurations command to describe the release configuration and verify that its attributes are healthful like the ones of the instance.
AWS autoscaling describe-launch-configurations --launch-configuration-names my-lc-from-instance
The following is an example response.
{
"LaunchConfigurations": [
{
"UserData": null,
"EbsOptimized": false,
"LaunchConfigurationARN": "arn",
"InstanceMonitoring": {
"Enabled": false
},
"ImageId": "ami-05355a6c",
"CreatedTime": "2014-12-29T16:14:50.382Z",
"BlockDeviceMappings": [],
"KeyName": "my-key-pair",
"SecurityGroups": [
"sg-8422d1eb"
],
"LaunchConfigurationName": "my-lc-from-instance",
"KernelId": "null",
"RamdiskId": null,
"InstanceType": "t1.micro",
"AssociatePublicIpAddress": true
}
]
}
Change the Launch Configuration (Auto Scaling group)
An Auto Scaling organisation is related to one release configuration at a time, and also, you can't regulate a released design after you've erected it. To change the launch ordering for an Auto Scaling organisation, use a present release configuration because of the concept of a modern-day release configuration. Then, update the Auto Scaling group to apply the ultra-modern release configuration.
Console
-
Open the Amazon EC2 console with the help of this given link (https://console.Aws.Amazon.Com/ec2/).
-
On the navigation pane below Auto Scaling, pick Launch Configurations.
-
Select the launch configuration and pick Actions. Copy the launch configuration. This unit up a trendy launch configuration with identical alternatives to the proper; however, "Copy" was added to the name.
-
On the Copy Launch Configuration web page, edit the configuration options as desired and select out to Create launch configuration.
-
On the navigation pane, beneath Auto Scaling, choose out Auto Scaling Groups.
-
Select the take a look at a field next to the Auto Scaling organisation.
-
A break up-pane opens up at the bottom of the page, displaying information approximately the chosen agency.
-
On the Details tab, pick out Launch configuration, Edit.
-
For Launch configuration, pick out the brand new release configuration.
- When you have been given complete, pick out Update.
AWS CLI
-
Describe the current release configuration and the usage of the describe-launch-configurations command.
-
Create a brand new launch configuration using the create-launch-configuration command.
- Update the Auto Scaling institution's launch configuration with the replace-automobile-scaling-group command with the --launch-configuration-names parameter.
Tools for Windows PowerShell
-
Explain the present-day release configuration with the use of the Get-ASLaunchConfiguration command.
-
Make a new launch configuration using the New-ASLaunchConfiguration command.
- Update the launch configuration for the Auto Scaling group with the usage of the Update-ASAutoScalingGroup command with the -LaunchConfigurationName parameter.
Configure instance tenancy with a launch configuration
Tenancy defines how EC2 times are allotted across physical hardware and impacts pricing. There are three tenancy alternatives to be had:
-
Shared (default) — Multiple AWS debts may additionally proportion the equal physical hardware.
-
Dedicated Instance (dedicated) — Your instance runs on single-tenant hardware.
- Dedicated Host (host) — Your example runs on a physical server with EC2 instance ability entirely committed for your use, a far-flung server with configurations that you can control.
AWS CLI
Use the subsequent create-release-configuration command to generate a release configuration that sets the release configuration tenancy to commit.
AWS autoscaling create-launch-configuration --launch-configuration-name my-launch-config --placement-tenancy dedicated --image-id
We can use the following describe-release-configurations command to affirm the example placement tenancy of the launch configuration.
aws autoscaling describe-launch-configurations --launch-configuration-names my-launch-config
For example, output for a release configuration that creates Dedicated Instances. The PlacementTenancy parameter is only a part of the output for this command while you explicitly set the example placement tenancy.
{
"LaunchConfigurations": [
{
"UserData": null,
"EbsOptimized": false,
"PlacementTenancy": "dedicated",
"LaunchConfigurationARN": "arn",
"InstanceMonitoring": {
"Enabled": true
},
"ImageId": "ami-b5a7ea85",
"CreatedTime": "2020-03-08T23:39:49.011Z",
"BlockDeviceMappings": [],
"KeyName": null,
"SecurityGroups": [],
"LaunchConfigurationName": "my-launch-config",
"KernelId": null,
"RamdiskId": null,
"InstanceType": "m3.medium"
}
]
}
FAQs
Can we edit the launch configuration AWS?
An Auto Scaling group is related to one release configuration at a time, and you can't regulate a launch configuration after you've created it. To exchange the launch configuration for an Auto Scaling institution, use a current launch configuration as the idea for a brand new release configuration.
What configurations are required to release a new EC2 example?
When you create a release configuration, you must specify facts about the EC2 times to release. Include the Amazon Machine Image (AMI), example kind, key pair, safety corporations, and block device mapping. Alternatively, you could create a release configuration using attributes from a jogging EC2 example.
Where is the option for the Auto Scaling as launch config available in the AWS management Console?
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . On the navigation pane, under Auto Scaling, select Launch Configurations. In the navigation bar, select your AWS Region. Choose Create launch configuration, and make the launch configuration the usual way.
What is launch configuration in AWS?
A launch configuration is a template that an EC2 Auto Scaling organization makes use of to launch EC2 instances. When you create a release configuration, you specify records for the instances including the ID of the Amazon Machine Image (AMI), the example kind, a key pair, one or more safety corporations, and a block device mapping.
Conclusion
This blog discussed the concept of AWS EC2 Auto Scaling and one of the Launching Configurations offered by AWS EC2. We mentioned the significance of making and converting the configuration in AWS in detail with the assistance of an instance application.
We hope this blog has helped you beautify your information concerning Launching Configurations in AWS EC2 Auto Scaling.
To learn more, see Operating System, Unix File System, File System Routing, and File Input/Output.
Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and Algorithms, Competitive Programming, JavaScript, System Design, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio! But if you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc; you must look at the problems, interview experiences, and interview bundle for placement preparations.
Nevertheless, you may consider our paid courses to give your career an edge over others!
Do upvote our blogs if you find them helpful and engaging!
Happy Learning!