---
# System prepended metadata

title: Virtual Private Cloud (VPC)

---

# Virtual Private Cloud (VPC)

### 建立一個新的 VPC
![Screenshot 2025-02-13 at 1.09.49 PM](https://hackmd.io/_uploads/S1BhCgsK1l.png)

![Screenshot 2025-02-13 at 11.46.02 AM](https://hackmd.io/_uploads/ByJfi1sY1l.png)

![Screenshot 2025-02-13 at 11.47.17 AM](https://hackmd.io/_uploads/BJNPi1iFkg.png)

![Screenshot 2025-02-13 at 11.48.26 AM](https://hackmd.io/_uploads/H1JjskjYyl.png)

![Screenshot 2025-02-13 at 12.56.21 PM](https://hackmd.io/_uploads/BJjYoljKJx.png)


![Screenshot 2025-02-13 at 1.05.57 PM](https://hackmd.io/_uploads/HyVapgjFke.png)

### 建立一個安全組

![Screenshot 2025-02-13 at 1.22.12 PM](https://hackmd.io/_uploads/Bk6jWWsFJe.png)

注意 VPC 要選擇剛剛新建立的 VPC，名字不可以是 sg 開頭（圖錯誤）
![Screenshot 2025-02-13 at 1.23.14 PM](https://hackmd.io/_uploads/BkyyMZoYkx.png)

按照下方圖設定，傳入規則選擇：所有 ICMP-IPv4，來源 隨處。傳出規則：所有流量，目的地 0.0.0.0/0 。完成之後按建立
![Screenshot 2025-02-13 at 1.24.52 PM](https://hackmd.io/_uploads/S1uUGWjFyx.png)



### 創建一個 IAM role

進到 IAM 控制台，左邊找到角色，點選後右上角點選建立角色
![Screenshot 2025-02-13 at 1.11.22 PM](https://hackmd.io/_uploads/H1SIJ-iFyl.png)

選擇 AWS 服務， 選擇 EC2
![Screenshot 2025-02-13 at 1.12.00 PM](https://hackmd.io/_uploads/ByaskWiKkx.png)

許可政策列表中，分別搜尋 `AmazonEC2RoleforSSM
` 和 `AmazonS3ReadOnlyAccess` ，每找到一個就勾選起來，最後確認是兩個被選取到，之後選擇下一步
![Screenshot 2025-02-13 at 1.15.35 PM](https://hackmd.io/_uploads/S1c5e-oKJx.png)

![Screenshot 2025-02-13 at 1.16.03 PM](https://hackmd.io/_uploads/SkxigWjFJe.png)

給予 IAM 角色一個可識別的名字，例如 `EC2-IAM-Role`
![Screenshot 2025-02-13 at 1.19.10 PM](https://hackmd.io/_uploads/r1lbZ-jtyl.png)



### 創建一個 EC2

請點選右上角 啟動新執行個體
![Screenshot 2025-02-13 at 12.55.35 PM](https://hackmd.io/_uploads/ByRJRxiFkl.png)

![Screenshot 2025-02-13 at 1.08.05 PM](https://hackmd.io/_uploads/B1waAlit1e.png)

網路設定下，記得要切換 VPC 到剛創建的 VPC，選取剛建立的安全組，
![Screenshot 2025-02-13 at 1.29.17 PM](https://hackmd.io/_uploads/H1xD7-sFkx.png)

金鑰對，先選擇不使用
![Screenshot 2025-02-13 at 1.32.27 PM](https://hackmd.io/_uploads/S1tb4biYyx.png)

進階設定，選擇剛建立的 IAM role
![Screenshot 2025-02-13 at 1.31.29 PM](https://hackmd.io/_uploads/rJ4T7-otJe.png)

確認無誤後，點選右邊的啟動執行個體
![Screenshot 2025-02-13 at 1.33.34 PM](https://hackmd.io/_uploads/SknHNboKkl.png)
