forked from observeinc/terraform-aws-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
160 lines (137 loc) · 3.79 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
variable "name" {
description = "Name of Lambda resource"
type = string
}
variable "observe_customer" {
description = "Observe Customer ID"
type = string
}
variable "observe_token" {
description = "Observe Token"
type = string
validation {
condition = contains(split("", var.observe_token), ":")
error_message = "Token format does not follow {datastream_id}:{datastream_secret} format."
}
}
# Optional input variables
variable "observe_domain" {
description = "Observe domain"
type = string
default = "observeinc.com"
}
variable "lambda_version" {
description = "Version of lambda binary to use"
type = string
default = "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 "s3_key_prefix" {
description = "S3 key containing lambda binaries"
type = string
default = "lambda/observer"
}
variable "s3_regional_buckets" {
description = "Map of AWS regions to lambda hosting S3 buckets"
type = map(any)
default = {}
}
variable "s3_bucket" {
description = "S3 Bucket hosting lambda binary. If provided, overrides regional bucket map"
type = string
default = ""
}
variable "s3_key" {
description = "S3 object key for lambda binary. If provided, overrides s3_key_prefix"
type = string
default = ""
}
variable "s3_object_version" {
description = "S3 object version for lambda binary"
type = string
default = ""
}
variable "description" {
description = "Lambda description"
type = string
default = "Lambda function to forward events towards Observe"
}
variable "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 128 MB. The value must be a multiple of 64 MB.
EOF
type = number
default = 128
}
variable "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
default = 60
}
variable "reserved_concurrent_executions" {
description = "The number of simultaneous executions to reserve for the function."
type = number
default = 100
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
default = {}
}
variable "iam_name_prefix" {
description = "Prefix used for all created IAM roles and policies"
type = string
default = "observe-lambda-"
}
variable "kms_key_arn" {
description = <<-EOF
The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables.
If it's not provided, AWS Lambda uses a default service key.
EOF
type = string
default = ""
}
variable "lambda_iam_role_arn" {
description = "ARN of IAM role to use for Lambda"
type = string
default = ""
}
variable "retention_in_days" {
description = "Retention in days of cloudwatch log group"
type = number
default = 14
}
variable "lambda_envvars" {
description = "Environment variables"
type = map(any)
default = {}
}
variable "vpc_config" {
description = "VPC Config"
type = object({
security_groups = list(object({
id = string
}))
subnets = list(object({
arn = string
id = string
}))
})
default = null
}
variable "dead_letter_queue_destination" {
type = string
default = null
description = "Send failed events/function executions to a dead letter queue arn sns or sqs"
}