Skip to content

Commit

Permalink
2118 au 05 audit process migrate logs to s3 buckets (#2197)
Browse files Browse the repository at this point in the history
* Add logstream wildcard to cloudwatch group arn
* Refactor cloudtrail to deliver logs to separate buckets for prod and staging
  • Loading branch information
Matthew-Grayson authored Aug 25, 2023
1 parent 3380a25 commit c15096b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions infrastructure/cloudtrail.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

resource "aws_cloudwatch_log_group" "all" {
name = var.logging_bucket_name
resource "aws_cloudwatch_log_group" "cloudtrail" {
name = "crossfeed-${var.stage}-cloudtrail-logs"
retention_in_days = 3653
kms_key_id = aws_kms_key.key.arn
tags = {
Expand All @@ -13,7 +13,7 @@ resource "aws_cloudtrail" "all-events" {
name = "all-events"
s3_bucket_name = var.logging_bucket_name
cloud_watch_logs_role_arn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${var.logging_bucket_name}-cloudtrail-role"
cloud_watch_logs_group_arn = aws_cloudwatch_log_group.all.arn
cloud_watch_logs_group_arn = "${aws_cloudwatch_log_group.cloudtrail.arn}:*"
tags = {
Project = var.project
Stage = var.stage
Expand Down

0 comments on commit c15096b

Please sign in to comment.