Skip to content

ibm_cm_account resource causing provider error on unchanged/second applyΒ #6590

@shemau

Description

@shemau

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

terraform -v
Terraform v1.12.2
on darwin_arm64

  • provider registry.terraform.io/gavinbunney/kubectl v1.19.0
  • provider registry.terraform.io/hashicorp/external v2.3.5
  • provider registry.terraform.io/hashicorp/helm v3.0.2
  • provider registry.terraform.io/hashicorp/kubernetes v2.37.1
  • provider registry.terraform.io/hashicorp/null v3.2.4
  • provider registry.terraform.io/hashicorp/random v3.7.2
  • provider registry.terraform.io/hashicorp/time v0.13.1
  • provider registry.terraform.io/ibm-cloud/ibm v1.82.1
  • provider registry.terraform.io/mastercard/restapi v2.0.1

Affected Resource(s)

  • ibm_cm_account

After running a terraform apply that successfully provisioned a cm account, with no changes to the configuration, a second apply that should work. In this case, the ibm_cm_account resource is reporting a

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

Terraform plan/apply output when provisioning

  # module.tfe.ibm_cm_account.cm_account_instance[0] will be created
  + resource "ibm_cm_account" "cm_account_instance" {
      + hide_ibm_cloud_catalog = (known after apply)
      + id                     = (known after apply)
      + rev                    = (known after apply)

      + account_filters (known after apply)

      + terraform_engines {
          + api_token        = (sensitive value)
          + name             = "tfe-engine"
          + private_endpoint = (known after apply)
          + public_endpoint  = (known after apply)
          + type             = "terraform-enterprise"

          + da_creation {
              + default_private_catalog_id = (known after apply)
              + enabled                    = false

              + polling_info {
                  + last_polling_status = (known after apply)

                  + scopes (known after apply)
                }
            }
        }
    }

terraform show output after provisioning



# module.tfe.ibm_cm_account.cm_account_instance[0]:
resource "ibm_cm_account" "cm_account_instance" {
    id  = "abac0df06b644a9cabc6e44f55b3880e"
    rev = "21-1ec9d9076fa0ba3336f088f5728372da"

    account_filters {
        include_all = true

        id_filters {
        }
    }

    terraform_engines {
        api_token        = (sensitive value)
        name             = "tfe-engine"
        private_endpoint = null
        public_endpoint  = "https://tfe-tfe.steve2-cluster-3b5bf5f75003778663c521c8c35ad277-0000.us-south.containers.appdomain.cloud"
        type             = "terraform-enterprise"

        da_creation {
            default_private_catalog_id = null
            enabled                    = false

            polling_info {
            }
        }
    }
}

Panic Output


╷
β”‚ Error: Provider produced inconsistent final plan
β”‚ 
β”‚ When expanding the plan for module.tfe.ibm_cm_account.cm_account_instance[0] to include new values learned so far during apply,
β”‚ provider "registry.terraform.io/ibm-cloud/ibm" produced an invalid new value for
β”‚ .terraform_engines[0].da_creation[0].polling_info[0].last_polling_status: was
β”‚ cty.ListValEmpty(cty.Object(map[string]cty.Type{"code":cty.Number, "message":cty.String})), but now null.
β”‚ 
β”‚ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Expected Behavior

The resource should not have changed. The plan did show

  # module.tfe.ibm_cm_account.cm_account_instance[0] will be updated in-place
  ~ resource "ibm_cm_account" "cm_account_instance" {
        id  = "abac0df06b644a9cabc6e44f55b3880e"
        # (1 unchanged attribute hidden)

      ~ terraform_engines {
            name             = "tfe-engine"
          ~ public_endpoint  = "https://tfe-tfe.steve2-cluster-3b5bf5f75003778663c521c8c35ad277-0000.us-south.containers.appdomain.cloud" -> (known after apply)
            # (3 unchanged attributes hidden)

          ~ da_creation {
                # (2 unchanged attributes hidden)

              ~ polling_info {
                  + last_polling_status = []
                }
            }
        }

        # (1 unchanged block hidden)
    }

but the values (except possibly last_polling_status[]) should not have changed. They would have been the same after they were known.

Actual Behavior

During the apply it failed during the plan/preparation phase, reported a provider error and requested an issue was raised.

Steps to Reproduce

  1. terraform apply (passed)
  2. terraform plan (no changes to ibm_cm_account reported)
  3. terraform apply (reports provider error during final plan)

Important Factoids

References

  • #0000

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions