Open in-1911 opened 2 months ago
A variation of this problem also happens in the following scenario:
["AI Security Guardrails 2.0"]
) with default value for RG scope (i.e. []
)I get an error indicating that there is an issue in the provider itself when it tries to read/map the scope parameters and gets the new values from the RG exclusion entries:
2024/09/11 18:32:31 Terraform refresh | Error: Error setting scope: scope.0.properties.2.value: ''
expected type 'string', got unconvertible type '[]interface {}', value:
'[map[scope_id:a1***39 scope_type:account.resource_group]
map[scope_id:5b***09 scope_type:account.resource_group]
map[scope_id:8e***f3 scope_type:account.resource_group]
map[scope_id:ea***cc scope_type:account.resource_group]
map[scope_id:07***f4 scope_type:account.resource_group]
map[scope_id:5d***51 scope_type:account.resource_group]
map[scope_id:70***18 scope_type:account.resource_group]]'
2024/09/11 18:32:31 Terraform refresh |
2024/09/11 18:32:31 Terraform refresh | with module.create_profile_attachment["AI Security Guardrails 2.0"].ibm_scc_profile_attachment.scc_profile_attachment,
2024/09/11 18:32:31 Terraform refresh | on .terraform/modules/create_profile_attachment/modules/attachment/main.tf line 64, in resource "ibm_scc_profile_attachment" "scc_profile_attachment":
2024/09/11 18:32:31 Terraform refresh | 64: resource "ibm_scc_profile_attachment" "scc_profile_attachment" {
It looks like any change to the attachment in SCC after deployment will cause the scope to get updated with []
as exclusion list and it will make the schematics state effectively invalid because now it cannot be refreshed - that []
value will always cause a read error.
Then the SCC DA cannot be undeployed or its inputs updated, the only way out is to clean up schematics workspace and delete the DA.
@jor2 - the case that you submitted above is a different issue. The error you show in the output indicates that you did not supply a parameter that is required, but no default value is in the profile. This is not the same as the scope read error above.
Tried to use an RG scope for an attachment. I set the
resource_groups_scope
with one resource group name in the array. This was done after the SCC instance with a profile attachment for "AI Security Guardrails 2.0" has been deployed (originally using [] for the RG scope). When trying to update the deployment with the new RG scope, I got an error on apply (plan was successful):So I tried to change the RG scope back to
[]
but then somehow the schematics state got themodule.create_profile_attachment["AI Security Guardrails 2.0"].ibm_scc_profile_attachment.scc_profile_attachment
resource stuck with a non-empty value that it cannot refresh and I cannot even undeploy the config:Affected modules
*
Terraform CLI and Terraform provider versions
Terraform output
Debug output
Expected behavior
Actual behavior
Steps to reproduce (including links and screen captures)
terraform apply
Anything else
By submitting this issue, you agree to follow our Code of Conduct