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: added web acl to cloudfront #111

Merged
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
4 changes: 3 additions & 1 deletion infrastructure/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ resource "aws_cloudfront_distribution" "ztmf" {
is_ipv6_enabled = false
comment = "ZTMF Scoring"
default_root_object = "index.html"

// CMS provides a pre configured web acl, but it cant be tagged thus it can
// only be found by looking to the stack outputs
web_acl_id = data.aws_cloudformation_stack.web_acl.outputs["SamQuickACLEnforcingV2"]
origin {
origin_id = "ztmf_web_assets"
domain_name = aws_s3_bucket.ztmf_web_assets.bucket_regional_domain_name
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,8 @@ data "aws_acm_certificate" "ztmf" {
domain = "dev.ztmf.cms.gov" // use dev. here because thats the domain value of the cert. other names are listed as alts
statuses = ["ISSUED"]
}

// CMS cloud provided the following stack in each account for the preconfigured CMS cloud WAF
data "aws_cloudformation_stack" "web_acl" {
name = "SamShieldAdvancedWaf"
}