-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvcn.tf
112 lines (106 loc) · 2.26 KB
/
vcn.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
locals {
subnet_cidr_block = "10.2.0.0/24"
# https://docs.k0sproject.io/v1.23.6+k0s.2/networking/?h=netw#required-ports-and-protocols
additional_default_securty_list_ingress_rules = [
# TCP 80 HTTP
{
protocol = "6"
source = local.subnet_cidr_block
tcp_options = {
min = 80
max = 80
}
},
# TCP 443 HTTPS
{
protocol = "6"
source = local.subnet_cidr_block
tcp_options = {
min = 443
max = 443
}
},
# TCP 2380 etcd peers
{
protocol = "6"
source = local.subnet_cidr_block
tcp_options = {
min = 2380
max = 2380
}
},
# TCP 6443 kube-apiserver
{
protocol = "6"
source = "0.0.0.0/0"
tcp_options = {
min = 6443
max = 6443
}
},
# TCP 179 kube-router
{
protocol = "6"
source = local.subnet_cidr_block
tcp_options = {
min = 179
max = 179
}
},
# UDP 4789 Calico
{
protocol = "17"
source = local.subnet_cidr_block
udp_options = {
min = 4789
max = 4789
}
},
# TCP 10250 kubelet
{
protocol = "6"
source = local.subnet_cidr_block
tcp_options = {
min = 10250
max = 10250
}
},
# TCP 9443 k0s-api
{
protocol = "6"
source = local.subnet_cidr_block
tcp_options = {
min = 9443
max = 9443
}
},
# TCP 8132 konnectivity
{
protocol = "6"
source = local.subnet_cidr_block
tcp_options = {
min = 8132
max = 8132
}
},
]
}
module "vcn" {
source = "./vcn"
vcn_name = "${var.name}-vcn"
vcn_cidrs = ["10.2.0.0/16"]
compartment_id = var.compartment_id
create_internet_gateway = true
lockdown_default_seclist = false
additional_default_securty_list_ingress_rules = local.additional_default_securty_list_ingress_rules
subnets = {
k0s = { name = var.name, cidr_block = local.subnet_cidr_block },
}
freeform_tags = {
managed_by = "terraform"
module = "oracle-terraform-modules/vcn/oci"
"component" = "vcn"
"environment" = "pro"
"part_of" = var.name
}
}