-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvariables.tf
313 lines (269 loc) · 8.06 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
variable "name" {
description = "Name for resources to be created"
type = string
default = "observe-collection"
}
variable "log_subscription_name" {
description = "Name for log subscription resources to be created"
type = string
default = null
}
variable "observe_customer" {
description = "Observe Customer ID"
type = string
}
variable "observe_token" {
description = "Observe Token"
type = string
}
variable "observe_domain" {
description = "Observe Domain"
type = string
default = "observeinc.com"
}
variable "snapshot_action" {
description = "List of actions triggered by snapshot. Set to null to inherit all actions supported by the lambda."
type = set(string)
nullable = true
default = [
"autoscaling:Describe*",
"cloudformation:Describe*",
"cloudformation:List*",
"cloudfront:List*",
"dynamodb:Describe*",
"dynamodb:List*",
"ec2:Describe*",
"ecs:Describe*",
"ecs:List*",
"eks:Describe*",
"eks:List*",
"elasticache:Describe*",
"elasticloadbalancing:Describe*",
"events:List*",
"firehose:Describe*",
"firehose:List*",
"iam:Get*",
"iam:List*",
"kinesis:Describe*",
"kinesis:List*",
"lambda:List*",
"logs:Describe*",
"rds:Describe*",
"route53:List*",
"s3:GetBucket*",
"s3:List*",
"sns:Get*",
"sns:List*",
"sqs:Get*",
"sqs:List*"
]
}
variable "lambda_memory_size" {
description = <<-EOF
The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation.
The default value is 256 MB. The value must be a multiple of 64 MB.
EOF
type = number
nullable = false
default = 256
}
variable "lambda_timeout" {
description = <<-EOF
The amount of time that Lambda allows a function to run before stopping it.
The maximum allowed value is 900 seconds.
EOF
type = number
nullable = false
default = 120
}
variable "lambda_version" {
description = "Lambda version"
type = string
default = "arm64/latest"
}
variable "lambda_s3_custom_rules" {
description = "List of rules to evaluate how to upload a given S3 object to Observe."
type = list(object({
pattern = string
headers = map(string)
}))
default = []
}
variable "lambda_reserved_concurrent_executions" {
description = "The number of simultaneous executions to reserve for the function."
type = number
default = 100
}
variable "lambda_subscribe_logs" {
description = "Whether to subscribe to the Lambda function's logs and deliver them from CloudWatch to Observe via Kinesis Firehose."
type = bool
default = true
}
variable "retention_in_days" {
description = "Retention in days of cloudwatch log group"
type = number
default = 365
}
variable "lambda_kms_key" {
description = "KMS key to encrypt environment variables"
type = object({ arn = string })
default = null
}
variable "lambda_envvars" {
description = "Environment variables"
type = map(any)
default = {}
}
variable "dead_letter_queue_destination" {
type = string
default = null
description = "Send failed events/function executions to a dead letter queue arn sns or sqs"
}
variable "subscribed_s3_bucket_arns" {
description = "List of additional S3 bucket ARNs to subscribe lambda to."
type = list(string)
default = []
}
variable "subscribed_log_group_matches" {
description = <<-EOF
A list of regex patterns describing CloudWatch log groups to subscribe to.
See https://github.com/observeinc/terraform-aws-cloudwatch-logs-subscription#input_log_group_matches for more info"
EOF
type = list(string)
default = []
}
variable "subscribed_log_group_excludes" {
description = <<-EOF
A list of regex patterns describing CloudWatch log groups to NOT subscribe to.
See https://github.com/observeinc/terraform-aws-cloudwatch-logs-subscription#input_log_group_excludes for more info"
EOF
type = list(string)
default = []
}
variable "subscribed_log_group_filter_pattern" {
description = <<-EOF
A filter pattern for a CloudWatch Logs subscription filter.
See https://github.com/observeinc/terraform-aws-cloudwatch-logs-subscription#input_filter_pattern or
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for more info"
EOF
type = string
default = ""
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
default = {}
}
variable "cloudtrail_is_multi_region_trail" {
description = "Whether to enable multi region trail export"
type = bool
default = true
}
variable "s3_exported_prefix" {
description = "Key prefix which is subscribed to be sent to Observe Lambda"
type = string
default = ""
}
variable "s3_logging" {
description = "Enable S3 access log collection"
type = bool
default = false
}
variable "s3_lifecycle_rule" {
description = "List of maps containing configuration of object lifecycle management."
type = any
default = []
}
variable "snapshot_include" {
description = "List of actions to include in snapshot request."
type = list(string)
default = []
}
variable "snapshot_exclude" {
description = "List of actions to exclude from being executed on snapshot request."
type = list(string)
default = []
}
variable "snapshot_schedule_expression" {
description = "Rate at which snapshot is triggered. Must be valid EventBridge expression"
type = string
default = "rate(1 hour)"
}
variable "kms_key_id" {
description = "KMS key ARN to use to encrypt the logs delivered by CloudTrail."
type = string
default = ""
}
variable "cloudtrail_enable" {
description = <<-EOF
Whether to create a CloudTrail trail.
Useful for avoiding the 'trails per region' quota of 5, such as when testing.
EOF
type = bool
default = true
}
variable "cloudtrail_enable_log_file_validation" {
description = "Whether log file integrity validation is enabled for CloudTrail. Defalults to false."
type = bool
default = false
}
variable "cloudtrail_exclude_management_event_sources" {
description = <<-EOF
A list of management event sources to exclude.
See the following link for more info:
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html
EOF
type = set(string)
default = [
"kms.amazonaws.com",
"rdsdata.amazonaws.com",
]
}
variable "cloudwatch_metrics_include_filters" {
description = "Namespaces to include. Mutually exclusive with cloudwatch_metrics_exclude_filters."
type = set(string)
nullable = false
default = []
}
variable "cloudwatch_metrics_exclude_filters" {
description = <<-EOF
Namespaces to exclude. Mutually exclusive with cloudwatch_metrics_include_filters.
To disable Cloudwatch Metrics Stream entirely, use ["*"].
EOF
type = set(string)
nullable = false
default = []
}
variable "eventbridge_rules" {
description = <<-EOF
Eventbridge events matching these rules will be forwarded to Observe. Map
keys are only used to provide stable resource addresses.
If null, a default set of rules will be used.
EOF
type = map(object({
description = string
event_pattern = string
}))
default = null
}
variable "s3_bucket" {
description = <<-EOF
Override S3 bucket used to to stage data to be sent to Observe.
EOF
type = object({
id = string
arn = string
})
default = null
}
variable "invoke_snapshot_on_start_enabled" {
description = "Toggle invocation of snapshot from Cloudformation. This can be useful for debug purposes if the lambda fails to complete successfully."
type = bool
default = false
}
variable "enable_s3_bucket_eventbridge" {
description = "Enable sending bucket notifications to EventBridge"
type = bool
nullable = false
default = false
}