diff --git a/ecs.tf b/ecs.tf index 1e446bd..cb2e785 100644 --- a/ecs.tf +++ b/ecs.tf @@ -1,9 +1,47 @@ +resource "aws_kms_key" "example" { + description = "example" + deletion_window_in_days = 7 +} + +resource "aws_cloudwatch_log_group" "example" { + name = "example" +} + +resource "aws_ecs_cluster" "test" { + name = "example" + + configuration { + execute_command_configuration { + kms_key_id = aws_kms_key.example.arn + logging = "OVERRIDE" + + log_configuration { + cloud_watch_encryption_enabled = true + cloud_watch_log_group_name = aws_cloudwatch_log_group.example.name + } + } + } +} + resource "aws_ecs_task_definition" "service" { family = "service" container_definitions = jsonencode([ + { + name = "first" + image = "nginx" + cpu = 10 + memory = 512 + essential = true + portMappings = [ + { + containerPort = 80 + hostPort = 80 + } + ] + }, { name = "second" - image = "node:4.8.1-slim" + image = "python:3.9-alpine" cpu = 10 memory = 256 essential = true