Skip to content

Commit 86c6204

Browse files
Aniket Limayesagarp337
authored andcommitted
Bug Fix - Populate user resource optional fields only if they arent empty
1 parent 0951ce8 commit 86c6204

27 files changed

+294
-75
lines changed

examples/identity_domains/api_key.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ resource "oci_identity_domains_api_key" "test_api_key" {
4646
schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:apikey"]
4747

4848
#Optional
49-
attribute_sets = []
49+
attribute_sets = ["all"]
5050
attributes = ""
5151
authorization = var.api_key_authorization
5252
description = var.api_key_description
@@ -68,6 +68,13 @@ resource "oci_identity_domains_api_key" "test_api_key" {
6868
#must be a user that exists
6969
value = oci_identity_domains_user.test_user.id
7070
}
71+
72+
lifecycle {
73+
ignore_changes = [
74+
// ignore fields that will never be returned
75+
urnietfparamsscimschemasoracleidcsextensionself_change_user
76+
]
77+
}
7178
}
7279

7380
data "oci_identity_domains_api_keys" "test_api_keys" {

examples/identity_domains/auth_token.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ resource "oci_identity_domains_auth_token" "test_auth_token" {
4444
schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:authToken"]
4545

4646
#Optional
47-
attribute_sets = []
47+
attribute_sets = ["all"]
4848
attributes = ""
4949
authorization = var.auth_token_authorization
5050
description = var.auth_token_description
@@ -70,6 +70,14 @@ resource "oci_identity_domains_auth_token" "test_auth_token" {
7070
#must be a user that exists
7171
value = oci_identity_domains_user.test_user.id
7272
}
73+
74+
lifecycle {
75+
ignore_changes = [
76+
// ignore fields that will never be returned
77+
status,
78+
urnietfparamsscimschemasoracleidcsextensionself_change_user
79+
]
80+
}
7381
}
7482

7583
data "oci_identity_domains_auth_tokens" "test_auth_tokens" {

examples/identity_domains/authentication_factor_settings.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ resource "oci_identity_domains_authentication_factor_setting" "test_authenticati
477477
}
478478
user_enrollment_disabled_factors = var.authentication_factor_setting_user_enrollment_disabled_factors
479479
yubico_otp_enabled = var.authentication_factor_setting_yubico_otp_enabled
480+
lifecycle {
481+
ignore_changes = [schemas]
482+
}
480483
}
481484

482485
data "oci_identity_domains_authentication_factor_settings" "test_authentication_factor_settings" {

examples/identity_domains/customer_secret_key.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ resource "oci_identity_domains_customer_secret_key" "test_customer_secret_key" {
4848
schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:customerSecretKey"]
4949

5050
#Optional
51-
attribute_sets = []
51+
attribute_sets = ["all"]
5252
attributes = ""
5353
authorization = var.customer_secret_key_authorization
5454
description = var.customer_secret_key_description
@@ -75,6 +75,14 @@ resource "oci_identity_domains_customer_secret_key" "test_customer_secret_key" {
7575
#must be a user that exists
7676
value = oci_identity_domains_user.test_user.id
7777
}
78+
79+
lifecycle {
80+
ignore_changes = [
81+
// ignore fields that will never be returned
82+
status,
83+
urnietfparamsscimschemasoracleidcsextensionself_change_user
84+
]
85+
}
7886
}
7987

8088
data "oci_identity_domains_customer_secret_keys" "test_customer_secret_keys" {

examples/identity_domains/dynamic_resource_group.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ resource "oci_identity_domains_dynamic_resource_group" "test_dynamic_resource_gr
6666
schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:DynamicResourceGroup"]
6767

6868
#Optional
69-
attribute_sets = []
69+
attribute_sets = ["all"]
7070
attributes = ""
7171
authorization = var.dynamic_resource_group_authorization
7272
description = var.dynamic_resource_group_description
@@ -94,6 +94,9 @@ resource "oci_identity_domains_dynamic_resource_group" "test_dynamic_resource_gr
9494
value = var.dynamic_resource_group_urnietfparamsscimschemasoracleidcsextension_oci_tags_freeform_tags_value
9595
}
9696
}
97+
lifecycle {
98+
ignore_changes = [schemas]
99+
}
97100
}
98101

