CodexBloom - Programming Q&A Platform

OCI Resource Manager: scenarios When Applying Terraform Plan with OCI Provider Version 3.0.0

👀 Views: 50 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-26
Terraform OCI Infrastructure-as-Code HCL

I'm learning this framework and I'm testing a new approach and After trying multiple solutions online, I still can't figure this out... I'm currently working on automating my infrastructure deployment with Oracle Cloud Infrastructure (OCI) Resource Manager using Terraform. However, I'm working with an scenario when I try to apply my Terraform plan after upgrading to the OCI provider version 3.0.0. The behavior I'm working with is: ``` behavior: InvalidParameter: The provided compartment ID is invalid. on main.tf line 10, in resource "oci_core_instance" "example_instance": 10: resource "oci_core_instance" "example_instance" { ``` I've verified that the compartment ID is correct and exists in my OCI account. I also double-checked my permissions and ensured that the IAM policies allow the necessary access. Before the upgrade, everything was working fine with version 2.0.0, and the relevant part of my `main.tf` file looks like this: ```hcl provider "oci" { region = "us-phoenix-1" tenancy_ocid = "<your_tenancy_ocid>" user_ocid = "<your_user_ocid>" fingerprint = "<your_fingerprint>" private_key_path = "<path_to_private_key>" } resource "oci_core_instance" "example_instance" { availability_domain = "<your_availability_domain>" compartment_id = "<your_compartment_id>" display_name = "example-instance" shape = "VM.Standard2.1" source_details { source_type = "image" image_id = "<your_image_id>" } } ``` I also tried reverting back to the older provider version (2.0.0) and the plan works perfectly, which suggests that the scenario is indeed related to the new version. Has anyone else experienced this scenario with the OCI provider upgrade, or could there be any breaking changes that I might have missed in the provider documentation? This issue appeared after updating to Hcl 3.10. I recently upgraded to Hcl stable. What am I doing wrong? Thanks for any help you can provide!