Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optionally allow attaching a waf policy to cdn #250

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ module "cloudfront_main" {
cloudfront_aliases = var.cloudfront_aliases
cloudfront_acm_certificate_arn = var.cloudfront_acm_certificate_arn
cloudfront_minimum_protocol_version = var.cloudfront_minimum_protocol_version
cloudfront_webacl_id = var.cloudfront_webacl_id

cloudfront_default_root_object = local.cloudfront_default_root_object
cloudfront_origins = local.cloudfront_origins
Expand Down
1 change: 1 addition & 0 deletions modules/cloudfront-main/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "aws_cloudfront_distribution" "distribution" {
price_class = var.cloudfront_price_class
aliases = var.cloudfront_aliases
default_root_object = var.cloudfront_default_root_object
web_acl_id = var.cloudfront_webacl_id

# Add CloudFront origins
dynamic "origin" {
Expand Down
6 changes: 6 additions & 0 deletions modules/cloudfront-main/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ variable "cloudfront_custom_error_response" {
default = null
}

variable "cloudfront_webacl_id" {
description = "An optional webacl2 arn or webacl id to associate with the cloudfront distribution"
type = string
default = null
}

##########
# Labeling
##########
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ variable "cloudfront_external_arn" {
default = null
}

variable "cloudfront_webacl_id" {
description = "An optional webacl2 arn or webacl id to associate with the cloudfront distribution"
type = string
default = null
}

##########
# Labeling
##########
Expand Down