Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to enable SVG support #124

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ module "image_optimizer" {
publish = true

environment_variables = {
NODE_ENV = "production"
TF_NEXTIMAGE_BASE_ORIGIN = var.next_image_base_origin
TF_NEXTIMAGE_DOMAINS = jsonencode(var.next_image_domains)
TF_NEXTIMAGE_DEVICE_SIZES = var.next_image_device_sizes != null ? jsonencode(var.next_image_device_sizes) : null
TF_NEXTIMAGE_FORMATS = jsonencode(var.next_image_formats)
TF_NEXTIMAGE_IMAGE_SIZES = var.next_image_image_sizes != null ? jsonencode(var.next_image_image_sizes) : null
TF_NEXTIMAGE_SOURCE_BUCKET = var.source_bucket_id
NODE_ENV = "production"
TF_NEXTIMAGE_BASE_ORIGIN = var.next_image_base_origin
TF_NEXTIMAGE_DOMAINS = jsonencode(var.next_image_domains)
TF_NEXTIMAGE_DEVICE_SIZES = var.next_image_device_sizes != null ? jsonencode(var.next_image_device_sizes) : null
TF_NEXTIMAGE_FORMATS = jsonencode(var.next_image_formats)
TF_NEXTIMAGE_IMAGE_SIZES = var.next_image_image_sizes != null ? jsonencode(var.next_image_image_sizes) : null
TF_NEXTIMAGE_DANGEROUSLY_ALLOW_SVG = var.next_image_dangerously_allow_SVG ? jsonencode(var.next_image_dangerously_allow_SVG) : null
TF_NEXTIMAGE_CONTENT_SECURITY_POLICY = var.next_image_content_security_policy != null ? jsonencode(var.next_image_content_security_policy) : null
TF_NEXTIMAGE_SOURCE_BUCKET = var.source_bucket_id
}

create_package = false
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ variable "next_image_image_sizes" {
default = null
}

variable "next_image_dangerously_allow_SVG" {
description = "Enable the optimization of SVG images."
type = bool
default = false
}

variable "next_image_content_security_policy" {
description = "Set the value of the Content-Security-Policy header in the response of the image optimizer."
type = string
default = null
}

variable "lambda_memory_size" {
description = "Amount of memory in MB the worker Lambda Function can use. Valid value between 128 MB to 10,240 MB, in 1 MB increments."
type = number
Expand Down