Skip to content

Commit 118697a

Browse files
security fixes
1 parent 0cc9d46 commit 118697a

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

cloudwatch.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
resource "aws_cloudwatch_log_group" "fargate_cluster" {
66
name = var.log_group
77
retention_in_days = var.log_retention_days
8+
kms_key_id = aws_kms_key.fargate.key_id
89
}
910

1011

@@ -13,4 +14,9 @@ resource "aws_cloudwatch_log_group" "fargate_execute_command_logs" {
1314

1415
name = "${var.log_group}-execute-commands"
1516
retention_in_days = var.log_retention_days
17+
kms_key_id = aws_kms_key.fargate.key_id
1618
}
19+
20+
resource "aws_kms_key" "fargate" {
21+
description = "cloudwatch-encrpytion"
22+
}

ecs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
resource "aws_ecs_cluster" "fargate_cluster" {
66
name = var.cluster_name
77

8+
setting {
9+
name = "containerInsights"
10+
value = "enabled"
11+
}
12+
813
dynamic "configuration" {
914
for_each = var.enable_execute_command ? [""] : []
1015
content {

vars.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ variable "execution_role_policy" {
1111
}
1212

1313
variable "log_retention_days" {
14-
default = 0
14+
default = 14
1515
}
1616

1717
variable "enable_execute_command" {

0 commit comments

Comments
 (0)