Skip to content

Commit 3e2d458

Browse files
andrecorreanetorrywhenHalimer
authored
Release 0.2.7 (#35)
* Release 0.2.1 * Release 0.2.2 * feat: TF < 1.3.0 restriction removed * feat: TF binary equal or greater than 1.3.0 requirement added * chore: release notes and version bump * chore: release notes, tag and SPECs updated * fix typo in dynamic groups that refered to domain groups * fix: version = "<= 5.16.0" removed * chore: release notes, version and spec updated * feat: OCI FW and ZPR IAM policies added * feat: examples updated * chore: release notes and version update * chore: release notes updated. * fix: attribute_sets = ["all"] added to oci_identity_domains_group * chore: release notes and version increment * fix: preventing username dupes to fail user lookup * fix: ignoring username dupes that can be provided as input * chore: release notes a version increment * chore: release date updated * feat: debug flag added * fix: user lookup only checks ACTIVE users * chore: release notes updated * doc: SPEC.md updated --------- Signed-off-by: Andre Correa <andre.correa@oracle.com> Co-authored-by: Rory Nguyen <rory.nguyen@oracle.com> Co-authored-by: josh_hammer <josh.hammer@oracle.com>
1 parent 0ed42e6 commit 3e2d458

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

RELEASE-NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# January 10, 2025 Release Notes - 0.2.7
2+
## Updates
3+
1. [Groups module](./groups/)
4+
- Only ACTIVE users are looked up for group membership assignments.
5+
6+
17
# December 09, 2024 Release Notes - 0.2.6
28
## Updates
39
1. [Identity Domains module](./identity-domains/)

groups/SPEC.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ No modules.
2626

2727
| Name | Description | Type | Default | Required |
2828
|------|-------------|------|---------|:--------:|
29-
| <a name="input_groups_configuration"></a> [groups\_configuration](#input\_groups\_configuration) | The groups configuration. | <pre>object({<br> default_defined_tags = optional(map(string)),<br> default_freeform_tags = optional(map(string))<br> groups = map(object({<br> name = string,<br> description = string,<br> members = optional(list(string)),<br> defined_tags = optional(map(string)),<br> freeform_tags = optional(map(string))<br> }))<br> })</pre> | `null` | no |
29+
| <a name="input_groups_configuration"></a> [groups\_configuration](#input\_groups\_configuration) | The groups configuration. | <pre>object({<br> enable_debug = optional(bool,false)<br> default_defined_tags = optional(map(string)),<br> default_freeform_tags = optional(map(string))<br> groups = map(object({<br> name = string,<br> description = string,<br> members = optional(list(string)),<br> defined_tags = optional(map(string)),<br> freeform_tags = optional(map(string))<br> }))<br> })</pre> | `null` | no |
3030
| <a name="input_module_name"></a> [module\_name](#input\_module\_name) | The module name. | `string` | `"iam-groups"` | no |
3131
| <a name="input_tenancy_ocid"></a> [tenancy\_ocid](#input\_tenancy\_ocid) | The OCID of the tenancy. | `string` | n/a | yes |
3232

3333
## Outputs
3434

3535
| Name | Description |
3636
|------|-------------|
37+
| <a name="output_debug_ignored_users"></a> [debug\_ignored\_users](#output\_debug\_ignored\_users) | (Debug) Ignored users. |
3738
| <a name="output_groups"></a> [groups](#output\_groups) | The groups. |
3839
| <a name="output_memberships"></a> [memberships](#output\_memberships) | The group memberships. |

groups/main.tf

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
data "oci_identity_users" "these" {
5-
compartment_id = var.tenancy_ocid
5+
count = length(local.group_memberships) > 0 ? 1 : 0
6+
compartment_id = var.tenancy_ocid
7+
state = "ACTIVE"
68
}
79

810
resource "oci_identity_group" "these" {
@@ -15,13 +17,16 @@ resource "oci_identity_group" "these" {
1517
}
1618

1719
resource "oci_identity_user_group_membership" "these" {
18-
for_each = { for m in local.group_memberships : "${m.group_key}.${m.user_name}" => m }
20+
for_each = { for m in local.group_memberships : "${m.group_key}.${m.user_name}" => m... if contains(keys(local.users),m.user_name)}
1921
group_id = oci_identity_group.these[split(".",each.key)[0]].id
20-
user_id = local.users[each.value.user_name].id
22+
user_id = local.users[each.value[0].user_name].id
2123
}
2224

2325
locals {
24-
users = { for u in data.oci_identity_users.these.users : u.name => u }
26+
all_users = [ for u in try(data.oci_identity_users.these[0].users,[]) : u ]
27+
users = { for u in local.all_users : u.name => u if length([ for u1 in local.all_users : u1.name if u1.name == u.name]) == 1 }
28+
29+
#users = { for u in try(data.oci_identity_users.these.users,[]) : u.name => u... }
2530

2631
group_memberships = flatten([
2732
for k, v in (var.groups_configuration != null ? var.groups_configuration.groups : {}) : [

groups/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ output "groups" {
99
output "memberships" {
1010
description = "The group memberships."
1111
value = oci_identity_user_group_membership.these
12+
}
13+
14+
output "debug_ignored_users" {
15+
description = "(Debug) Ignored users."
16+
value = try(var.groups_configuration.enable_debug,false) ? [ for u in local.all_users : {"id": u.id, "email": u.email, "name" : u.name} if length([ for u1 in local.all_users : u1.name if u1.name == u.name]) > 1 ] : null
1217
}

groups/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ variable "tenancy_ocid" {
99
variable "groups_configuration" {
1010
description = "The groups configuration."
1111
type = object({
12+
enable_debug = optional(bool,false)
1213
default_defined_tags = optional(map(string)),
1314
default_freeform_tags = optional(map(string))
1415
groups = map(object({

release.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.6
1+
0.2.7

0 commit comments

Comments
 (0)