Earlier than you may create an Auto Scaling group utilizing a launch template, it’s essential to create a launch template with the parameters required to launch an EC2 occasion. These parameters embody the ID of the Amazon Machine Picture (AMI) and an occasion sort.
A launch template gives full performance for Amazon EC2 Auto Scaling and likewise newer options of Amazon EC2 comparable to the present technology of Amazon EBS Provisioned IOPS volumes (io2), EBS quantity tagging, T2 Limitless situations, Elastic Inference, and Devoted Hosts.
To create new launch templates, use the next procedures.
Contents
Create your launch template (console)
Change the default community interface settings
Modify the storage configuration
Configure superior settings on your launch template
Create a launch template from an current occasion (console)
Extra info
Limitations
Vital
Launch template parameters usually are not absolutely validated whenever you create the launch template. In the event you specify incorrect values for parameters, or if you don’t use supported parameter mixtures, no situations can launch utilizing this launch template. Make sure to specify the proper values for the parameters and use supported parameter mixtures. For instance, to launch situations with an Arm-based AWS Graviton or Graviton2 AMI, it’s essential to specify an Arm-compatible occasion sort.
Create your launch template (console)
The next steps describe the best way to configure your launch template:
Specify the Amazon Machine Picture (AMI) from which to launch the situations.
Select an occasion sort that’s suitable with the AMI that you simply specify.
Specify the important thing pair to make use of when connecting to situations, for instance, utilizing SSH.
Add a number of safety teams to permit related entry to the situations from an exterior community.
Specify whether or not to connect extra volumes to every occasion.
Add customized tags (key-value pairs) to the situations and volumes.
To create a launch template
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
On the navigation pane, underneath Situations, select Launch Templates.
Select Create launch template. Enter a reputation and supply an outline for the preliminary model of the launch template.
Beneath Auto Scaling steering, choose the test field to have Amazon EC2 present steering to assist create a template to make use of with Amazon EC2 Auto Scaling.
Beneath Launch template contents, fill out every required subject and any elective fields as wanted.
Software and OS Pictures (Amazon Machine Picture): (Required) Select the ID of the AMI on your situations. You’ll be able to search by way of all accessible AMIs, or choose an AMI from the Recents or Fast Begin record. In the event you do not see the AMI that you simply want, select Browse extra AMIs to browse the total AMI catalog.
To decide on a customized AMI, it’s essential to first create your AMI from a personalized occasion. For extra info, see Create an AMI within the Amazon EC2 Consumer Information for Linux Situations.
For Occasion sort, select a single occasion sort that is suitable with the AMI that you simply specified.
Alternatively, to launch an Auto Scaling group with a number of occasion sorts, select Superior, Specify occasion sort attributes, after which specify the next choices:
Variety of vCPUs: Enter the minimal and most variety of vCPUs. To point no limits, enter a minimal of 0, and preserve the utmost clean.
Quantity of reminiscence (MiB): Enter the minimal and most quantity of reminiscence, in MiB. To point no limits, enter a minimal of 0, and preserve the utmost clean.
Develop Non-compulsory occasion sort attributes and select Add attribute to additional restrict the sorts of situations that can be utilized to satisfy your required capability. For details about every attribute, see InstanceRequirementsRequest within the Amazon EC2 API Reference.
Ensuing occasion sorts: You’ll be able to view the occasion sorts that match the desired compute necessities, comparable to vCPUs, reminiscence, and storage.
To exclude occasion sorts, select Add attribute. From the Attribute record, select Excluded occasion sorts. From the Attribute worth record, choose the occasion sorts to exclude.
For extra info, see Create an Auto Scaling group utilizing attribute-based occasion sort choice.
Key pair (login): For Key pair identify, select an current key pair, or select Create new key pair to create a brand new one. For extra info, see Amazon EC2 key pairs and Linux situations within the Amazon EC2 Consumer Information for Linux Situations.
Community settings: For Firewall (safety teams), use a number of safety teams, or preserve this clean and configure a number of safety teams as a part of the community interface. For extra info, see Amazon EC2 safety teams for Linux situations within the Amazon EC2 Consumer Information for Linux Situations.
In the event you do not specify any safety teams in your launch template, Amazon EC2 makes use of the default safety group for the VPC that your Auto Scaling group will launch situations into. By default, this safety group does not enable inbound visitors from exterior networks. For extra info, see Default safety teams on your VPCs within the Amazon VPC Consumer Information.
Do one of many following:
Change the default community interface settings. For instance, you may allow or disable the general public IPv4 addressing function, which overrides the auto-assign public IPv4 addresses setting on the subnet. For extra info, see Change the default community interface settings.
Skip this step to maintain the default community interface settings.
Do one of many following:
Modify the storage configuration. For extra info, see Modify the storage configuration.
Skip this step to maintain the default storage configuration.
For Useful resource tags, specify tags by offering key and worth mixtures. In the event you specify occasion tags in your launch template and then you definitely select to propagate your Auto Scaling group’s tags to its situations, all of the tags are merged. If the identical tag key’s specified for a tag in your launch template and a tag in your Auto Scaling group, then the tag worth from the group takes priority.
(Non-compulsory) Configure superior settings. For extra info, see Configure superior settings on your launch template.
When you find yourself able to create the launch template, select Create launch template.
To create an Auto Scaling group, select Create Auto Scaling group from the affirmation web page.
Change the default community interface settings
This part reveals you the best way to change the default community interface settings. For instance, you may outline whether or not you wish to assign a public IPv4 deal with to every occasion as an alternative of defaulting to the auto-assign public IPv4 addresses setting on the subnet.
Concerns and limitations
When altering the default community interface settings, take into account the next issues and limitations:
You could configure the safety teams as a part of the community interface, not within the Safety teams part of the template. You can not specify safety teams in each locations.
You can not assign secondary personal IP addresses, referred to as secondary IP addresses, to a community interface.
In the event you specify an current community interface ID, you may launch just one occasion. To do that, it’s essential to use the AWS CLI or an SDK to create the Auto Scaling group. If you create the group, it’s essential to specify the Availability Zone, however not the subnet ID. Additionally, you may specify an current community interface provided that it has a tool index of 0.
You can not auto-assign a public IPv4 deal with should you specify a couple of community interface. You additionally can not specify duplicate system indexes throughout community interfaces. Each the first and secondary community interfaces reside in the identical subnet. For extra info, see Present community connectivity on your Auto Scaling situations utilizing Amazon VPC.
When an occasion launches, a personal deal with is mechanically allotted to every community interface. The deal with comes from the CIDR vary of the subnet during which the occasion is launched. For info on specifying CIDR blocks (or IP deal with ranges) on your VPC or subnet, see the Amazon VPC Consumer Information.
To vary the default community interface settings
Beneath Community settings, broaden Superior community configuration.
Select Add community interface to configure the first community interface, listening to the next fields:
Machine index: Preserve the default worth, 0, to use your modifications to the first community interface (eth0).
Community interface: Preserve the default worth, New interface, to have Amazon EC2 Auto Scaling mechanically create a brand new community interface when an occasion is launched. Alternatively, you may select an current, accessible community interface with a tool index of 0, however this limits your Auto Scaling group to 1 occasion.
Description: (Non-compulsory) Enter a descriptive identify.
Subnet: Preserve the default Do not embody in launch template setting.
If the AMI specifies a subnet for the community interface, this leads to an error. We suggest turning off Auto Scaling steering as a workaround. After you make this variation, you’ll not obtain an error message. Nonetheless, no matter the place the subnet is specified, the subnet settings of the Auto Scaling group take priority and can’t be overridden.
Auto-assign public IP: Change whether or not your community interface with a tool index of 0 receives a public IPv4 deal with. By default, situations in a default subnet obtain a public IPv4 deal with, whereas situations in a nondefault subnet don’t. Choose Allow or Disable to override the subnet’s default setting.
Safety teams: Select a number of safety teams for the community interface. Every safety group should be configured for the VPC that your Auto Scaling group will launch situations into. For extra info, see Amazon EC2 safety teams for Linux situations within the Amazon EC2 Consumer Information for Linux Situations.
Delete on termination: Select Sure to delete the community interface when the occasion is terminated, or select No to maintain the community interface.
Elastic Cloth Adapter: To assist excessive efficiency computing (HPC) use circumstances, change the community interface into an Elastic Cloth Adapter community interface. For extra info, see Elastic Cloth Adapter within the Amazon EC2 Consumer Information for Linux Situations.
Community card index: Select 0 to connect the first community interface to the community card with a tool index of 0. If this feature is not accessible, preserve the default worth, Do not embody in launch template. Attaching the community interface to a particular community card is out there just for supported occasion sorts. For extra info, see Community playing cards within the Amazon EC2 Consumer Information for Linux Situations.
So as to add a secondary community interface, select Add community interface.
Modify the storage configuration
You’ll be able to modify the storage configuration for situations launched from an Amazon EBS-backed AMI or an occasion store-backed AMI. You can even specify extra EBS volumes to connect to the situations. The AMI consists of a number of volumes of storage, together with the basis quantity (Quantity 1 (AMI Root)).
To change the storage configuration
In Configure storage, modify the scale or sort of quantity.
If the worth you specify for quantity dimension is outdoors the boundaries of the quantity sort, or smaller than the snapshot dimension, an error message is displayed. That will help you deal with the difficulty, this message offers the minimal or most worth that the sector can settle for.
Solely volumes related to an Amazon EBS-backed AMI seem. To show details about the storage configuration for an occasion launched from an occasion store-backed AMI, select Present particulars from the Occasion retailer volumes part.
To specify all EBS quantity parameters, change to the Superior view within the prime proper nook.
For superior choices, broaden the quantity that you simply wish to modify and configure the quantity as follows:
Storage sort: The kind of quantity (EBS or ephemeral) to affiliate along with your occasion. The occasion retailer (ephemeral) quantity sort is just accessible if you choose an occasion sort that helps it. For extra info, see Amazon EC2 occasion retailer and Amazon EBS volumes within the Amazon EC2 Consumer Information for Linux Situations.
Machine identify: Choose from the record of accessible system names for the quantity.
Snapshot: Choose the snapshot from which to create the quantity. You’ll be able to seek for accessible shared and public snapshots by coming into textual content into the Snapshot subject.
Dimension (GiB): For EBS volumes, you may specify a storage dimension. When you have chosen an AMI and occasion which are eligible for the free tier, understand that to remain throughout the free tier, it’s essential to keep underneath 30 GiB of whole storage. For extra info, see Constraints on the scale and configuration of an EBS quantity within the Amazon EC2 Consumer Information for Linux Situations.
Quantity sort: For EBS volumes, select the quantity sort. For extra info, see Amazon EBS quantity sorts within the Amazon EC2 Consumer Information for Linux Situations.
IOPS: When you have chosen a Provisioned IOPS SSD (io1 and io2) or Normal Objective SSD (gp3) quantity sort, then you may enter the variety of I/O operations per second (IOPS) that the quantity can assist. That is required for io1, io2, and gp3 volumes. It’s not supported for gp2, st1, sc1, or commonplace volumes.
Delete on termination: For EBS volumes, select Sure to delete the quantity when the occasion is terminated, or select No to maintain the quantity.
Encrypted: If the occasion sort helps EBS encryption, you may select Sure to allow encryption for the quantity. When you have enabled encryption by default on this Area, encryption is enabled for you. For extra info, see Amazon EBS encryption and Encryption by default within the Amazon EC2 Consumer Information for Linux Situations.
The default impact of setting this parameter varies with the selection of quantity supply, as described within the following desk. In all circumstances, it’s essential to have permission to make use of the desired AWS KMS key.
Encryption outcomes
If Encrypted parameter is about to… And if supply of quantity is… Then the default encryption state is… Notes
No New (empty) quantity Unencrypted* N/A
Unencrypted snapshot that you simply personal Unencrypted*
Encrypted snapshot that you simply personal Encrypted by identical key
Unencrypted snapshot that’s shared with you Unencrypted*
Encrypted snapshot that’s shared with you Encrypted by default KMS key
Sure New quantity Encrypted by default KMS key To make use of a non-default KMS key, specify a price for the KMS key parameter.
Unencrypted snapshot that you simply personal Encrypted by default KMS key
Encrypted snapshot that you simply personal Encrypted by identical key
Unencrypted snapshot that’s shared with you Encrypted by default KMS key
Encrypted snapshot that’s shared with you Encrypted by default KMS key
- If encryption by default is enabled, all newly created volumes (whether or not or not the Encrypted parameter is about to Sure) are encrypted utilizing the default KMS key. In the event you set each the Encrypted and KMS key parameters, then you may specify a non-default KMS key.
KMS key: In the event you selected Sure for Encrypted, then it’s essential to choose a buyer managed key to make use of to encrypt the quantity. When you have enabled encryption by default on this Area, the default buyer managed key’s chosen for you. You’ll be able to choose a special key or specify the ARN of any buyer managed key that you simply beforehand created utilizing the AWS Key Administration Service.
To specify extra volumes to connect to the situations launched by this launch template, select Add new quantity.
Configure superior settings on your launch template
You’ll be able to outline any extra capabilities that your Auto Scaling situations want. For instance, you may select an IAM function that your software can use when it accesses different AWS assets or specify the occasion person information that can be utilized to carry out widespread automated configuration duties after an occasion begins.
The next steps talk about probably the most helpful settings to concentrate to. For extra details about any of the settings underneath Superior particulars, see Making a launch template within the Amazon EC2 Consumer Information for Linux Situations.
To configure superior settings
For Superior particulars, broaden the part to view the fields.
For Buying choice, you may select Request Spot Situations to request Spot Situations on the Spot worth, capped on the On-Demand worth, and select Customise to alter the default Spot Occasion settings. For an Auto Scaling group, it’s essential to specify a one-time request with no finish date (the default). For extra info, see Request Spot Situations for fault-tolerant and versatile purposes.
Be aware
Amazon EC2 Auto Scaling helps you to override the occasion sort in your launch template to create an Auto Scaling group that makes use of a number of occasion sorts and launches Spot and On-Demand Situations. To take action, it’s essential to go away Buying choice unspecified in your launch template.
In the event you attempt to create a combined situations group utilizing a launch template with Buying choice specified, you get the next error.
Incompatible launch template: You can not use a launch template that’s set to request Spot Situations (InstanceMarketOptions) whenever you configure an Auto Scaling group with a combined situations coverage. Add a special launch template to the group and take a look at once more.
For details about creating combined situations teams, see Auto Scaling teams with a number of occasion sorts and buy choices.
For IAM occasion profile, you may specify an AWS Id and Entry Administration (IAM) occasion profile to affiliate with the situations. If you select an occasion profile, you affiliate the corresponding IAM function with the EC2 situations. For extra info, see IAM function for purposes that run on Amazon EC2 situations.
For Termination safety, select whether or not to guard situations from unintended termination. If you allow termination safety, it gives extra termination safety, but it surely doesn’t defend from Amazon EC2 Auto Scaling initiated termination. To regulate whether or not an Auto Scaling group can terminate a specific occasion, use Use occasion scale-in safety.
For Detailed CloudWatch monitoring, select whether or not to allow the situations to publish metric information at 1-minute intervals to Amazon CloudWatch. Extra prices apply. For extra info, see Configure monitoring for Auto Scaling situations.
For Elastic inference, select an elastic inference accelerator to connect to your EC2 CPU occasion. Extra prices apply. For extra info, see Working with Amazon Elastic Inference within the Amazon Elastic Inference Developer Information.
For T2/T3 Limitless, select whether or not to allow purposes to burst past the baseline for so long as wanted. This subject is just legitimate for T2, T3, and T3a situations. Extra prices might apply. For extra info, see Utilizing an Auto Scaling group to launch a burstable efficiency occasion as Limitless within the Amazon EC2 Consumer Information for Linux Situations.
For Placement group identify, you may specify a placement group during which to launch the situations. Not all occasion sorts may be launched in a placement group. In the event you configure an Auto Scaling group utilizing a CLI command that specifies a special placement group, the position group for the Auto Scaling group takes priority.
For Capability Reservation, you may specify whether or not to launch the situations into shared capability, any open Capability Reservation, a particular Capability Reservation, or a Capability Reservation group. For extra info, see Launching situations into an current capability reservation within the Amazon EC2 Consumer Information for Linux Situations.
For Tenancy, you may select to run your situations on shared {hardware} (Shared), on devoted {hardware} (Devoted), or when utilizing a number useful resource group, on Devoted Hosts (Devoted host). Extra prices might apply.
In the event you selected Devoted Hosts, full the next info:
For Tenancy host useful resource group, you may specify a number useful resource group for a BYOL AMI to make use of on Devoted Hosts. You wouldn’t have to have already allotted Devoted Hosts in your account earlier than you utilize this function. Your situations will mechanically launch onto Devoted Hosts regardless. Be aware that an AMI based mostly on a license configuration affiliation may be mapped to just one host useful resource group at a time. For extra info, see Host useful resource teams within the AWS License Supervisor Consumer Information.
For License configurations, specify the license configuration to make use of. You’ll be able to launch situations in opposition to the desired license configuration to trace your license utilization. For extra info, see Create a license configuration within the License Supervisor Consumer Information.
To configure occasion metadata choices for the entire situations which are related to this model of the launch template, do the next:
For Metadata accessible, select whether or not to allow or disable entry to the HTTP endpoint of the occasion metadata service. By default, the HTTP endpoint is enabled. In the event you select to disable the endpoint, entry to your occasion metadata is turned off. You’ll be able to specify the situation to require IMDSv2 solely when the HTTP endpoint is enabled.
For Metadata model, you may select to require the usage of Occasion Metadata Service Model 2 (IMDSv2) when requesting occasion metadata. If you don’t specify a price, the default is to assist each IMDSv1 and IMDSv2.
For Metadata token response hop restrict, you may set the allowable variety of community hops for the metadata token. If you don’t specify a price, the default is 1.
For extra info, see Configuring the occasion metadata service within the Amazon EC2 Consumer Information for Linux Situations.
For Consumer information, you may add shell scripts and cloud-init directives to customise an occasion at launch. For extra info, see Run instructions in your Linux occasion at launch within the Amazon EC2 Consumer Information for Linux Situations.
Be aware
Working scripts at launch provides to the period of time it takes for an occasion to be prepared to be used. Nonetheless, you may enable further time for the scripts to finish earlier than the occasion enters the InService state by including a lifecycle hook to the Auto Scaling group. For extra info, see Amazon EC2 Auto Scaling lifecycle hooks.
Select Create launch template.
To create an Auto Scaling group, select Create Auto Scaling group from the affirmation web page.
Create a launch template from an current occasion (console)
To create a launch template from an current occasion
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
On the navigation pane, underneath Situations, select Situations.
Choose the occasion and select Actions, Picture and templates, Create template from occasion.
Present a reputation and outline.
Beneath Auto Scaling steering, choose the test field.
Alter any settings as required, and select Create launch template.
To create an Auto Scaling group, select Create Auto Scaling group from the affirmation web page.