Auto Scaling 지침 허용 및 Amazon Linux2 / t3.small 선택

Screenshot 2025-01-04 at 20-49-09 시작 템플릿 생성 EC2 ap-northeast-2.png

보안그룹 생성 - 인바운드에 Bastion 서버 선택

Screenshot 2025-01-04 at 20-50-10 시작 템플릿 생성 EC2 ap-northeast-2.png

IAM Role 선택 - S3FullAccess 권한을 가진 Role

Screenshot 2025-01-04 at 20-51-36 시작 템플릿 생성 EC2 ap-northeast-2.png

User Data 입력

#!/bin/bash

exec > >(sudo tee /var/log/user-data.log | sudo sh -c 'logger -t user-data -s 2>/dev/console') 2>&1

yum update -y

yum install httpd -y

service httpd start

chkconfig httpd on

cd /var/www/html

aws s3 cp s3://skills-wlstmd/web/v1.tar . # 버킷에 맞게 변경

tar -xvf v1.tar

rm v1.tar

mv v1/* ./