-
Notifications
You must be signed in to change notification settings - Fork 0
/
security-lists.tf
57 lines (49 loc) · 1.35 KB
/
security-lists.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
##########################
## Create Security List ##
##########################
# Local Variables for Security Lists
locals {
tcp_protocol = "6"
udp_protocol = "17"
icmp_protocol = "1"
icmp_v6_protocol = "58"
all_protocols = "all"
anywhere = "0.0.0.0/0"
}
# Create a Security List for the Public Subnet
resource "oci_core_security_list" "public_security_list"{
compartment_id = oci_identity_compartment.compartment.id
vcn_id = oci_core_vcn.vcn.id
display_name = "${var.app_name}-${var.environment}-public-security-list"
# RDP TCP Port 3389 from anywhere
ingress_security_rules {
description = "RDP TCP Port 3389"
stateless = false
protocol = local.tcp_protocol
source = local.anywhere
source_type = "CIDR_BLOCK"
tcp_options {
min = 3389
max = 3389
}
}
# HTTPS TCP Port 443 from anywhere
ingress_security_rules {
description = "HTTPS TCP Port 443"
stateless = false
protocol = local.tcp_protocol
source = local.anywhere
source_type = "CIDR_BLOCK"
tcp_options {
min = 443
max = 443
}
}
# Egress all
egress_security_rules {
description = "Egress all"
stateless = false
protocol = local.tcp_protocol
destination = local.anywhere
}
}