AWS Launch Template exercise
AWS launch template for an apache website
Daily AWS:
CloudTrail vs CloudWatch vs AWS Config?
How to create Launch Template:
- In EC2 dashboard, click "Launch Templates"
- Click the Create Launch Template button
- Give launch template name
- Click search for image and pick Ubuntu Server AMIs. (MAKE SURE ITS 64 bit x86 and NOT 64 bit ARM)
- (although ARM seems interesting for AI workloads)
- For instance type, let's always pick smallest to avoid those aws fees
- Under network setting, select security group that allows inbound HTTP access. Make sure you use least privilege security principles.
- Expand the Advanced Details section, go to the User Data field by scrolling down. and write this to launch your first apache website:
#!/bin/bash
apt-get update
apt-get install -y apache2
echo "Welcome to RICHARD'S WEBSITE" > index.html
cp index.html /var/www/html
- Click Launch TEmplate button
- Click the Launch Instance From This Template link
- Under Source Template Version, select 1 (Default).
- Click the Launch INstance from Template button.
- After the instance boots, browse to its public IP. Now you can see "Welcom to RICHARD'S WEBSITE"
- Terminate the instance when you're done (unless you hate money)