Skip to content

Subject: Terraform OCI Core Subnet - 500 InternalError when creating multiple subnets #2478

@alan-silva

Description

@alan-silva

Description:

We are experiencing an issue when attempting to create multiple subnets simultaneously in a VCN using the OCI Terraform provider.

Terraform Configuration Example:

resource "oci_core_subnet" "subnet1" {
compartment_id = "ocid1.compartment.oc1..xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
vcn_id = "ocid1.vcn.oc1.sa-saopaulo-1.xxxxxxxxxxxxxxxx"
display_name = "TESTE-IPAM-1"
cidr_block = "10.239.217.96/28"
prohibit_public_ip_on_vnic = true
}

resource "oci_core_subnet" "subnet2" {
compartment_id = "ocid1.compartment.oc1..xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
vcn_id = "ocid1.vcn.oc1.sa-saopaulo-1.xxxxxxxxxxxxxxxx"
display_name = "TESTE-IPAM-2"
cidr_block = "10.239.217.112/28"
prohibit_public_ip_on_vnic = true
depends_on = [oci_core_subnet.subnet1]
}

Observed Behavior:

When attempting to create both subnets simultaneously, Terraform fails with a 500 InternalError.

The error occurs even with non-overlapping CIDR blocks.

Creating a single subnet at a time succeeds without any issues.

Error message:

Error: 500-InternalError, Internal error occurred
Suggestion: The service for this resource encountered an error. Please contact support for help with service: Core Subnet
Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_subnet
API Reference: https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Subnet/CreateSubnet

Terraform Provider Version:

OCI provider version: 7.14.0 (also tested with 7.25.0, same behavior)

Could someone help me? There's no overlap on the network.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-affected-resourcesPlease Provide the affected resource name in description. ex. Affected resource - oci_core_instancebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions