terraform-provider-oci
terraform-provider-oci copied to clipboard
Cannot create child compartment inside a parent compartment which is already in a Security Zone
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 v1.1.9 on linux_amd64
- provider registry.terraform.io/oracle/oci v4.89.0
Affected Resource(s)
oci_identity_compartment
Terraform Configuration Files
resource "oci_identity_compartment" "test-cmpt" {
name = "test-cmpt"
compartment_id = oci_identity_compartment.parent-cmpt.id
description = "Test Compartment"
lifecycle {
ignore_changes = [
defined_tags["Oracle-Tags.CreatedBy"],
defined_tags["Oracle-Tags.CreatedOn"]
]
}
}
resource "oci_cloud_guard_security_zone" "parent-security-zone" {
#Required
compartment_id = oci_identity_compartment.parent-cmpt.id
display_name = "ParentSecurityZone"
security_zone_recipe_id = oci_cloud_guard_security_recipe.default_security_recipe.id
}
Copy-paste your Terraform configurations here - for large Terraform configs,
please use a service like Dropbox and share a link to the ZIP file.
Please remove any sensitive information from configuration files before sharing them.
### Debug Output
[<!---
Please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
To obtain the debug output, see the [Verbose logging for OCI Terraform Provider](https://www.terraform.io/docs/providers/oci/guides/troubleshooting.html#verbose-logging-for-oci-terraform-provider).
Github Gist: https://gist.github.com/
--->]
(https://gist.github.com/kmj251/10a32731153794d3e43c6d312edc9648)
### Panic Output
<!---
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`.
Github Gist: https://gist.github.com/
--->
### Expected Behavior
Using the GUI/Website, I can create the child compartment in the parent compartment without issues. I expect the Terraform module to do the same.
### Actual Behavior
I get an error.
### Steps to Reproduce
Create a generic security zone with the compartment_id set to the parent compartment and attach a recipe.
Try to create sub-compartment to the parent compartment.
1. `terraform apply`
### Important Factoids
No
### References
<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:
--->