본문 바로가기
AWS/개요

Security Groups, Bootstrap Scripts

by 계영수 2023. 7. 28.
728x90

▶ Security Groups

Security groups are virtual firewalls for your EC2 instance. By default, everything is blocked.

 

▶ Bootstrap Scripts

A script that runs when the instance first runs.

#!/bin/bash
yum install httpd -y
#installs apache
yum service httpd start
#starts apache

Adding these tasks at boot time adds to the amount of time it takes to boot the instance.

However, it allows you to automate the installation of applications.

▶ Demo

#!/bin/bash
yum update -y
yum install httpd -y
service httpd start
cd /var/www/html
echo "<html><body><h1>Hello MyLearn Students</h1></body></html>" > index.html

인스턴스 생성 - Advanced details

▶ Security Groups Exam Tips

- Tip1: Changes to security groups take effect immediately.

- Tip2: You can have any number of EC2 instances within a security group.

- Tip3: You can have multiple security groups attached to EC2 instances.

- Tip4: All inbound traffic is blocked by default.

- Tip5: All outbound traffic is allowed.

 

▶ Bootstrap Scripts

A bootstrap script is a script that runs when the instance first runs. It passes user data to the EC2 instance and can be used to install applications (like web server and databases), as well as do updates and more.

728x90

'AWS > 개요' 카테고리의 다른 글

EC2 Placement Groups  (0) 2023.07.28
Networking with EC2  (0) 2023.07.28
Using Roles  (0) 2023.07.27
EC2 SSH 접속, AWS CLI  (0) 2023.07.27
Region, Availability Zone,  (0) 2023.05.30