From 58bee0f977112fed4c5b9140a789de40b557d634 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Wed, 5 Jun 2024 16:47:17 -0400 Subject: [PATCH] feat: add http_version,comment to spa-s3-cloudfront (#1059) --- modules/spa-s3-cloudfront/README.md | 2 ++ modules/spa-s3-cloudfront/main.tf | 2 ++ modules/spa-s3-cloudfront/variables.tf | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/modules/spa-s3-cloudfront/README.md b/modules/spa-s3-cloudfront/README.md index a511f7255..60c2b8263 100644 --- a/modules/spa-s3-cloudfront/README.md +++ b/modules/spa-s3-cloudfront/README.md @@ -201,6 +201,7 @@ components: | [cloudfront\_max\_ttl](#input\_cloudfront\_max\_ttl) | Maximum amount of time (in seconds) that an object is in a CloudFront cache. | `number` | `31536000` | no | | [cloudfront\_min\_ttl](#input\_cloudfront\_min\_ttl) | Minimum amount of time that you want objects to stay in CloudFront caches. | `number` | `0` | no | | [cloudfront\_viewer\_protocol\_policy](#input\_cloudfront\_viewer\_protocol\_policy) | Limit the protocol users can use to access content. One of `allow-all`, `https-only`, or `redirect-to-https`. | `string` | `"redirect-to-https"` | no | +| [comment](#input\_comment) | Any comments you want to include about the distribution. | `string` | `"Managed by Terraform"` | no | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no | | [custom\_origins](#input\_custom\_origins) | A list of additional custom website [origins](https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#origin-arguments) for this distribution. |
list(object({
domain_name = string
origin_id = string
origin_path = string
custom_headers = list(object({
name = string
value = string
}))
custom_origin_config = object({
http_port = number
https_port = number
origin_protocol_policy = string
origin_ssl_protocols = list(string)
origin_keepalive_timeout = number
origin_read_timeout = number
})
}))
| `[]` | no | | [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | @@ -222,6 +223,7 @@ components: | [github\_runners\_environment\_name](#input\_github\_runners\_environment\_name) | The name of the environment where the CloudTrail bucket is provisioned | `string` | `"ue2"` | no | | [github\_runners\_stage\_name](#input\_github\_runners\_stage\_name) | The stage name where the CloudTrail bucket is provisioned | `string` | `"auto"` | no | | [github\_runners\_tenant\_name](#input\_github\_runners\_tenant\_name) | The tenant name where the GitHub Runners are provisioned | `string` | `null` | no | +| [http\_version](#input\_http\_version) | The maximum HTTP version to support on the distribution. Allowed values are http1.1, http2, http2and3 and http3 | `string` | `"http2"` | no | | [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length.
Set to `null` for keep the existing setting, which defaults to `0`.
Does not affect `id_full`. | `number` | `null` | no | | [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
Does not affect keys of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no | | [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no | diff --git a/modules/spa-s3-cloudfront/main.tf b/modules/spa-s3-cloudfront/main.tf index a6b3072a8..240593db4 100644 --- a/modules/spa-s3-cloudfront/main.tf +++ b/modules/spa-s3-cloudfront/main.tf @@ -87,6 +87,7 @@ module "spa_web" { s3_access_log_bucket_name = local.s3_access_log_bucket_name s3_access_log_prefix = var.origin_s3_access_log_prefix + comment = var.comment aliases = local.aliases external_aliases = local.external_aliases parent_zone_name = local.parent_zone_name @@ -97,6 +98,7 @@ module "spa_web" { acm_certificate_arn = module.acm_request_certificate.arn ipv6_enabled = var.cloudfront_ipv6_enabled + http_version = var.http_version allowed_methods = var.cloudfront_allowed_methods cached_methods = var.cloudfront_cached_methods custom_error_response = var.cloudfront_custom_error_response diff --git a/modules/spa-s3-cloudfront/variables.tf b/modules/spa-s3-cloudfront/variables.tf index e13b02fb8..1505e784d 100644 --- a/modules/spa-s3-cloudfront/variables.tf +++ b/modules/spa-s3-cloudfront/variables.tf @@ -549,3 +549,15 @@ variable "lambda_edge_destruction_delay" { EOT default = "20m" } + +variable "http_version" { + type = string + default = "http2" + description = "The maximum HTTP version to support on the distribution. Allowed values are http1.1, http2, http2and3 and http3" +} + +variable "comment" { + type = string + description = "Any comments you want to include about the distribution." + default = "Managed by Terraform" +}