Skip to content

Commit

Permalink
Update example and fix example config (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcincuber authored Jun 26, 2020
1 parent 8203a9f commit 35c9682
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ default_action {
```
This problem is tracked -> https://discuss.hashicorp.com/t/conditional-block-or-allow-variable-for-wafv2-resource-when-using-override-action-or-default-action/10162

2. New issue with logging configuration is reported and can be tracked -> https://github.com/terraform-providers/terraform-provider-aws/issues/13955
## Logging configuration

When you enable logging configuration for WAFv2. Remember to follow naming convention defined in https://docs.aws.amazon.com/waf/latest/developerguide/logging.html.

Importantly, make sure that Amazon Kinesis Data Firehose is using a name starting with the prefix aws-waf-logs-.

## Examples

Expand Down
5 changes: 1 addition & 4 deletions examples/wafv2-logging-configuration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ EOF
}

resource "aws_kinesis_firehose_delivery_stream" "test_stream" {
name = "terraform-kinesis-firehose-test-stream"
name = "aws-waf-logs-kinesis-firehose-test-stream"
destination = "s3"

s3_configuration {
Expand All @@ -124,9 +124,6 @@ module "wafv2" {
{
single_header = {
name = "user-agent"
},
single_query_argument = {
name = "username"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resource "aws_wafv2_web_acl_association" "main" {
resource "aws_wafv2_web_acl_logging_configuration" "main" {
count = var.enabled && var.create_logging_configuration ? 1 : 0

log_destination_configs = var.log_destination_configs #["${aws_kinesis_firehose_delivery_stream.example.arn}"]
log_destination_configs = var.log_destination_configs
resource_arn = aws_wafv2_web_acl.main[0].arn

dynamic "redacted_fields" {
Expand Down

0 comments on commit 35c9682

Please sign in to comment.