Skip to content

Commit

Permalink
feat(cdn): add optional waf rule
Browse files Browse the repository at this point in the history
  • Loading branch information
jindrichskupa committed Dec 17, 2024
1 parent b3a8c2b commit a6141fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.infracost
.terraform
.terraform.tfstate.lock.info
terraform.tfstate
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ data "aws_cloudfront_cache_policy" "managed_caching_disabled" {
resource "aws_cloudfront_distribution" "this" {
comment = local.main_domain

web_acl_id = var.waf_acl_arn
origin {
domain_name = module.s3_bucket.s3_bucket_bucket_regional_domain_name
origin_id = var.s3_bucket_name
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ variable "tags" {
default = {}
}

variable "waf_acl_arn" {
description = "WAF ACL ARN"
type = string
default = null
}

variable "restriction_type" {
description = "Apply for geo restrictions, values: none, whitelist, blacklist"
type = string
Expand Down

0 comments on commit a6141fd

Please sign in to comment.