99102
data "oci_identity_domains_dynamic_resource_groups" "test_dynamic_resource_groups" {

examples/identity_domains/group.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ resource "oci_identity_domains_group" "test_group" {
129129
schemas = ["urn:ietf:params:scim:schemas:core:2.0:Group"]
130130

131131
#Optional
132-
attribute_sets = []
132+
attribute_sets = ["all"]
133133
attributes = ""
134134
authorization = var.group_authorization
135135
external_id = "externalId"
@@ -196,6 +196,9 @@ resource "oci_identity_domains_group" "test_group" {
196196
#Optional
197197
requestable = var.group_urnietfparamsscimschemasoracleidcsextensionrequestable_group_requestable
198198
}
199+
lifecycle {
200+
ignore_changes = [schemas]
201+
}
199202
}
200203

201204
data "oci_identity_domains_groups" "test_groups" {

examples/identity_domains/identity_domain.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ variable "identity_domain_id" {
66
data "oci_identity_domain" "test_domain" {
77
domain_id = var.identity_domain_id
88
}
9+
10+
11+
variable "identity_domain_id_for_my_endpoint" {
12+
default = ""
13+
}
14+
15+
data "oci_identity_domain" "test_domain_for_my_endpoint" {
16+
domain_id = var.identity_domain_id_for_my_endpoint
17+
}

examples/identity_domains/identity_provider.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ resource "oci_identity_domains_identity_provider" "test_identity_provider" {
335335

336336
#Optional
337337
assertion_attribute = var.identity_provider_assertion_attribute
338-
attribute_sets = []
338+
attribute_sets = ["all"]
339339
attributes = ""
340340
authn_request_binding = var.identity_provider_authn_request_binding
341341
authorization = var.identity_provider_authorization
@@ -447,6 +447,9 @@ resource "oci_identity_domains_identity_provider" "test_identity_provider" {
447447
}
448448
user_mapping_method = var.identity_provider_user_mapping_method
449449
user_mapping_store_attribute = var.identity_provider_user_mapping_store_attribute
450+
lifecycle {
451+
ignore_changes = [schemas]
452+
}
450453
}
451454

452455
data "oci_identity_domains_identity_providers" "test_identity_providers" {

examples/identity_domains/kmsi_setting.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ resource "oci_identity_domains_kmsi_setting" "test_kmsi_setting" {
5757
schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:KmsiSettings"]
5858

5959
#Optional
60-
attribute_sets = []
60+
attribute_sets = ["all"]
6161
attributes = ""
6262
authorization = var.kmsi_setting_authorization
6363
external_id = "externalId"

examples/identity_domains/my_api_key.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ variable "my_api_key_user_value" {
4949

5050
resource "oci_identity_domains_my_api_key" "test_my_api_key" {
5151
#Required
52-
idcs_endpoint = data.oci_identity_domain.test_domain.url
52+
idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url
5353
key = var.my_api_key_key
5454
schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:apikey"]
5555

@@ -73,11 +73,17 @@ resource "oci_identity_domains_my_api_key" "test_my_api_key" {
7373
}
7474
*/
7575

76+
lifecycle {
77+
ignore_changes = [
78+
// ignore fields that will never be returned
79+
tags
80+
]
81+
}
7682
}
7783

7884
data "oci_identity_domains_my_api_keys" "test_my_api_keys" {
7985
#Required
80-
idcs_endpoint = data.oci_identity_domain.test_domain.url
86+
idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url
8187

8288
#Optional
8389
my_api_key_count = var.my_api_key_my_api_key_count

0 commit comments

Comments
 (0)