-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
149 lines (127 loc) · 5.04 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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#########################################
# Solution-Level Variables
#########################################
variable "tags" {
description = "Map of tags to apply to resources deployed by this solution."
type = map(any)
default = null
}
#########################################
# Label / Naming Variables
#########################################
variable "label_id_order" {
description = "ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique"
type = list(string)
default = ["name", "namespace", "stage"]
}
variable "stage" {
description = "Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release'."
type = string
default = null
}
#########################################
# Cloudwatch Variables
#########################################
variable "cloudwatch_log_group_retention" {
description = "Amount of days to keep CloudWatch Log Groups for Lambda functions. 0 = Never Expire"
type = string
default = "0"
validation {
condition = contains(["1", "3", "5", "7", "14", "30", "60", "90", "120", "150", "180", "365", "400", "545", "731", "1827", "3653", "0"], var.cloudwatch_log_group_retention)
error_message = "Valid values for var: cloudwatch_log_group_retention are (1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653, and 0)."
}
}
#########################################
# Lambda Variables
#########################################
###########################################################################################
# sce_parameter_parser #
###########################################################################################
variable "lambda_sce_parameter_parser_architectures" {
description = "Instruction set architecture for your Lambda function."
type = list(string)
validation {
condition = alltrue([
for v in var.lambda_sce_parameter_parser_architectures : contains(["arm64", "x86_64"], v)
])
error_message = "Valid values for var: lambda_sce_parameter_parser_architectures are ('arm64', 'x86_64')."
}
}
variable "lambda_sce_parameter_parser_description" {
description = "Description of what your Lambda Function does"
type = string
default = "Parses parameters - Invoked by Service Catalog"
}
variable "lambda_sce_parameter_parser_handler" {
type = string
description = "Function entrypoint in your code."
validation {
condition = length(var.lambda_sce_parameter_parser_handler) <= 128
error_message = "Lambda handler name must be less than 128 characters long."
}
}
variable "lambda_sce_parameter_parser_memory_size" {
description = "Amount of memory in MB your Lambda Function can use at runtime"
type = number
default = 1024
validation {
condition = (
var.lambda_sce_parameter_parser_memory_size >= 128 &&
var.lambda_sce_parameter_parser_memory_size <= 10240
)
error_message = "Lambda memory size must be between 128 and 10240 MB."
}
}
variable "lambda_sce_parameter_parser_runtime" {
description = "Identifier of the function's runtime."
type = string
}
variable "lambda_sce_parameter_parser_s3_bucket" {
description = "S3 bucket name containting the Lambda source code .zip file"
type = string
}
variable "lambda_sce_parameter_parser_s3_key" {
description = "S3 bucket key of the Lambda source code .zip file"
type = string
}
variable "lambda_sce_parameter_parser_timeout" {
description = "Amount of time your Lambda Function has to run in seconds."
type = number
default = 100
validation {
condition = (
var.lambda_sce_parameter_parser_timeout >= 1 &&
var.lambda_sce_parameter_parser_timeout <= 900
)
error_message = "Lambda timout must be between 1 and 900 seconds."
}
}
variable "lambda_sce_parameter_tracing_config_mode" {
description = "Whether to sample and trace a subset of incoming requests with AWS X-Ray. Valid values are PassThrough and Active."
type = string
default = "Active"
validation {
condition = contains(["Active", "PassThrough"], var.lambda_sce_parameter_tracing_config_mode)
error_message = "Valid values for var: lambda_sce_parameter_tracing_config_mode are (Active, PassThrough)."
}
}
#########################################
# VPC Variables
#########################################
variable "vpc_id" {
type = string
description = "VPC ID to use if leveraging an existing VPC for the solution."
default = null
}
variable "vpc_private_subnet_ids" {
type = list(string)
description = "Required if `vpc_id` is specified. List of private subnets to use in the provided vpc_id"
default = null
}
variable "vpc_security_group_ids" {
type = list(string)
description = "Required if `vpc_id` is specified. List of security groups to use in the provided vpc_id"
default = null
}