feat(oci private network): add default route table and security list

management
This commit is contained in:
Kat Inskip 2024-06-09 12:28:03 -07:00
parent 07cbaca206
commit fea4a43dcc
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
6 changed files with 47 additions and 16 deletions

View file

@ -0,0 +1,13 @@
resource "oci_core_default_route_table" "this" {
manage_default_resource_id = oci_core_vcn.this.default_route_table_id
display_name = oci_core_vcn.this.display_name
route_rules {
network_entity_id = oci_core_internet_gateway.this.id
description = "Default route"
destination = "0.0.0.0/0"
}
}

View file

@ -0,0 +1,26 @@
resource "oci_core_default_security_list" "this" {
manage_default_resource_id = local.vcn.default_security_list_id
dynamic "ingress_security_rules" {
for_each = [22, 80, 443]
iterator = port
content {
protocol = local.protocol_number.tcp
source = "0.0.0.0/0"
description = "SSH and HTTPS traffic from any origin"
tcp_options {
max = port.value
min = port.value
}
}
}
egress_security_rules {
destination = "0.0.0.0/0"
protocol = "all"
description = "All traffic to any destination"
}
}

View file

@ -0,0 +1,8 @@
locals {
protocol_number = {
icmp = 1
icmpv6 = 58
tcp = 6
udp = 17
}
}

View file

@ -5,15 +5,6 @@ resource "oci_core_network_security_group" "this" {
display_name = oci_core_vcn.this.display_name
}
locals {
protocol_number = {
icmp = 1
icmpv6 = 58
tcp = 6
udp = 17
}
}
resource "oci_core_network_security_group_security_rule" "icmp_in" {
direction = "INGRESS"
network_security_group_id = oci_core_network_security_group.this.id

View file

@ -1,11 +1,4 @@
locals {
protocol_number = {
icmp = 1
icmpv6 = 58
tcp = 6
udp = 17
}
shapes = {
flex : "VM.Standard.A1.Flex",
micro : "VM.Standard.E2.1.Micro",