-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhub_vpc.tf
88 lines (86 loc) · 2.57 KB
/
hub_vpc.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
##############################################################################
# Default VPC
##############################################################################
resource "ibm_is_vpc" "hub_vpc" {
name = var.hub_vpc_name
resource_group = data.ibm_resource_group.group.id
}
##############################################################################
# Security Group for Public Load Balancer
##############################################################################
resource "ibm_is_security_group" "pub_alb_security_group" {
name = "${var.basename}-pub-alb-sg"
vpc = ibm_is_vpc.hub_vpc.id
resource_group = data.ibm_resource_group.group.id
}
resource "ibm_is_security_group_rule" "pub_alb_security_group_rule_tcp_443" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "inbound"
remote = "0.0.0.0/0"
tcp {
port_min = 443
port_max = 443
}
}
resource "ibm_is_security_group_rule" "pub_allb_security_group_rule_udp_443" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "inbound"
remote = "0.0.0.0/0"
udp {
port_min = 443
port_max = 443
}
}
resource "ibm_is_security_group_rule" "pub_alb_security_group_rule_tcp_22" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "inbound"
remote = "0.0.0.0/0"
tcp {
port_min = 22
port_max = 22
}
}
resource "ibm_is_security_group_rule" "pub_alb_security_group_rule_tcp_80" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "inbound"
remote = "0.0.0.0/0"
tcp {
port_min = 80
port_max = 80
}
}
resource "ibm_is_security_group_rule" "pub_alb_security_group_rule_icmp" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "inbound"
remote = "0.0.0.0/0"
icmp {
type = 8
}
}
resource "ibm_is_security_group_rule" "pub_alb_security_group_rule_tcp_80_outbound" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "outbound"
remote = "0.0.0.0/0"
tcp {
port_min = 80
port_max = 80
}
}
resource "ibm_is_security_group_rule" "pub_alb_security_group_rule_tcp_443_outbound" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "outbound"
remote = "0.0.0.0/0"
tcp {
port_min = 443
port_max = 443
}
}
resource "ibm_is_security_group_rule" "pub_alb_security_group_rule_tcp_22_outbound" {
group = ibm_is_security_group.pub_alb_security_group.id
direction = "outbound"
remote = "0.0.0.0/0"
tcp {
port_min = 22
port_max = 22
}
}