Closed aussietexan closed 1 year ago
Hey @aussietexan if your parameter has no data, yo may don't put it, this may solve your problem:
resource "ciscoise_active_directory" "tui-ad" {
provider = ciscoise
parameters {
ad_attributes {
# attributes {}
}
ad_scopes_names = "Default_Scope"
adgroups {
# groups {}
}
description = ""
domain = var.domain_name
name = var.join_point_name
}
}
You can do it like this too:
resource "ciscoise_active_directory" "tui-ad" {
provider = ciscoise
parameters {
# ad_attributes {
# # attributes {}
# }
ad_scopes_names = "Default_Scope"
# adgroups {
# # groups {}
# }
description = ""
domain = var.domain_name
name = var.join_point_name
}
}
Hi @fmunozmiranda. Commenting out the groups field does fix the idempotence issue.
However, I've also found that the 'ciscoise_active_directory_get_groups_by_domain_info' data source does not appear to capture the group name correctly. Please tell me if I'm missing something.
TF code blocks
data "ciscoise_active_directory_get_groups_by_domain_info" "get_ad_groups" {
provider = ciscoise.ise31-2
id = ciscoise_active_directory.tui-ad.parameters[0].id
additional_data {
name = "domain"
value = var.domain_name
}
additional_data {
name = "filter"
value = "*Domain Computers*"
}
}
output "ad_groups" {
value = data.ciscoise_active_directory_get_groups_by_domain_info.get_ad_groups
}
Output
ad_groups = {
"additional_data" = tolist([
{
"name" = "domain"
"value" = "domain.com"
},
{
"name" = "filter"
"value" = "*Domain Computers*"
},
])
"id" = "1666148433"
"item" = tolist([
{
"groups" = tolist([
{
"group_name" = ""
"sid" = "S-1-5-21-3064845550-2309088537-4239914413-515"
"type" = "GLOBAL"
},
])
},
])
}
API call response for '/ers/config/activedirectory/{{ad_id}}/getGroupsByDomain'
{
"ERSActiveDirectoryGroups": {
"groups": [
{
"name": "domain.com/Users/Domain Computers",
"sid": "S-1-5-21-3064845550-2309088537-4239914413-515",
"type": "GLOBAL"
}
]
}
}
@aussietexan , could you please try it again with 0.6.10-beta a tell us if it now works for you?
Hi @fmunozmiranda. The updated code fixes the data source output and I was able to reference those values in another resource block. Thanks for the quick turnaround!
Thank you for reporting, it helps us improve.
Environment:
Describe the bug Using the resource 'ciscoise_active_directory' with the required parameters works as expected to create an AD Join Point, but any subsequent 'terraform apply' operation results in the below error. Even running 'terraform apply' directly after the initial resource creation with no changes to the terraform code results in the same error.
Error
Code block
Expected behavior Terraform state should take care of the idempotence, so 'terraform apply' should only update resources as needed.