0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

16日目:AWS無料枠使い倒し「ECSでコンテナ作成」

0
Last updated at Posted at 2025-12-15

ECSでコンテナを動かしてみる

予定コスト: $0.00(作成のみ)


✅ この記事でやること

Fargateタスク定義登録まで。起動は短時間検証を想定。


✅ 前提(準備)

VPC/サブネット/SG、IAM権限。


クラスター作成

最小クラスターを作成。

aws ecs create-cluster --cluster-name demo

タスク定義(最小)

Nginxタスク定義を登録。

cat > task.json <<'JSON'
{
  "family": "demo-task",
  "networkMode": "awsvpc",
  "requiresCompatibilities": ["FARGATE"],
  "cpu": "256",
  "memory": "512",
  "containerDefinitions": [{
    "name": "nginx",
    "image": "nginx:alpine",
    "essential": true,
    "portMappings": [{"containerPort": 80, "protocol": "tcp"}]
  }]
}
JSON
aws ecs register-task-definition --cli-input-json file://task.json

💡 豆知識 (Tips)

  • 常時稼働は無料枠外になりがち→短時間検証
  • CloudWatch Logs連携でログを確認

⚠️ 落とし穴

  • タスクのCPU/メモリ過大で無駄なコスト
  • パブリックIP不要時の誤設定

🧾 今日のコスト

$0.00(登録のみ)


✅ まとめ

  • 本日のゴールを確認
  • 無料枠を意識して運用
  • 次回に繋がるポイントを整理

✅ 次回予告(17日目)

「AWS Backupでデータ保護を自動化」

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?