Skip to content

Commit

Permalink
PLT-0 - Allow to set default root object
Browse files Browse the repository at this point in the history
  • Loading branch information
Engerim committed Dec 22, 2023
1 parent c9d585d commit e7f76b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ module "cloudfront" {
retain_on_delete = false
wait_for_deployment = false

default_root_object = var.default_root_object

create_origin_access_identity = true
origin_access_identities = {
s3_bucket = "Access identity for CDN (${var.r53_hostname})"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ variable "cf_functions" {
error_message = "Only the following event types are allowed: viewer-request, viewer-response."
}
}

variable "default_root_object" {
description = "The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL."
type = string
default = null
}

0 comments on commit e7f76b9

Please sign in to comment.