Skip to content

Commit 94c6170

Browse files
Jonathan BloxsomJonathan Bloxsom
Jonathan Bloxsom
authored and
Jonathan Bloxsom
committed
DT-187 variable for origin read timeout
1 parent ad48e56 commit 94c6170

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

terraform/modules/cloudfront_distributions/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module "delta_cloudfront" {
6060
is_ipv6_enabled = var.delta.ip_allowlist == null
6161
geo_restriction_countries = var.delta.geo_restriction_countries
6262
apply_aws_shield = var.apply_aws_shield
63+
origin_read_timeout = var.delta.origin_read_timeout
6364
}
6465

6566
module "api_cloudfront" {

terraform/modules/cloudfront_distributions/variables.tf

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ variable "delta" {
4141
# Leave null to disable restrictions
4242
geo_restriction_countries = optional(list(string))
4343
ip_allowlist = optional(list(string))
44+
origin_read_timeout = optional(number)
4445
})
4546
}
4647

terraform/modules/website_cloudfront/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ resource "aws_cloudfront_distribution" "main" {
4747
https_port = 443
4848
origin_protocol_policy = var.cloudfront_domain == null ? "http-only" : "https-only"
4949
origin_ssl_protocols = ["TLSv1.2"]
50-
origin_read_timeout = 60
50+
origin_read_timeout = var.origin_read_timeout
5151
}
5252

5353
custom_header {

terraform/modules/website_cloudfront/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ variable "geo_restriction_countries" {
4545
variable "apply_aws_shield" {
4646
type = bool
4747
}
48+
49+
variable "origin_read_timeout" {
50+
type = number
51+
description = "Read timeout for the website origin"
52+
default = 60
53+
}

terraform/production/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ module "cloudfront_distributions" {
232232
}
233233
ip_allowlist = local.cloudfront_ip_allowlists.delta_website
234234
geo_restriction_countries = ["GB", "IE"]
235+
origin_read_timeout = 180
235236
}
236237
api = {
237238
alb = module.public_albs.delta_api

0 commit comments

Comments
 (0)