π AWS EC2 Auto Scaling Group uses Launch Configuration instead of Launch Template π’
- Contextual name: π Auto Scaling Group uses Launch Configuration instead of Launch Template π’
- ID:
/ce/ca/aws/autoscaling/group-uses-launch-configuration
- Located in: π AWS Auto Scaling
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
RELIABILITY
Similar Policiesβ
- AWS Security Hub
- [[AutoScaling.9] Amazon EC2 Auto Scaling groups should use Amazon EC2 launch templates]([AutoScaling.9] Amazon EC2 Auto Scaling groups should use Amazon EC2 launch templates (https://docs.aws.amazon.com/securityhub/latest/userguide/autoscaling-controls.html#autoscaling-9)]
- Internal
dec-x-b49c2465
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-b49c2465 | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
This policy checks whether an AWS EC2 Auto Scaling Group is configured to use no longer supported Launch Configurations. AWS does not release new EC2 features to Launch Configurations and strongly recommends migrating to Launch Templates.
Launch Templates are a newer mechanism for EC2 instance provisioning, providing support for all current and future EC2 features, as well as integrated version control and heterogeneous instance type support.
Rationaleβ
AWS is phasing out support for Launch Configurations. They no longer receive updates for new EC2 instance types or platform enhancements. Using Launch Templates provides several key benefits:
- Launch Templates unlock new EC2 capabilities, including: Systems Manager parameters, the current generation of EBS Provisioned IOPS volumes (io2), EBS volume tagging, T2 Unlimited instances, Capacity Reservations, Capacity Blocks, Dedicated Hosts, etc.
- Version management, which simplifies testing of new configurations and rollbacks to previous versions.
- Launch Templates allow you to provision both On-Demand and Spot Instances within the same Auto Scaling group and define multiple instance types.
... see more
Remediationβ
Remediationβ
Follow these steps to migrate an Auto Scaling Group from a legacy Launch Configuration to a Launch Template.
From Command Lineβ
Export the Existing Launch Configurationβ
aws autoscaling describe-launch-configurations \
--launch-configuration-names {{launch-configuration-name}} \
--query 'LaunchConfigurations[0]' \
--output json > {{lc-export.json}}Note: Modify the JSON schema to match the Launch TempTemplate since the configuration object includes extra fields that EC2βs
create-launch-template
will reject, and some keys need renaming.Create the Launch Templateβ
aws ec2 create-launch-template \
--launch-template-name {{launch-template-name}} \
--version-description {{version-description}} \
--launch-template-data file://{{lc-export.json}}Update the Auto Scaling Group to Use the Launch Templateβ
aws autoscaling update-auto-scaling-group \
--auto-scaling-group-name {{asg-name}} \
--launch-template LaunchTemplateId={{launch-template-id}},Version='$Latest'
... [see more](remediation.md)