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

ibm_schematics_agent_deploy doesn't delete the deployed schematics agent on the terraform destroy #5475

Open
rajatagarwal-ibm opened this issue Jun 27, 2024 · 0 comments
Labels
service/Schematics Issues related to Schematics

Comments

@rajatagarwal-ibm
Copy link

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_schematics_agent_deploy

Terraform Configuration Files

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

resource "ibm_schematics_agent" "schematics_agent_instance" {
  agent_infrastructure {
    infra_type             =  "ibm_kubernetes"
    cluster_id             =   var.cluster_id
    cluster_resource_group = var.cluster_resource_group_id
    cos_instance_name      = var.cos_instance_name
    cos_bucket_name        = var.cos_bucket_name
    cos_bucket_region      = var.cos_bucket_region
  }
  agent_location      = var.agent_location
  description         = var.agent_description
  name                = var.agent_name
  resource_group      = var.agent_resource_group_id
  schematics_location = var.schematics_location
  version             = var.agent_version
}

resource "ibm_schematics_agent_deploy" "schematics_agent_deploy" {
  agent_id = ibm_schematics_agent.schematics_agent_instance.id
}

Debug Output

module.schematics_agent.ibm_schematics_agent.schematics_agent_instance: Destroying... [id=rajat-sa-agent.soA.68eb]
╷
│ Error: DeleteAgentDataWithContext failed Error while deleting the agent, agent provisioned resources are not destroyed completely
│ {
│     "StatusCode": 412,
│     "Headers": {
│         "Cache-Control": [
│             "no-store, no-cache='Set-Cookie, Set-Cookie2', must-revalidate, proxy-revalidate, post-check=0, pre-check=0"
│         ],
│         "Cf-Cache-Status": [
│             "DYNAMIC"
│         ],
│         "Cf-Ray": [
│             "89a458ef4e4c3a9a-FRA"
│         ],
│         "Content-Length": [
│             "235"
│         ],
│         "Content-Security-Policy": [
│             "default-src 'self'; frame-ancestors 'self';"
│         ],
│         "Content-Type": [
│             "application/json; charset=utf-8"
│         ],
│         "Date": [
│             "Thu, 27 Jun 2024 09:18:02 GMT"
│         ],
│         "Expires": [
│             "0"
│         ],
│         "Ibm-Schematics-Requestid": [
│             "e69a877e-2f42-485c-820c-4a16a33e08de"
│         ],
│         "Pragma": [
│             "no-cache"
│         ],
│         "Server": [
│             "cloudflare"
│         ],
│         "Strict-Transport-Security": [
│             "max-age=15552000; includeSubDomains"
│         ],
│         "X-Content-Type-Options": [
│             "nosniff"
│         ],
│         "X-Xss-Protection": [
│             "1; mode=block"
│         ]
│     },
│     "Result": {
│         "message": "Error while deleting the agent, agent provisioned resources are not destroyed completely",
│         "messageid": "M1208",
│         "requestid": "e69a877e-2f42-485c-820c-4a16a33e08de",
│         "statuscode": 412,
│         "timestamp": "2024-06-27T09:18:02.935390492Z"
│     },
│     "RawResult": null
│ }
│ 
│ 
│ 
╵

Panic Output

Expected Behavior

It should delete the schematics agent deployed on the Kubernetes cluster.

Actual Behavior

It doesn't delete the schematics agent deployed on the Kubernetes cluster. I spoke with one of the engineer in Schematics and learned it has been implemented in API and CLI but not in the terraform yet.

Steps to Reproduce

  1. terraform apply the above code
  2. terraform destroy.

Important Factoids

References

  • #0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Schematics Issues related to Schematics
Projects
None yet
Development

No branches or pull requests

1 participant