Skip to content

Commit ecf943c

Browse files
authored
Merge pull request #9 from oracle-terraform-modules/dev
Update required variables.
2 parents 2e3d9ad + 75a3af6 commit ecf943c

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

modules/iam-compartment/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
########################
66

77
resource "oci_identity_compartment" "this" {
8-
count = "${var.compartment_create ? 1 : 0}"
9-
name = "${var.compartment_name}"
10-
description = "${var.compartment_description}"
8+
count = "${var.compartment_create ? 1 : 0}"
9+
compartment_id = "${var.tenancy_ocid}"
10+
name = "${var.compartment_name}"
11+
description = "${var.compartment_description}"
1112
}
1213

1314
data "oci_identity_compartments" "this" {

modules/iam-dynamic-group/variables.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ variable "dynamic_group_name" {
88
description = "The name you assign to the group during creation. The name must be unique across all compartments in the tenancy. "
99
}
1010

11-
// The description is only used if dynamic_group_create = true.
1211
variable "dynamic_group_description" {
1312
description = "The description you assign to the Group. Does not have to be unique, and it's changeable. "
1413
default = ""
1514
}
1615

1716
variable "dynamic_group_create" {
18-
description = "Create the group or not. If true, the user must have permissions to create the group; If false, group data will be returned about the group if it exists, if not found, then an empty string will be returned for the group ID."
17+
description = "Create the dynamic group or not. If true, the user must have permissions to create the group; If false, group data will be returned about the group if it exists, if not found, then an empty string will be returned for the group ID."
1918
default = true
2019
}
2120

modules/iam-group/main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
# Group
55
########################
66
resource "oci_identity_group" "this" {
7-
count = "${var.group_create ? 1 : 0}"
8-
name = "${var.group_name}"
9-
description = "${var.group_description}"
7+
count = "${var.group_create ? 1 : 0}"
8+
compartment_id = "${var.tenancy_ocid}"
9+
name = "${var.group_name}"
10+
description = "${var.group_description}"
1011
}
1112

1213
data "oci_identity_groups" "this" {
@@ -31,7 +32,8 @@ resource "oci_identity_user_group_membership" "this" {
3132
# https://github.com/hashicorp/terraform/issues/12570
3233
# count = "${length(var.user_ids)}"
3334
# use workaround here
34-
count = "${var.user_count}"
35+
count = "${var.user_count}"
36+
3537
user_id = "${var.user_ids[count.index]}"
3638
group_id = "${var.group_create ? element(concat(oci_identity_group.this.*.id, list("")), 0) : lookup(local.group_ids[0], "id")}"
3739
}

modules/iam-user/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
# User
55
########################
66
resource "oci_identity_user" "this" {
7-
count = "${var.user_create ? 1 : 0}"
8-
name = "${var.user_name}"
9-
description = "${var.user_description}"
7+
count = "${var.user_create ? 1 : 0}"
8+
compartment_id = "${var.tenancy_ocid}"
9+
name = "${var.user_name}"
10+
description = "${var.user_description}"
1011
}
1112

1213
data "oci_identity_users" "this" {

modules/iam-user/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ variable "user_description" {
1515
}
1616

1717
variable "user_create" {
18-
description = "Create the group or not. If true, the user must have permissions to create the user; If false, user data will be returned about the user if it exists, if not found, then an empty string will be returned for the user ID."
18+
description = "Create the user or not. If true, the user must have permissions to create the user; If false, user data will be returned about the user if it exists, if not found, then an empty string will be returned for the user ID."
1919
default = true
2020
}

0 commit comments

Comments
 (0)