-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
142 lines (121 loc) · 4.11 KB
/
Copy pathvariables.tf
File metadata and controls
142 lines (121 loc) · 4.11 KB
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
################################################################################
# Security Group
################################################################################
variable "create" {
description = "Whether to create security group and all rules"
type = bool
default = true
}
variable "name" {
description = "Name of security group"
type = string
}
variable "use_name_prefix" {
description = "Whether to use name_prefix or fixed name. Should be true to able to update security group name after initial creation"
type = bool
default = true
}
variable "description" {
description = "Description of security group"
type = string
default = "Security Group managed by Terraform"
}
variable "vpc_id" {
description = "ID of the VPC where to create security group"
type = string
}
variable "tags" {
description = "A mapping of tags to assign to security group"
type = map(string)
default = {}
}
################################################################################
# Ingress Rules
################################################################################
variable "ingress_rules" {
description = "Map of known ingress rules (from_port, to_port, protocol)"
type = map(list(any))
default = {
# Format: rule = [from_port, to_port, protocol]
"_" = [0, 0, "-1"]
"http" = [80, 80, "tcp"]
"https" = [443, 443, "tcp"]
"ssh" = [22, 22, "tcp"]
"postgresql" = [5432, 5432, "tcp"]
"mysql" = [3306, 3306, "tcp"]
"mongodb" = [27017, 27017, "tcp"]
"redis" = [6379, 6379, "tcp"]
}
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
type = list(string)
default = []
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
type = list(string)
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
type = list(map(string))
default = []
}
variable "ingress_with_ipv6_cidr_blocks" {
description = "List of ingress rules to create where 'ipv6_cidr_blocks' is used"
type = list(map(string))
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
type = list(map(string))
default = []
}
################################################################################
# Egress Rules
################################################################################
variable "egress_rules" {
description = "Map of known egress rules (from_port, to_port, protocol)"
type = map(list(any))
default = {
# Format: rule = [from_port, to_port, protocol]
"_" = [0, 0, "-1"]
"http" = [80, 80, "tcp"]
"https" = [443, 443, "tcp"]
"postgresql" = [5432, 5432, "tcp"]
"mysql" = [3306, 3306, "tcp"]
"mongodb" = [27017, 27017, "tcp"]
"redis" = [6379, 6379, "tcp"]
}
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
type = list(string)
default = ["::/0"]
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
type = list(map(string))
default = []
}
variable "egress_with_ipv6_cidr_blocks" {
description = "List of egress rules to create where 'ipv6_cidr_blocks' is used"
type = list(map(string))
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
type = list(map(string))
default = []
}
variable "rules" {
description = "Map of security group rules with their configurations"
type = map(any)
default = {}
}