Skip to content

Commit cd8ae65

Browse files
committed
enable origin shield for docs.rs webserver
1 parent d19ba42 commit cd8ae65

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

terraform/docs-rs/cloudfront.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ resource "aws_cloudfront_distribution" "webapp" {
110110
origin_ssl_protocols = ["TLSv1.2"]
111111
}
112112

113+
origin_shield {
114+
enabled = true
115+
# the docs.rs webserver is in `us-west-1` but origin shield
116+
# isn't available there.
117+
# So we enable it in `us-west-2` instead, following the documentation.
118+
# https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
119+
origin_shield_region = "us-west-2"
120+
}
121+
113122
custom_header {
114123
name = "X-Origin-Auth"
115124
value = random_password.origin_auth.result

0 commit comments

Comments
 (0)