Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions datadog-integration/modules/regional-stacks/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ data "oci_core_subnet" "provided_subnet" {
count = var.subnet_ocid != "" ? 1 : 0
subnet_id = var.subnet_ocid
}

data "oci_core_vcn" "dd_vcn" {
count = var.subnet_ocid == "" ? 1 : 0
vcn_id = module.vcn[0].vcn_id
}
35 changes: 34 additions & 1 deletion datadog-integration/modules/regional-stacks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module "vcn" {
vcn_cidrs = ["10.0.0.0/16"]
vcn_dns_label = "ddvcnmodule"
vcn_name = local.vcn_name
lockdown_default_seclist = false
lockdown_default_seclist = true

subnets = {
private = {
Expand All @@ -56,6 +56,39 @@ module "vcn" {
service_gateway_display_name = local.service_gateway
}

resource "oci_core_default_security_list" "dd_default" {
count = var.subnet_ocid == "" ? 1 : 0
manage_default_resource_id = data.oci_core_vcn.dd_vcn[0].default_security_list_id
freeform_tags = var.tags

egress_security_rules {
destination = "0.0.0.0/0"
protocol = "all"
destination_type = "CIDR_BLOCK"
}

# ICMP type 3 code 4: path MTU discovery (from anywhere)
ingress_security_rules {
protocol = "1"
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
icmp_options {
type = 3
code = 4
}
}

# ICMP type 3: destination unreachable (from within VCN)
ingress_security_rules {
protocol = "1"
source = "10.0.0.0/16"
source_type = "CIDR_BLOCK"
icmp_options {
type = 3
}
}
}

resource "oci_functions_application" "dd_function_app" {
compartment_id = var.compartment_ocid
display_name = "dd-function-app"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ data "oci_core_subnet" "provided_subnet" {
count = var.subnet_ocid != "" ? 1 : 0
subnet_id = var.subnet_ocid
}

data "oci_core_vcn" "dd_vcn" {
count = var.subnet_ocid == "" ? 1 : 0
vcn_id = module.vcn[0].vcn_id
}
35 changes: 34 additions & 1 deletion datadog-terraform-onboarding/modules/regional-stacks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module "vcn" {
vcn_cidrs = ["10.0.0.0/16"]
vcn_dns_label = "ddvcnmodule"
vcn_name = local.vcn_name
lockdown_default_seclist = false
lockdown_default_seclist = true

subnets = {
private = {
Expand All @@ -59,6 +59,39 @@ module "vcn" {
service_gateway_display_name = local.service_gateway
}

resource "oci_core_default_security_list" "dd_default" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because terraform behavior can sometimes deviate from OCI (even though extremely unlikely), probably best to at least run a "terraform plan" with these changes locally to verify. You can use the module generated here: https://dd.datad0g.com/integrations/oracle-cloud-infrastructure/add

And just reroute it to point to your local version

count = var.subnet_ocid == "" ? 1 : 0
manage_default_resource_id = data.oci_core_vcn.dd_vcn[0].default_security_list_id
freeform_tags = var.tags

egress_security_rules {
destination = "0.0.0.0/0"
protocol = "all"
destination_type = "CIDR_BLOCK"
}

# ICMP type 3 code 4: path MTU discovery (from anywhere)
ingress_security_rules {
protocol = "1"
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
icmp_options {
type = 3
code = 4
}
}

# ICMP type 3: destination unreachable (from within VCN)
ingress_security_rules {
protocol = "1"
source = "10.0.0.0/16"
source_type = "CIDR_BLOCK"
icmp_options {
type = 3
}
}
}

resource "oci_functions_application" "dd_function_app" {
compartment_id = var.compartment_ocid
display_name = "dd-function-app"
Expand Down