Skip to content

Commit

Permalink
feat: added waf association (#34)
Browse files Browse the repository at this point in the history
* feat: added waf association

* fix: indentation

Co-authored-by: David <[email protected]>
  • Loading branch information
dchocoboo and David authored Aug 22, 2022
1 parent c8413a1 commit b63c35e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ resource "aws_lb" "lb" {
)
}

resource "aws_wafv2_web_acl_association" "waf_association" {
count = var.waf_web_acl_arn != "" ? 1 : 0
resource_arn = aws_lb.lb.arn
web_acl_arn = var.waf_web_acl_arn
}

#------------------------------------------------------------------------------
# ACCESS CONTROL TO APPLICATION LOAD BALANCER
#------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ variable "ip_address_type" {
default = "ipv4"
}

variable "waf_web_acl_arn" {
description = "if you want to associate ALB with WAFV2"
type = string
default = ""
}

#------------------------------------------------------------------------------
# ACCESS CONTROL TO APPLICATION LOAD BALANCER
#------------------------------------------------------------------------------
Expand Down

0 comments on commit b63c35e

Please sign in to comment.