-
Notifications
You must be signed in to change notification settings - Fork 39
/
variables.tf
360 lines (301 loc) · 12.3 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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
variable "region" {
description = "DEPRECATED. The region of AWS you want to work in, such as us-west-2 or us-east-1 (deprecated: use `var.cloudwatch_log_regions` instead)"
type = string
default = null
}
variable "cloudwatch_log_regions" {
description = "List of regions to allow CloudWatch logs to be shipped from. Set in Kinesis Firehose role's trust polucy"
type = list(string)
default = []
}
variable "hec_url" {
description = "Splunk Kinesis URL for submitting CloudWatch logs to splunk"
type = string
}
variable "hec_token" {
description = "Splunk security token needed to submit data to Splunk. Required if var.self_managed_hec_token is not specified."
type = string
default = null
}
variable "nodejs_runtime" {
description = "Runtime version of nodejs for Lambda function"
default = "nodejs20.x"
type = string
}
variable "firehose_name" {
description = "Name of the Kinesis Firehose"
default = "kinesis-firehose-to-splunk"
type = string
}
variable "kinesis_firehose_retry_duration" {
description = "After an initial failure to deliver to Splunk, the total amount of time, in seconds between 0 to 7200, during which Firehose re-attempts delivery (including the first attempt). After this time has elapsed, the failed documents are written to Amazon S3. The default value is 300s. There will be no retry if the value is 0"
type = number
default = 300 # Seconds
}
variable "kinesis_firehose_buffer" {
description = "https://www.terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html#buffer_size"
type = number
default = 5 # Megabytes
}
variable "kinesis_firehose_buffer_interval" {
description = "Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination"
type = number
default = 300 # Seconds
}
variable "s3_prefix" {
description = "Optional prefix (a slash after the prefix will show up as a folder in the s3 bucket). The YYYY/MM/DD/HH time format prefix is automatically used for delivered S3 files."
type = string
default = "kinesis-firehose/"
}
variable "hec_acknowledgment_timeout" {
description = "The amount of time, in seconds between 180 and 600, that Kinesis Firehose waits to receive an acknowledgment from Splunk after it sends it data."
type = number
default = 300
}
variable "hec_endpoint_type" {
description = "Splunk HEC endpoint type; `Raw` or `Event`"
type = string
default = "Raw"
}
variable "s3_backup_mode" {
description = "Defines how documents should be delivered to Amazon S3. Valid values are FailedEventsOnly and AllEvents."
type = string
default = "FailedEventsOnly"
}
variable "s3_compression_format" {
description = "The compression format for what the Kinesis Firehose puts in the s3 bucket"
type = string
default = "GZIP"
}
variable "enable_fh_cloudwatch_logging" {
description = "Enable kinesis firehose CloudWatch logging. (It only logs errors)"
type = bool
default = true
}
variable "tags" {
type = map(string)
description = "Map of tags to put on the resource"
default = {}
}
variable "cloudwatch_log_retention" {
description = "Length in days to keep CloudWatch logs of Kinesis Firehose"
type = number
default = 30
}
variable "log_stream_name" {
description = "Name of the CloudWatch log stream for Kinesis Firehose CloudWatch log group"
type = string
default = "SplunkDelivery"
}
variable "s3_bucket_name" {
description = "Name of the s3 bucket Kinesis Firehose uses for backups"
type = string
}
variable "s3_bucket_block_public_access_enabled" {
description = "Set to 1 if you would like to add block public access settings for the s3 bucket Kinesis Firehose uses for backups"
type = number
default = 0
}
variable "encryption_context" {
description = "aws_kms_secrets encryption context"
type = map(string)
default = {}
}
variable "kinesis_firehose_lambda_role_name" {
description = "Name of IAM Role for Lambda function that transforms CloudWatch data for Kinesis Firehose into Splunk compatible format"
type = string
default = "KinesisFirehoseToLambaRole"
}
variable "kinesis_firehose_role_name" {
description = "Name of IAM Role for the Kinesis Firehose"
type = string
default = "KinesisFirehoseRole"
}
variable "arn_cloudwatch_logs_to_ship" {
description = "arn of the CloudWatch Log Group that you want to ship to Splunk."
type = string
default = null
}
variable "name_cloudwatch_logs_to_ship" {
description = "Name of the CloudWatch Log Group that you want to ship to Splunk (single log group; leave empty to not create the subscription filter; see var.cloudwatch_log_group_names_to_ship for creating subscription filters for multiple log groups)."
type = string
default = null
}
variable "lambda_function_name" {
description = "Name of the Lambda function that transforms CloudWatch data for Kinesis Firehose into Splunk compatible format"
type = string
default = "kinesis-firehose-transform"
}
variable "lambda_function_memory_size" {
description = "Amount of memory in MB which Lambda Function can use at runtime. Defaults to 128"
type = number
default = 128
}
variable "lambda_function_timeout" {
description = "The function execution time at which Lambda should terminate the function."
type = number
default = 180
}
variable "lambda_function_environment_variables" {
description = "Environment variables for the lambda function"
default = {}
type = map(string)
}
variable "lambda_iam_policy_name" {
description = "Name of the IAM policy that is attached to the IAM Role for the lambda transform function"
type = string
default = "Kinesis-Firehose-to-Splunk-Policy"
}
variable "kinesis_firehose_iam_policy_name" {
description = "Name of the IAM Policy attached to IAM Role for the Kinesis Firehose"
default = "KinesisFirehose-Policy"
type = string
}
variable "cloudwatch_to_firehose_trust_iam_role_name" {
description = "IAM Role name for CloudWatch to Kinesis Firehose subscription"
type = string
default = "CloudWatchToSplunkFirehoseTrust"
}
variable "cloudwatch_to_fh_access_policy_name" {
description = "Name of IAM policy attached to the IAM role for CloudWatch to Kinesis Firehose subscription"
type = string
default = "KinesisCloudWatchToFirehosePolicy"
}
variable "cloudwatch_log_filter_name" {
description = "Name of Log Filter for CloudWatch Log subscription to Kinesis Firehose"
type = string
default = "KinesisSubscriptionFilter"
}
variable "cloudwatch_log_group_names_to_ship" {
description = "List of CloudWatch Log Group names that you want to ship to Splunk."
type = list(string)
default = null
}
variable "subscription_filter_pattern" {
description = "Filter pattern for the CloudWatch Log Group subscription to the Kinesis Firehose. See [this](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) for filter pattern info."
type = string
default = "" # nothing is being filtered
}
variable "local_lambda_file" {
description = "The absolute path to an existing custom Lambda script"
type = string
default = null
}
variable "local_lambda_file_handler" {
description = "Allows you to specify Lambda handler if using a local custom file for Lambda function"
type = string
default = null
}
variable "aws_s3_bucket_versioning" {
description = "Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets."
type = string
default = null
}
variable "s3_bucket_object_lock_enabled" {
description = "Indicates whether this bucket has an Object Lock configuration enabled. Valid values: Enabled."
type = string
default = null
}
variable "firehose_server_side_encryption_enabled" {
description = "Enable SSE for Kinesis Firehose"
type = bool
default = false
}
variable "firehose_server_side_encryption_key_type" {
description = "Type of SSE key to be used for encrypting the Firehose. Valid values are `AWS_OWNED_CMK` and `CUSTOMER_MANAGED_CMK`"
type = string
default = null
}
variable "firehose_server_side_encryption_key_arn" {
description = "ARN of the key to be used for Firehose SSE"
type = string
default = null
}
variable "cloudwach_log_group_kms_key_id" {
description = "KMS key ID of the key to use to encrypt the Cloudwatch log group"
type = string
default = null
}
variable "lambda_reserved_concurrent_executions" {
description = "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 = string
default = null
}
variable "lambda_tracing_config" {
description = "Configures x-ray tracing for Lambda fuction. See valid values here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function#mode"
type = string
default = null
}
variable "s3_bucket_server_side_encryption_kms_master_key_id" {
description = "AWS KMS master key ID used for the SSE-KMS encryption. This can only be used when you set the value of sse_algorithm as aws:kms. The default aws/s3 AWS KMS master key is used if this element is absent while the sse_algorithm is aws:kms"
type = string
default = null
}
variable "s3_bucket_server_side_encryption_algorithm" {
description = "(Required) Server-side encryption algorithm to use. Valid values are AES256 and aws:kms"
type = string
default = "AES256"
}
variable "s3_bucket_key_enabled" {
description = "Whether or not to use Amazon S3 Bucket Keys for SSE-KMS."
type = bool
default = null
}
variable "lambda_kms_key_arn" {
description = "Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables."
type = string
default = null
}
############# 3rd Party Software ############
variable "lifecycle_rule" {
description = "List of maps containing configuration of object lifecycle management."
type = any
default = []
}
variable "expected_bucket_owner" {
description = "The account ID of the expected bucket owner"
type = string
default = null
}
########### End 3rd Party Software ###########
variable "object_lock_configuration_token" {
description = "S3 bucket object lock configuration token"
type = string
default = null
}
variable "object_lock_configuration_mode" {
description = "Default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Valid values: COMPLIANCE, GOVERNANCE"
type = string
default = null
}
variable "object_lock_configuration_days" {
description = "Required if years is not specified. Number of days that you want to specify for the default retention period"
type = number
default = null
}
variable "object_lock_configuration_years" {
description = "Required if days is not specified. Number of years that you want to specify for the default retention period"
type = number
default = null
}
variable "self_managed_hec_token" {
description = "This variable allows for the user to have additional flexibility in how they pass in the HEC token. Perhaps they want to use a different tool than SSM or KMS encryption in their code base to encrypt it. Required if var.hec_token is not specified."
type = string
sensitive = true
default = null
}
variable "lambda_processing_buffer_size_in_mb" {
description = "Lambda processing buffer size in mb."
type = number
default = 0.256
}
variable "lambda_processing_buffer_interval_in_seconds" {
description = "Lambda processing buffer interval in seconds."
type = number
default = 61 # If 60 is the default, it is not stored in state and there are perpetual changes in the plan
}
variable "firehose_processing_enabled" {
description = "Kinesis firehose processing enabled"
type = bool
default = true
}