terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

Error in Terraform operations after manual deletion of resources

Open hoiwingh opened this issue 1 year ago • 3 comments
trafficstars

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

Affected Resource(s)

  • ibm_XXXXX

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

After a terraform deployed resource is manually deleted, subsequent operations (e.g. plan, destroy) should still succeed.

Actual Behavior

After a terraform deployed resource is manually deleted, subsequent operations (e.g. plan, destroy) failed.

We tried these operations via IBM Schematics, which got a 403 error.

Schematics team suspects that when resources are deleted outside terraform, the next terraform actions fail to update the state file correctly.

Steps to Reproduce

Manually delete a terraform deployed resource and then run a plan or destroy.

  1. terraform apply

Important Factoids

References

  • #0000

hoiwingh avatar Jan 10 '24 15:01 hoiwingh

Can you provide the list of resources involved ?

uibm avatar Jan 18 '24 05:01 uibm

Here's the list of resource types involved. In my case, I have deleted a resource cos_instance of type ibm_resource_instance. Note that it works fine if I rename it (as opposed to deleting).

ibm_cd_toolchain_tool_hostedgit
ibm_cos_bucket
ibm_resource_instance
null_resource
ibm_iam_access_group_policy
ibm_resource_group
external
gitlab_repository_file
ibm_cd_tekton_pipeline
ibm_cd_toolchain_tool_pipeline
ibm_cd_toolchain_tool_hostedgit
ibm_iam_access_group
ibm_cd_tekton_pipeline_definition
ibm_cd_tekton_pipeline_property
ibm_cd_tekton_pipeline_property
ibm_cd_tekton_pipeline_property
ibm_cd_tekton_pipeline_property
ibm_cd_tekton_pipeline_property
ibm_cd_tekton_pipeline_property
ibm_cd_tekton_pipeline_trigger
ibm_cd_toolchain
ibm_resource_group

hoiwingh avatar Jan 18 '24 17:01 hoiwingh

@ujjwal-ibm - any update?

hoiwingh avatar Jan 31 '24 15:01 hoiwingh