AWS Day 2 - 0113
AWS Day 2 - 0113
목차
1. VPC 생성
(VPC creation details here...)
2. EC2 Instance Setup
We configure EC2 instances in both Public and Private subnets with specific roles.
Architecture Overview
| Subnet | Instance Role | Software Stack | User Data Script |
|---|---|---|---|
| Public Subnet | Web Server / DB Client | Nginx, MySQL Client | public_ec2_userdata.sh |
| Private Subnet | Database Server | MySQL Server | private_ec2_userdata.sh |
Installation Scripts
The following scripts are used to bootstrap the EC2 instances.
Public EC2 (Nginx + MySQL Client)
Installs Nginx web server and MySQL client tools to connect to the private database.
#!/bin/bash
yum update -y
yum install -y nginx
systemctl start nginx
systemctl enable nginx
yum install -y mariadb105 || yum install -y mysql
Private EC2 (MySQL Server)
Installs MySQL Server to handle database operations.
#!/bin/bash
yum update -y
yum install -y mariadb105-server || yum install -y mysql-server
systemctl start mysqld
systemctl enable mysqld