Open jz-latitude opened 3 days ago
https://github.com/okta/terraform-provider-okta/pull/2032 a PR was created
What is the tf script you're using?
@duytiennguyen-okta
this is my tf file:
data "okta_user_profile_mapping_source" "user" {}
resource "okta_profile_mapping" "custom-mappings" {
for_each = toset( [
var.app_one,
var.app_two,
] )
source_id = data.okta_user_profile_mapping_source.user.id
target_id = each.key
delete_when_absent = false // Warning: do not remove! some mappings are inherited from "okta" user profile and are not declared here
always_apply = true
mappings {
id = "birthdate"
expression = "user.${okta_user_schema_property.date_of_birth.index}"
push_status = "PUSH"
}
}
we have some mappings set outside of terraform, after using the latest one, although setting delete_when_absent = false
, terraform will plan to delete them.
+1
Community Note
Terraform Version
~> 1.0.0
terraform-provider-okta Version
~> 4.9.0
Affected Resource(s)
-> resource_okta_profile_mapping
Terraform Configuration Files
Debug Output
DELETEWHENABSENT:false type: bool, ok: false
Panic Output
Expected Behavior
if "delete_when_absent" set to false, it should not delete existing mappings on the server.
Can this be done in the Admin UI?
Can this be done in the actual API call?
Actual Behavior
it plans to delete the change outside of Terraform.
Steps to Reproduce
terraform apply
Important Factoids
References
https://github.com/okta/terraform-provider-okta/pull/2004/files
Analysis
v, ok := d.GetOK() return the value and ok , but ok means if the value is ZeorValue, However boolean's ZeorValue is false, so when the field was set to
false
,ok
is false0000