This commit is contained in:
Djeeberjr 2022-12-03 15:06:26 +01:00
parent 7e8b54ff5f
commit 03837072fb
3 changed files with 13 additions and 13 deletions

12
dns.tf
View File

@ -3,10 +3,10 @@ resource "cloudflare_record" "dns_a1_flex" {
zone_id = var.cloudflare_zone_id zone_id = var.cloudflare_zone_id
name = "${each.key}.${var.base_domain}" name = "${each.key}.${var.base_domain}"
value = oci_core_instance.a1_flex_instances[each.key].public_ip value = oci_core_instance.a1_flex_instances[each.key].public_ip
type = "A" type = "A"
ttl = 1 # For automatic ttl = 1 # For automatic
} }
resource "cloudflare_record" "dns_e2_micro" { resource "cloudflare_record" "dns_e2_micro" {
@ -14,8 +14,8 @@ resource "cloudflare_record" "dns_e2_micro" {
zone_id = var.cloudflare_zone_id zone_id = var.cloudflare_zone_id
name = "${each.key}.${var.base_domain}" name = "${each.key}.${var.base_domain}"
value = oci_core_instance.e2_micro_instances[each.key].public_ip value = oci_core_instance.e2_micro_instances[each.key].public_ip
type = "A" type = "A"
ttl = 1 # For automatic ttl = 1 # For automatic
} }

View File

@ -1,7 +1,7 @@
terraform { terraform {
required_providers { required_providers {
oci = { oci = {
source = "oracle/oci" source = "oracle/oci"
version = "~> 4.100.0" version = "~> 4.100.0"
} }
cloudflare = { cloudflare = {

12
vcn.tf
View File

@ -29,7 +29,7 @@ resource "oci_core_default_route_table" "list" {
for_each = var.vcn for_each = var.vcn
manage_default_resource_id = oci_core_vcn.list[each.key].default_route_table_id manage_default_resource_id = oci_core_vcn.list[each.key].default_route_table_id
compartment_id = var.compartment_ocid compartment_id = var.compartment_ocid
route_rules { route_rules {
destination = "0.0.0.0/0" destination = "0.0.0.0/0"
@ -42,7 +42,7 @@ resource "oci_core_default_security_list" "list" {
for_each = var.vcn for_each = var.vcn
manage_default_resource_id = oci_core_vcn.list[each.key].default_security_list_id manage_default_resource_id = oci_core_vcn.list[each.key].default_security_list_id
compartment_id = var.compartment_ocid compartment_id = var.compartment_ocid
egress_security_rules { egress_security_rules {
destination = "0.0.0.0/0" destination = "0.0.0.0/0"
@ -117,7 +117,7 @@ resource "oci_core_default_security_list" "list" {
dynamic "ingress_security_rules" { dynamic "ingress_security_rules" {
for_each = each.value.firewall_rules for_each = each.value.firewall_rules
content { content {
description = ingress_security_rules.value.description description = ingress_security_rules.value.description
protocol = ingress_security_rules.value.is_udp ? "17" : "6" protocol = ingress_security_rules.value.is_udp ? "17" : "6"
@ -126,16 +126,16 @@ resource "oci_core_default_security_list" "list" {
dynamic "tcp_options" { dynamic "tcp_options" {
for_each = ingress_security_rules.value.is_udp ? [] : [1] for_each = ingress_security_rules.value.is_udp ? [] : [1]
content{ content {
max = ingress_security_rules.value.port_max max = ingress_security_rules.value.port_max
min = ingress_security_rules.value.port_min min = ingress_security_rules.value.port_min
} }
} }
dynamic "udp_options"{ dynamic "udp_options" {
for_each = ingress_security_rules.value.is_udp ? [1] : [] for_each = ingress_security_rules.value.is_udp ? [1] : []
content{ content {
max = ingress_security_rules.value.port_max max = ingress_security_rules.value.port_max
min = ingress_security_rules.value.port_min min = ingress_security_rules.value.port_min
} }