Skip to content

Commit

Permalink
fix(cdn): restrict CDN region check lookup (#798)
Browse files Browse the repository at this point in the history
Limits the CDN region check for logging to only
run during the cdn template deployment.
Previously this would run on resource group
deployments that deploy to the default region
  • Loading branch information
roleyfoley authored Feb 7, 2024
1 parent 3cdb0fa commit 0609386
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions aws/components/cdn/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -791,15 +791,19 @@
[#if wafPresent ]
[#if solution.WAF.Logging.Enabled]

[#if getRegion() != "us-east-1" ]
[@fatal
message="To enable firehose based logging for WAF on CDN the deployment must be run from us-east-1"
context={
"CDNId" : occurrence.Core.Id,
"Region" : getRegion()
}
/]
[/#if]
[#if deploymentSubsetRequired(CDN_COMPONENT_TYPE, true)]

[#if getRegion() != "us-east-1" ]
[@fatal
message="To enable firehose based logging for WAF on CDN the deployment must be run from us-east-1"
context={
"CDNId" : occurrence.Core.Id,
"Region" : getRegion()
}
/]
[/#if]

[/#if ]

[#local wafFirehoseStreamId =
formatResourceId(AWS_KINESIS_FIREHOSE_STREAM_RESOURCE_TYPE, wafAclId)]
Expand Down

0 comments on commit 0609386

Please sign in to comment.