Skip to content

Commit a0706b0

Browse files
committed
fix(iac): Suppress SonarQube false positives for S3 logging and HTTPS policies
1 parent bca75ce commit a0706b0

File tree

1 file changed

+3
-3
lines changed
  • Terraform/modules/01-Network

1 file changed

+3
-3
lines changed

Terraform/modules/01-Network/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ data "aws_caller_identity" "current" {}
144144
# This is the primary bucket where the ALB will store its access logs.
145145
# Only create this bucket if logging is enabled
146146

147-
resource "aws_s3_bucket" "alb_access_logs" {
147+
resource "aws_s3_bucket" "alb_access_logs" { #NOSONAR
148148
count = var.enable_alb_access_logs ? 1 : 0
149149
bucket = var.alb_access_logs_bucket_name != "" ? var.alb_access_logs_bucket_name : "${var.project_prefix}-${var.environment}-alb-access-logs-${data.aws_caller_identity.current.account_id}"
150150

@@ -167,7 +167,7 @@ resource "aws_s3_bucket_public_access_block" "alb_access_logs" {
167167
}
168168

169169
# This is a SECOND bucket, used to store the access logs FOR the first bucket.
170-
resource "aws_s3_bucket" "s3_server_access_logs" {
170+
resource "aws_s3_bucket" "s3_server_access_logs" { #NOSONAR
171171
count = var.enable_alb_access_logs ? 1 : 0
172172

173173
bucket = "${var.project_prefix}-${var.environment}-s3-access-logs-${data.aws_caller_identity.current.account_id}"
@@ -481,7 +481,7 @@ resource "aws_lb" "main" {
481481
enable_deletion_protection = var.environment == "prod" ? true : false
482482

483483
# Proper conditional for access_logs block
484-
dynamic "access_logs" {
484+
dynamic "access_logs" { #NOSONAR
485485
for_each = var.enable_alb_access_logs ? [1] : []
486486
content {
487487
bucket = aws_s3_bucket.alb_access_logs[0].bucket

0 commit comments

Comments
 (0)