Creates an ECS cluster with enhanced logging using AWS KMS and CloudWatch.

Terraform Template

resource "aws_cloudwatch_log_group" "example" {
  name = "example"
}

resource "aws_ecs_cluster" "test" {

  configuration {

    execute_command_configuration {
      kms_key_id = aws_kms_key.example.arn

      log_configuration {
        cloud_watch_encryption_enabled = true
        cloud_watch_log_group_name = aws_cloudwatch_log_group.example.name
      }
      logging = "OVERRIDE"
    }
  }
  name = "example"
}

resource "aws_kms_key" "example" {
  deletion_window_in_days = 7
  description = "example"
}