機器建好了;也在上面安裝好了AWS ECS, Docker等工具,並將這些工具正常運行後,只需要再創建一個ECS Service來產生一個Docker Container並透過ECS掛在我們的這台Service上執行:
ECS → Clusters → trade-cluster → Services → Create
Compute options / Launch type:選 EC2
Application type:Service
Task definition:選剛建的 hello-web:1
(或最新版)
Desired tasks:1
設定同一個時間最多跑一個service (100%)
其他選項維持預設(EC2 模式下網路由主機承擔,這裡不選 SG)→ Create Service。
回到 Service 頁面,等到 Running instances = 1。
輸入http://PUBLICIP:8080 就可以看到Hello Web可以被看到了。