diff --git a/content/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/create_lt.md b/content/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/create_lt.md index 3e0de240..bde2f4b2 100644 --- a/content/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/create_lt.md +++ b/content/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/create_lt.md @@ -17,7 +17,7 @@ It's recommended that you create Auto Scaling groups from launch templates to en ```bash # First, this command looks up the latest Amazon Linux 2 AMI - export ami_id=$(aws ec2 describe-images --owners amazon --filters 'Name=name,Values=amzn2-ami-hvm-2.0.????????-x86_64-gp2' 'Name=state,Values=available' --output json | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId') + export ami_id=$(aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-kernel*gp2" "Name=virtualization-type,Values=hvm" "Name=root-device-type,Values=ebs" --query "sort_by(Images, &CreationDate)[-1].ImageId" --output text) sed -i.bak -e "s#%instanceProfile%#$instanceProfile#g" -e "s/%instanceSecurityGroup%/$instanceSecurityGroup/g" -e "s#%ami-id%#$ami_id#g" -e "s#%UserData%#$(cat user-data.txt | base64 --wrap=0)#g" launch-template-data.json @@ -44,4 +44,4 @@ It's recommended that you create Auto Scaling groups from launch templates to en ``` aws ec2 describe-launch-template-versions --launch-template-name myEC2Workshop --output json | jq -r '.LaunchTemplateVersions[].LaunchTemplateData.UserData' | base64 --decode - ``` \ No newline at end of file + ```