Skip to content

Commit e9b6d92

Browse files
authored
Make http_version configurable (#23)
Allow enabling HTTP/3.
1 parent a2c4bd4 commit e9b6d92

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ See the [Terraform Modules documentation](https://www.terraform.io/docs/modules/
116116
* `price_class`: (Optional) The price class that corresponds with the maximum price that you want to pay for CloudFront service.
117117
Read [pricing page](https://aws.amazon.com/cloudfront/pricing/) for more details.
118118
Options: `PriceClass_100` | `PriceClass_200` | `PriceClass_All`. Default value = `PriceClass_200`
119+
* `http_version`: (Optional) Maximum HTTP version to support on the distribution.
120+
Allowed values are `http1.1`, `http2`, `http2and3` and `http3`. The default is `http2`.
119121
* `ipv6`: (Optional) Enable IPv6 support on CloudFront distribution. Default value = `false`
120122
* `wait-for-deployment`: (Optional) If enabled, the resource will wait for the distribution status to change from `InProgress` to `Deployed`. Setting this to `false` will skip the process. Default: `true`.
121123
* `minimum_client_tls_protocol_version`: (Optional) Set the minimum protocol version of the CloudFront certificate.

site-main/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ resource "aws_cloudfront_distribution" "website_cdn" {
125125
enabled = true
126126
is_ipv6_enabled = var.ipv6
127127
price_class = var.price_class
128-
http_version = "http2"
128+
http_version = var.http_version
129129

130130
wait_for_deployment = var.wait-for-deployment
131131

site-main/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ variable "price_class" {
8888
default = "PriceClass_200"
8989
}
9090

91+
variable "http_version" {
92+
type = string
93+
default = "http2"
94+
}
95+
9196
variable "default_cache_behavior_lambda_function_associations" {
9297
description = "Optional Lambda@Edge function associations for the Default Cache Behavior (S3 bucket)"
9398
default = []

site-redirect/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ resource "aws_cloudfront_distribution" "website_cdn" {
8888
enabled = true
8989
is_ipv6_enabled = var.ipv6
9090
price_class = var.price_class
91-
http_version = "http2"
91+
http_version = var.http_version
9292

9393
origin {
9494
origin_id = "origin-bucket-${aws_s3_bucket.website_bucket.id}"

site-redirect/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ variable "price_class" {
3636
default = "PriceClass_200"
3737
}
3838

39+
variable "http_version" {
40+
type = string
41+
default = "http2"
42+
}
43+
3944
variable "ipv6" {
4045
type = bool
4146
description = "Enable IPv6 on CloudFront distribution"

0 commit comments

Comments
 (0)