Skip to content

Commit

Permalink
added log delivery to elasticache
Browse files Browse the repository at this point in the history
  • Loading branch information
kunduso committed Nov 10, 2023
1 parent c7b3bda commit b7020c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloudwatch.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
resource "aws_cloudwatch_log_group" "slow_log" {

Check failure on line 1 in cloudwatch.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_338: "Ensure CloudWatch log groups retains logs for at least 1 year"

Check failure on line 1 in cloudwatch.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_158: "Ensure that CloudWatch Log Group is encrypted by KMS"
name = "/elasticache/${aws_elasticache_replication_group.app4.replication_group_id}/slow-log"
name = "/elasticache/${aws_elasticache_replication_group.app4.replication_group_id}/slow-log"
retention_in_days = 30
}
resource "aws_cloudwatch_log_group" "engine_log" {

Check failure on line 5 in cloudwatch.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_338: "Ensure CloudWatch log groups retains logs for at least 1 year"

Check failure on line 5 in cloudwatch.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_158: "Ensure that CloudWatch Log Group is encrypted by KMS"
name = "/elasticache/${aws_elasticache_replication_group.app4.replication_group_id}/engine-log"
name = "/elasticache/${aws_elasticache_replication_group.app4.replication_group_id}/engine-log"
retention_in_days = 30
}
12 changes: 12 additions & 0 deletions elasticache.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ resource "aws_elasticache_replication_group" "app4" {
transit_encryption_enabled = true
auth_token = aws_secretsmanager_secret_version.auth.secret_string
security_group_ids = [aws_security_group.elasticache.id]
log_delivery_configuration {
destination = aws_cloudwatch_log_group.slow_log.name
destination_type = cloudwatch-logs
log_format = json
log_type = slow-log
}
log_delivery_configuration {
destination = aws_cloudwatch_log_group.engine_log.name
destination_type = cloudwatch-logs
log_format = json
log_type = engine-log
}
lifecycle {
ignore_changes = [kms_key_id]
}
Expand Down

0 comments on commit b7020c0

Please sign in to comment.