Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The ibm_resource_tag do not detach if tag_type is access or service #5566

Closed
luiof opened this issue Aug 21, 2024 · 0 comments · Fixed by #5567
Closed

[Bug] The ibm_resource_tag do not detach if tag_type is access or service #5566

luiof opened this issue Aug 21, 2024 · 0 comments · Fixed by #5567
Labels
service/Global Tagging Issues related to Global Tagging service/Resource Management Issues related to Resource Manager or Resource controller Issues service/VPC Infrastructure Issues related to the VPC Infrastructure

Comments

@luiof
Copy link
Contributor

luiof commented Aug 21, 2024

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_resource_tag

Terraform Configuration Files

resource "ibm_resource_access_tag" "tag" {
  name = "tftest:pippo"
}
resource "ibm_is_ssh_key" "key" {
  name = "pluto"
  public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR"
}
resource "ibm_resource_tag" "tag" {
  resource_id = ibm_is_ssh_key.key.crn
  tags        = [ibm_resource_access_tag.tag.name]
  tag_type	= "access"
}

Debug Output

Panic Output

Expected Behavior

When we destroy the resources, we expect to destroy them without issues.
We expect that the attached tags on the created resources have been detached before the destroy.

Actual Behavior

We expect that the attached tags on the created resources have been detached before the destroy but this does not occur.
We get an error due to The tag can not be deleted because there are resources attached since the destroy on the ibm_resource_tag resource does not trigger a detach with the correct tag type.

image

When the ibm_is_ssh_key resource has been destroyed, the system requires some seconds (usually 1-3 seconds) to propagate the disappearing of the resource, so since the destroy on ibm_resource_access_tag resource starts immediately, we get the error.
We need to detach the tag before to delete the resource.

Steps to Reproduce

  1. terraform plan
  2. terraform apply
  3. terraform destroy

Important Factoids

References

  • #0000
@github-actions github-actions bot added service/Global Tagging Issues related to Global Tagging service/Resource Management Issues related to Resource Manager or Resource controller Issues service/VPC Infrastructure Issues related to the VPC Infrastructure labels Aug 21, 2024
@luiof luiof changed the title The ibm_resource_tag do not detach if tag_type is access or service [Bug] The ibm_resource_tag do not detach if tag_type is access or service Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Global Tagging Issues related to Global Tagging service/Resource Management Issues related to Resource Manager or Resource controller Issues service/VPC Infrastructure Issues related to the VPC Infrastructure
Projects
None yet
1 participant