File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 22 * This example file shows how to create a compartment or reference an existing compartment as a resource.
33 *
44 * Note: the compartment resource internally resolves name collisions and returns a reference to the preexisting
5- * compartment. Compartments can not be deleted, so removing a compartment resource from your .tf file will only
6- * remove it from your statefile.
5+ * compartment by default. Use `enable_delete` to allow compartment deletion and prevent implicitly importing compartments.
76 */
87
98resource "oci_identity_compartment" "compartment1" {
109 name = " tf-example-compartment"
1110 description = " compartment created by terraform"
11+ compartment_id = " ${ var . tenancy_ocid } "
12+ enable_delete = false // true will cause this compartment to be deleted when running `terrafrom destroy`
1213}
1314
1415data "oci_identity_compartments" "compartments1" {
Original file line number Diff line number Diff line change 55resource "oci_identity_group" "group1" {
66 name = " tf-example-group"
77 description = " group created by terraform"
8+ compartment_id = " ${ var . tenancy_ocid } "
89}
910
1011resource "oci_identity_user_group_membership" "user-group-mem1" {
Original file line number Diff line number Diff line change 55resource "oci_identity_user" "user1" {
66 name = " tf-example-user"
77 description = " user created by terraform"
8+ compartment_id = " ${ var . tenancy_ocid } "
89}
910
1011data "oci_identity_users" "users1" {
You can’t perform that action at this time.
0 commit comments