Skip to content

Commit 6dbea64

Browse files
committed
CCM-11586: centralised bucket logging, define a bucket
1 parent e29e8cc commit 6dbea64

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "aws_s3_bucket" "logging" {
2+
bucket = "${local.csi_s3}-bucket-logs"
3+
tags = merge(local.default_tags, { "Enable-Backup" = var.enable_backups }, { "Enable-S3-Continuous-Backup" = var.enable_backups }, { "SKIP_S3_AUDIT" = "true" })
4+
}
5+
6+
resource "aws_s3_bucket_logging" "truststore" {
7+
bucket = aws_s3_bucket.truststore.id
8+
9+
target_bucket = aws_s3_bucket.logging.bucket
10+
target_prefix = "truststore/${aws_s3_bucket.truststore.bucket}/"
11+
}

infrastructure/terraform/components/api/s3_bucket_truststore.tf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ resource "aws_s3_bucket_public_access_block" "truststore" {
4444
restrict_public_buckets = true
4545
}
4646

47-
resource "aws_s3_bucket_logging" "truststore" {
48-
bucket = aws_s3_bucket.truststore.id
49-
50-
target_bucket = "${local.csi_s3}-bucket-logs"
51-
target_prefix = "truststore/${aws_s3_bucket.truststore.bucket}/"
52-
}
53-
5447
# In manually configured (e.g. dev main, nonprod main, prod main) add lifecycle policy to permit manual management of cert
5548
resource "aws_s3_object" "placeholder_truststore" {
5649
count = var.manually_configure_mtls_truststore ? 1 : 0

0 commit comments

Comments
 (0)