Skip to content

Commit 255716e

Browse files
committed
feat(status-codes): add possibility to override status codes
1 parent 8e9b6a4 commit 255716e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ resource "aws_cloudfront_distribution" "this" {
9898
custom_error_response {
9999
error_caching_min_ttl = 3000
100100
error_code = 404
101-
response_code = 200
101+
response_code = var.override_status_code_404
102102
response_page_path = "/index.html"
103103
}
104104

105105
custom_error_response {
106106
error_caching_min_ttl = 3000
107107
error_code = 403
108-
response_code = 403
108+
response_code = var.override_status_code_403
109109
response_page_path = "/index.html"
110110
}
111111

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ variable "cloudfront_price_class" {
3636
default = "PriceClass_100"
3737
}
3838

39+
variable "override_status_code_404" {
40+
type = number
41+
default = 200
42+
}
43+
44+
variable "override_status_code_403" {
45+
type = number
46+
default = 403
47+
}
48+
3949
variable "tags" {
4050
type = map(string)
4151
default = {}

0 commit comments

Comments
 (0)