-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvariables.tf
160 lines (137 loc) · 4.62 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
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
variable "region" {
type = string
description = "Physical location for clustered data centers."
default = "us-east-1"
}
variable "access_key" {
type = string
description = "Access key of the AWS account, if you have configured AWS CLI, you can leave it empty."
default = ""
}
variable "secret_key" {
type = string
description = "Secret key of the AWS account, if you have configured AWS CLI, you can leave it empty."
default = ""
}
variable "cluster_name" {
type = string
description = "Name of the cluster"
default = "skywalking-cluster"
}
variable "oap_instance_count" {
type = number
description = "Number of OAP instances, if you want to use H2 storage, you must set it to 1."
default = 1
}
variable "ui_instance_count" {
type = number
description = "Number of UI instances"
default = 1
}
variable "bastion_enabled" {
type = bool
description = "Enable bastion host, if you want to access the instances via SSH, you must enable it."
default = true
}
variable "bastion_instance_type" {
type = string
description = "CPU, memory, storage and networking capacity for bastion host"
default = "t2.micro"
}
variable "bastion_ssh_cidr_blocks" {
type = list(string)
description = "CIDR blocks for SSH access to bastion host"
default = ["0.0.0.0/0"]
}
variable "oap_instance_type" {
type = string
description = "CPU, memory, storage and networking capacity for OAP instances"
default = "c5.xlarge"
}
variable "ui_instance_type" {
type = string
description = "CPU, memory, storage and networking capacity for UI instances"
default = "t2.medium"
}
variable "public_key_path" {
type = string
description = "Path to store the key file for SSH access to the instances."
default = "~/.ssh"
}
variable "extra_tags" {
description = "Additional tags to be added to all resources"
type = map(string)
default = {}
}
## VPC
variable "cidr" {
type = string
description = "CIDR for database tier"
default = "11.0.0.0/16"
}
variable "private_subnets" {
type = set(string)
description = "CIDR used for private subnets"
default = ["11.0.1.0/24", "11.0.2.0/24", "11.0.3.0/24"]
}
variable "public_subnets" {
type = set(string)
description = "CIDR used for public subnets"
default = ["11.0.101.0/24", "11.0.102.0/24", "11.0.103.0/24"]
}
variable "database_subnets" {
type = set(string)
description = "CIDR used for database subnets"
default = ["11.0.104.0/24", "11.0.105.0/24", "11.0.106.0/24"]
}
## Storage
variable "storage" {
description = "Storage configuration for SkyWalking OAP"
type = object({
h2 = optional(object({}))
rds_postgresql = optional(object({
db_storage_size_gb = optional(number)
db_max_storage_size_gb = optional(number)
db_instance_class = optional(string)
db_name = optional(string)
db_username = optional(string)
db_password = optional(string)
}))
elasticsearch = optional(object({
domain_name = optional(string)
version = optional(string)
instance_type = optional(string)
instance_count = optional(number)
additional_security_groups = optional(list(string))
zone_awareness_enabled = optional(bool)
availability_zone_count = optional(number)
ebs_enabled = optional(bool)
}))
})
default = {
h2 = {}
}
validation {
condition = length([for storage, value in var.storage : storage if value != null]) == 1
error_message = "Please only set one storage type."
}
}
variable "create_lb" {
type = bool
description = "Create load balancer for SkyWalking UI"
default = true
}