Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply doesn't fail when provided subnet id is not directly under specified compartment #2279

Open
vishu42 opened this issue Jan 20, 2025 · 0 comments
Labels

Comments

@vishu42
Copy link

vishu42 commented Jan 20, 2025

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

terraform cli version - Terraform v1.10.4
provider version - 6.21

Affected Resource(s)

oci_core_instance
(could be more resources)

Terraform Configuration Files

# in this example, the subnet_id does not exist in the specified compartment_id, now this apply should throw an error but it gets successfully applied and in the cloud ui I see no resource
# the compartment_id in this case is the parent compartment where the subnet resides

resource "oci_core_instance" "oracle_instance" {
  availability_domain = "axUL:ME-JEDDAH-1-AD-1"
  compartment_id      = "<compartment_id>"
  shape               = "VM.Standard2.8"
  source_details {
    source_id   = "ocid1.image.oc1.me-jeddah-1.aaaaaaaay5ws62koywehkkcdvecqd6bjrruwrrwortzsi6xgxefltwxsaaba"
    source_type = "image"
  }
  create_vnic_details {
    subnet_id        = "<subnet_id>"
    assign_public_ip = true
  }
  display_name = "my-ubuntu-instance-negative"
}

Debug Output

Github Gist: https://gist.github.com/vishu42/49aedbc103b90596a86496c14996db97

Panic Output

Expected Behavior

  • apply should result in an error or I should see an instance resource in the cloud

Actual Behavior

  • plan and apply were successful
  • i see no resource in the oracle cloud ui

Steps to Reproduce

  • try to create an oci_core_instance resource while meeting following conditions
  • have a subnet with a compartment hierarchy like compartment-a --> compartment-b --> subnet
  • mention subnet_id and compartment-a_id in the oci_core_instance configuration
  • do terraform apply
@vishu42 vishu42 added the bug label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant