Skip to content

Commit

Permalink
moving default_filetypes to locals
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel.schroeder committed Nov 15, 2019
1 parent b7ec630 commit 9759b4a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 23 deletions.
22 changes: 0 additions & 22 deletions inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ variable "error_document" {
default = "404.html"
}

variable "default_filetypes" {
description = "Only files types in this list will be synced to S3"
type = map(string)
default = {
html = "text/html"
css = "text/css"
js = "text/javascript"
pdf = "application/pdf"
ico = "image/x-icon"
png = "image/png"
gif = "image/gif"
jpg = "image/jpeg"
jpeg = "image/jpeg"
map = "application/json"
eot = "application/vnd.ms-fontobject"
svg = "image/svg+xml"
ttf = "font/ttf"
woff = "font/woff"
woff2 = "font/woff2"
}
}

variable "additional_filetypes" {
description = "Additional filetypes to sync to S3"
type = map(string)
Expand Down
18 changes: 18 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,22 @@ locals {
length(local.split_domain_name)
)
)
default_filetypes = { // Only files types in this list will be synced to S3
html = "text/html"
css = "text/css"
js = "text/javascript"
pdf = "application/pdf"
ico = "image/x-icon"
png = "image/png"
gif = "image/gif"
jpg = "image/jpeg"
jpeg = "image/jpeg"
map = "application/json"
eot = "application/vnd.ms-fontobject"
svg = "image/svg+xml"
ttf = "font/ttf"
woff = "font/woff"
woff2 = "font/woff2"
}
valid_files = merge(local.default_filetypes, var.additional_filetypes)
}
1 change: 0 additions & 1 deletion s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ locals {
length(regexall(var.filter_paths, v)) == 0) // invalid paths
)
])
valid_files = merge(var.default_filetypes, var.additional_filetypes)
}

data "aws_iam_policy_document" "s3_public_read_policy" {
Expand Down

0 comments on commit 9759b4a

Please sign in to comment.