forked from milliHQ/terraform-aws-next-js-image-optimization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
141 lines (118 loc) · 4.03 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
##########
# Settings
##########
variable "name_prefix" {
description = "Identifier for the deployment group (Added to resource name)."
type = string
}
variable "name_suffix" {
description = "Identifier for the deployment group (Apppended to resource name)."
type = string
default = null
}
variable "next_image_version" {
description = "Next.js version from where you want to use the image optimizer from. Supports semver ranges."
type = string
default = "^10.0.5-beta"
}
variable "next_image_domains" {
description = "Allowed origin domains that can be used for fetching images."
type = list(string)
default = []
}
variable "next_image_path_prefix" {
description = "Path prefix for images, It can be set in next.config.js"
type = string
default = "_next"
}
variable "next_image_package_abs_path" {
description = "Next image optimization lambda package"
type = string
}
variable "next_image_device_sizes" {
description = "Allowed device sizes that should be used for image optimization."
type = list(number)
default = null
}
variable "next_image_image_sizes" {
description = "Allowed image sizes that should be used for image optimization."
type = list(number)
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
default = 1024
validation {
condition = var.lambda_memory_size >= 128 && var.lambda_memory_size <= 10240
error_message = "The var.lambda_memory_size must between 128 and 10240 MB."
}
}
variable "lambda_timeout" {
description = "Max amount of time the worker Lambda Function has to return a response in seconds. Should not be more than 30 (Limited by API Gateway)."
type = number
default = 30
validation {
condition = var.lambda_timeout >= 1 && var.lambda_timeout <= 30
error_message = "The var.lambda_timeout must between 1 and 30 seconds."
}
}
variable "lambda_attach_policy_json" {
description = "Controls whether lambda_policy_json should be added to IAM role for Lambda function."
type = bool
default = false
}
variable "lambda_policy_json" {
description = "Additional policy document as JSON to attach to the Lambda Function role."
type = string
default = ""
}
variable "lambda_role_permissions_boundary" {
description = "ARN of IAM policy that scopes aws_iam_role access for the lambda."
type = string
default = null
}
variable "source_bucket_id" {
description = "When your static files are deployed to a Bucket (e.g. with Terraform Next.js) the optimizer can pull the source from the bucket rather than over the internet."
type = string
default = null
}
#####################
# CloudFront settings
#####################
variable "cloudfront_create_distribution" {
description = "Controls whether a CloudFront distribution should be created."
type = bool
default = true
}
variable "cloudfront_price_class" {
description = "Price class for the CloudFront distributions (main & proxy config). One of PriceClass_All, PriceClass_200, PriceClass_100."
type = string
default = "PriceClass_100"
}
variable "cloudfront_origin_id" {
description = "Override the id for the custom CloudFront id."
type = string
default = "tf-next-image-optimizer"
}
##########
# Labeling
##########
variable "deployment_name" {
description = "Identifier for the deployment group (alphanumeric characters, underscores, hyphens, slashes, hash signs and dots are allowed)."
type = string
default = "tf-next-image"
}
variable "tags" {
description = "Tag metadata to label AWS resources that support tags."
type = map(string)
default = {}
}
#######
# Debug
#######
variable "debug_use_local_packages" {
description = "(Debug) Use local packages instead of downloading them from npm."
type = bool
default = false
}