From f4c421fde6ce4e227fcf254e8843b2c370591a56 Mon Sep 17 00:00:00 2001 From: try-panwiac <93744932+try-panwiac@users.noreply.github.com> Date: Sun, 20 Nov 2022 22:40:24 -0800 Subject: [PATCH] Update ecs.tf --- ecs.tf | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) 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