Skip to content

Commit

Permalink
feat: removed deprecated arguments and updated accoroding to aws 5.0 …
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
anmolnagpal committed Jul 4, 2023
1 parent 5bec5b8 commit f2762ae
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,13 @@ resource "aws_wafv2_web_acl" "main" {
name = lookup(managed_rule_group_statement.value, "name")
vendor_name = lookup(managed_rule_group_statement.value, "vendor_name", "AWS")

dynamic "excluded_rule" {
for_each = length(lookup(managed_rule_group_statement.value, "excluded_rule", {})) == 0 ? [] : toset(lookup(managed_rule_group_statement.value, "excluded_rule"))
dynamic "rule_action_override" {
for_each = length(lookup(managed_rule_group_statement.value, "rule_action_override", {})) == 0 ? [] : toset(lookup(managed_rule_group_statement.value, "rule_action_override"))
content {
name = excluded_rule.value
name = rule_action_override.value
action_to_use {
count {}
}
}
}

Expand Down Expand Up @@ -1018,15 +1021,15 @@ resource "aws_s3_bucket" "webacl_traffic_information" {
count = var.waf_enabled && var.create_logging_configuration ? 1 : 0

bucket = format("%s-waf-logs", module.labels.id)
tags = module.labels.tags
tags = module.labels.tags
}
resource "aws_s3_bucket_acl" "webacl_traffic_information" {
count = var.waf_enabled && var.create_logging_configuration ? 1 : 0

bucket = join("", aws_s3_bucket.webacl_traffic_information.*.id)
acl = "private"
}
resource "aws_s3_bucket_versioning" "webacl_traffic_information" {
resource "aws_s3_bucket_versioning" "webacl_traffic_information" {
count = var.waf_enabled && var.create_logging_configuration ? 1 : 0

bucket = join("", aws_s3_bucket.webacl_traffic_information.*.id)
Expand All @@ -1038,11 +1041,11 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "webacl_traffic_in
count = var.waf_enabled && var.create_logging_configuration ? 1 : 0

bucket = join("", aws_s3_bucket.webacl_traffic_information.*.id)
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}

# AWS Glue Catalog Database. This resource is needed by Amazon Kinesis Firehose as data format conversion configuration, for transforming from JSON to Parquet.
Expand Down Expand Up @@ -1305,8 +1308,8 @@ resource "aws_kinesis_firehose_delivery_stream" "waf" {
role_arn = join("", aws_iam_role.firehose.*.arn)
bucket_arn = join("", aws_s3_bucket.webacl_traffic_information.*.arn)

buffer_size = var.firehose_buffer_size
buffer_interval = var.firehose_buffer_interval
buffering_size = var.firehose_buffer_size
buffering_interval = var.firehose_buffer_interval

prefix = "logs/year=!{timestamp:yyyy}/month=!{timestamp:MM}/day=!{timestamp:dd}/hour=!{timestamp:HH}/"
error_output_prefix = "errors/year=!{timestamp:yyyy}/month=!{timestamp:MM}/day=!{timestamp:dd}/hour=!{timestamp:HH}/!{firehose:error-output-type}"
Expand Down Expand Up @@ -1366,12 +1369,12 @@ resource "aws_wafv2_web_acl_logging_configuration" "main" {
}
}

dynamic "single_query_argument" {
for_each = length(lookup(redacted_fields.value, "single_query_argument", {})) == 0 ? [] : [lookup(redacted_fields.value, "single_query_argument", {})]
content {
name = lookup(single_query_argument.value, "name", null)
}
}
# dynamic "single_query_argument" {
# for_each = length(lookup(redacted_fields.value, "single_query_argument", {})) == 0 ? [] : [lookup(redacted_fields.value, "single_query_argument", {})]
# content {
# name = lookup(single_query_argument.value, "name", null)
# }
# }
}
}

Expand Down

0 comments on commit f2762ae

Please sign in to comment.