Getting Started with AWS EC2:

Launching and Managing Virtual Machines.

Getting Started with AWS EC2:

Instance Types in AWS:

Amazon EC2 has a large number of instance types that are optimized for different uses. The different combinations of CPU, memory, storage and networking capacity in instance types give you the freedom to choose the right mix of resources for your apps. Each instance type comes with one or more instance sizes, so you can adjust your resources to meet the needs of the workload you want to run.

Read from here

AMI in AWS:

An Amazon Machine Image (AMI) is an image that AWS supports and keeps up to date. It contains the information needed to start an instance. When you launch an instance, you must choose an AMI. When you need multiple instances with the same configuration, you can launch them from a single AMI.

Create your launch template:

To create a launch template
  • Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  • On the navigation pane, under Instances, choose Launch Templates.

  • Choose Create launch template. Enter a name and provide a description for the initial version of the launch template.

  • (Optional) Under Auto Scaling guidance, select the check box to have Amazon EC2 provide guidance to help create a template to use with Amazon EC2 Auto Scaling.

  • Under Launch template contents, fill out each required field and any optional fields as needed.

  • Application and OS Images (Amazon Machine Image): (Required) Choose the ID of the AMI for your instances. You can search through all available AMIs, or select an AMI from the Recents or Quick Start list. If you don't see the AMI that you need, choose Browse more AMIs to browse the full AMI catalog.

    • To choose a custom AMI, you must first create your AMI from a customized instance. For more information, see Create an AMI in the Amazon EC2 User Guide for Linux Instances.

    • For Instance type, choose a single instance type that's compatible with the AMI that you specified.

      Alternatively, to launch an Auto Scaling group with multiple instance types, choose Advanced, Specify instance type attributes, and then specify the following options:

      • Number of vCPUs: Enter the minimum and maximum number of vCPUs. To indicate no limits, enter a minimum of 0, and keep the maximum blank.

      • Amount of memory (MiB): Enter the minimum and maximum amount of memory, in MiB. To indicate no limits, enter a minimum of 0, and keep the maximum blank.

      • Expand Optional instance type attributes and choose Add attribute to further limit the types of instances that can be used to fulfill your desired capacity. For information about each attribute, see InstanceRequirementsRequest in the Amazon EC2 API Reference.

      • Resulting instance types: You can view the instance types that match the specified compute requirements, such as vCPUs, memory, and storage.

      • To exclude instance types, choose Add attribute. From the Attribute list, choose Excluded instance types. From the Attribute value list, select the instance types to exclude.

For more information, see Create an Auto Scaling group using attribute-based instance type selection.

  • Key pair (login): For Key pair name, choose an existing key pair, or choose Create new key pair to create a new one. For more information, see Amazon EC2 key pairs and Linux instances in the Amazon EC2 User Guide for Linux Instances.

  • Network settings: For Firewall (security groups), use one or more security groups, or keep this blank and configure one or more security groups as part of the network interface. For more information, see Amazon EC2 security groups for Linux instances in the Amazon EC2 User Guide for Linux Instances.

    If you don't specify any security groups in your launch template, Amazon EC2 uses the default security group for the VPC that your Auto Scaling group will launch instances into. By default, this security group doesn't allow inbound traffic from external networks. For more information, see Default security groups for your VPCs in the Amazon VPC User Guide.

  • Do one of the following:

    • Change the default network interface settings. For example, you can enable or disable the public IPv4 addressing feature, which overrides the auto-assign public IPv4 addresses setting on the subnet. For more information, see Change the default network interface settings.

    • Skip this step to keep the default network interface settings.

  • Do one of the following:

  • For Resource tags, specify tags by providing key and value combinations. If you specify instance tags in your launch template and then you choose to propagate your Auto Scaling group's tags to its instances, all the tags are merged. If the same tag key is specified for a tag in your launch template and a tag in your Auto Scaling group, then the tag value from the group takes precedence.

  • (Optional) Configure advanced settings. For more information, see Configure advanced settings for your launch template.

  • When you are ready to create the launch template, choose Create launch template.

  • To create an Auto Scaling group, choose Create Auto Scaling group from the confirmation page.