generated at
ECSのタスク定義
from ECS


コンテナの実行に必要な設定を定義する
例えば、
使用するイメージ
必要なCPUやメモリの量
ポートマッピング
環境変数
ボリューム
など



tf
resource "aws_ecs_task_definition" "example" { family = "example" # A unique name for your task definition. cpu = "256" memory = "512" network_mode = "awsvpc" requires_compatibilities = ["FARGATE"] execution_role_arn = aws_iam_role.example.arn container_definitions = jsonencode([ { name = "example-container" image = "nginx" cpu = 256 memory = 512 essential = true portMappings = [ { containerPort = 80 hostPort = 80 protocol = "tcp" }, ] }, ]) }
HCLをJSONにencodeする関数
良くも悪くも割と雑に書いても動くっぽい