CodexBloom - Programming Q&A Platform

OCI Resource Manager Not Applying Changes in State File After Terraform Apply

๐Ÿ‘€ Views: 404 ๐Ÿ’ฌ Answers: 1 ๐Ÿ“… Created: 2025-06-08
oci terraform resource-manager hcl

I'm integrating two systems and I tried several approaches but none seem to work... I've been using OCI Resource Manager with Terraform to manage my infrastructure, and I'm running into a frustrating issue. After running `terraform apply`, it seems like the changes I've made in my Terraform configuration are not being reflected in the state file. Instead, the output shows 'No changes required' even when I have modified some resource attributes. Hereโ€™s a snippet of my Terraform configuration: ```hcl resource "oci_core_instance" "my_instance" { availability_domain = "<your_availability_domain>" compartment_id = "<your_compartment_id>" display_name = "MyInstance" image = "<your_image_id>" shape = "VM.Standard2.1" network_interface { subnet_id = "<your_subnet_id>" ip_address = "<your_ip_address>" } } ``` I recently changed the `shape` attribute from `VM.Standard2.1` to `VM.Standard2.2`, but when I run `terraform apply`, it still tells me that no changes are required. Iโ€™ve also ensured that Iโ€™m using the latest version of the OCI provider: ```hcl provider "oci" { version = ">= 4.0.0" } ``` Iโ€™ve tried using `terraform plan` to see if there are expected changes, and it shows the same message about no changes detected. I even stopped and restarted the Resource Manager stack, but it didn't help. Could this be an issue with how the OCI Resource Manager handles state files? Are there any best practices I should follow when working with OCI and Terraform to ensure that changes are properly applied? Any insights or workarounds would be greatly appreciated. I'm working with Hcl in a Docker container on Windows 10. Has anyone else encountered this?