generated from appvia/terraform-aws-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
231 lines (198 loc) · 6.73 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
variable "architecture" {
description = "Instruction set architecture for your Lambda function. Valid values are \"x86_64\" or \"arm64\"."
type = string
default = "arm64"
}
variable "aws_partition" {
description = "The partition in which the resource is located. A partition is a group of AWS Regions. Each AWS account is scoped to one partition."
type = string
default = "aws"
}
variable "aws_region" {
description = "The AWS region to deploy to"
type = string
}
variable "aws_account_id" {
description = "The AWS account ID"
type = string
}
variable "python_runtime" {
description = "The lambda python runtime"
type = string
default = "python3.12"
}
variable "create_sns_topic" {
description = "Whether to create new SNS topic"
type = bool
default = true
}
variable "lambda_role" {
description = "IAM role attached to the Lambda Function. If this is set then a role will not be created for you."
type = string
default = ""
}
variable "lambda_source_path" {
description = "The source path of the custom Lambda function"
type = string
default = null
}
variable "sns_topic_name" {
description = "The name of the SNS topic to create"
type = string
}
variable "sns_topic_kms_key_id" {
description = "ARN of the KMS key used for enabling SSE on the topic"
type = string
default = ""
}
variable "kms_key_arn" {
description = "ARN of the KMS key used for decrypting slack webhook url"
type = string
default = ""
}
variable "recreate_missing_package" {
description = "Whether to recreate missing Lambda package if it is missing locally or not"
type = bool
default = true
}
variable "reserved_concurrent_executions" {
description = "The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations"
type = number
default = -1
}
variable "cloudwatch_log_group_retention_in_days" {
description = "Specifies the number of days you want to retain log events in log group for Lambda."
type = number
default = 0
}
variable "cloudwatch_log_group_kms_key_id" {
description = "The ARN of the KMS Key to use when encrypting log data for Lambda"
type = string
default = null
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
}
variable "iam_role_boundary_policy_arn" {
description = "The ARN of the policy that is used to set the permissions boundary for the role"
type = string
default = null
}
variable "iam_role_name_prefix" {
description = "A unique role name beginning with the specified prefix"
type = string
default = "lambda"
}
variable "iam_role_path" {
description = "Path of IAM role to use for Lambda Function"
type = string
default = null
}
variable "lambda_function_store_on_s3" {
description = "Whether to store produced artifacts on S3 or locally."
type = bool
default = false
}
variable "lambda_function_s3_bucket" {
description = "S3 bucket to store artifacts"
type = string
default = null
}
variable "lambda_function_ephemeral_storage_size" {
description = "Amount of ephemeral storage (/tmp) in MB your Lambda Function can use at runtime. Valid value between 512 MB to 10,240 MB (10 GB)."
type = number
default = 512
}
variable "enable_slack" {
description = "To send to slack, set to true"
type = bool
default = false
}
variable "enable_teams" {
description = "To send to teams, set to true"
type = bool
default = false
}
variable "delivery_channels" {
description = "The configuration for Slack notifications"
type = map(object({
lambda_name = optional(string, "delivery_channel")
# The name of the lambda function to create
lambda_description = optional(string, "Lambda function to send notifications")
# The description for the lambda
secret_name = optional(string)
# An optional secret name in secrets manager to use for the slack configuration
webhook_url = optional(string)
# The webhook url to post to
filter_policy = optional(string)
# An optional SNS subscription filter policy to apply
filter_policy_scope = optional(string)
# If filter policy provided this is the scope of that policy; either "MessageAttributes" (default) or "MessageBody"
}))
default = null
}
variable "powertools_service_name" {
description = "The name to use when defining a metric namespace"
type = string
default = "appvia-notifications"
}
variable "identity_center_start_url" {
description = "The start URL of your Identity Center instance"
type = string
default = null
}
variable "identity_center_role" {
description = "The name of the role to use when redirecting through Identity Center"
type = string
default = null
}
variable "lambda_policy_config" {
description = "Map of policy configurations"
type = map(object({
enabled = bool
effect = string
actions = list(string)
resources = list(string)
}))
default = {
ssm = {
enabled = false
effect = "Allow"
actions = ["ssm:GetParameter", "ssm:GetParameters"]
resources = ["*"]
}
}
}
variable "lambda_layers_config" {
description = "Configuration for Lambda layers"
type = map(object({
enabled = optional(bool, true)
type = optional(string, "managed") # "managed" or "custom"
arn = optional(string)
version = optional(string)
region = optional(string)
}))
default = {}
validation {
condition = alltrue([
for k, v in var.lambda_layers_config :
v.type == "custom" || v.type == "managed"
])
error_message = "Layer type must be either 'managed' or 'custom'."
}
}
variable "trigger_on_package_timestamp" {
description = "Whether to recreate the Lambda package if the timestamp changes"
type = bool
default = true
}
variable "accounts_id_to_name_parameter_arn" {
description = "The ARN of your parameter containing the your account ID to name mapping. This ARN will be attached to lambda execution role as a resource, therefore a valid resource must exist. e.g 'arn:aws:ssm:eu-west-2:0123456778:parameter/myorg/configmaps/accounts_id_to_name_mapping' to enable the lambda retrieve values from ssm."
type = string
default = null
validation {
condition = var.accounts_id_to_name_parameter_arn == null ? true : can(regex("^arn:[^:]+:ssm:[a-z0-9-]+:[0-9]{12}:parameter/.+$", var.accounts_id_to_name_parameter_arn))
error_message = "The accounts_id_to_name_parameter_arn must be a valid SSM parameter ARN."
}
}