IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 667 forks source link

SCC Control Library not maintaining state during an update. #5637

Open tyao117 opened 1 month ago

tyao117 commented 1 month ago

Community Note

The terraform resource ibm_scc_control_library parses out the READ function incorrectly causing the terraform state to be skewed. This is a bug on the lifecycle of a resource.

Terraform CLI and Terraform IBM Provider Version

v1.69.1

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please share a link to the ZIP file.

Debug Output

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

tyao117 commented 1 week ago

from the stdout of the test: stdout:


        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place

        Terraform will perform the following actions:

          # ibm_scc_control_library.scc_control_library_instance will be updated in-place
          ~ resource "ibm_scc_control_library" "scc_control_library_instance" {
                id                          = "b934a69c-5020-44c9-baa0-c3e4fcfe349e/ed8a6d92-cf51-4939-b0d0-2b773fc22d30"
                # (16 unchanged attributes hidden)

              ~ controls {
                    # (7 unchanged attributes hidden)

                  ~ control_specifications {
                        # (8 unchanged attributes hidden)

                      - assessments {
                          - assessment_description = "test 2" -> null
                          - assessment_id          = "rule-f88e215f-bb33-4bd8-bd1c-d8a065e9aa70" -> null
                          - assessment_method      = "ibm-cloud-rule" -> null
                          - assessment_type        = "automated" -> null
                          - parameter_count        = 1 -> null

                          - parameters {
                              - parameter_display_name = "Maximum length of netmask bit that is considered as wide flow" -> null
                              - parameter_name         = "netmask_bits_length" -> null
                              - parameter_type         = "numeric" -> null
                            }
                        }
                      + assessments {
                          + assessment_description = "test 2"
                          + assessment_id          = "rule-f88e215f-bb33-4bd8-bd1c-d8a065e9aa70"
                          + assessment_method      = "ibm-cloud-rule"
                          + assessment_type        = "automated"
                          + parameter_count        = (known after apply)
                        }

                        # (1 unchanged block hidden)
                    }

                    # (1 unchanged block hidden)
                }
            }