ionos-cloud / terraform-provider-ionoscloud

The IonosCloud Terraform provider gives the ability to deploy and configure resources using the IonosCloud APIs.
Mozilla Public License 2.0
34 stars 23 forks source link

Destroy of NLB forwarding rules fails when attached to K8s node pool #203

Closed benschmi closed 2 years ago

benschmi commented 2 years ago

Description

A destroy of a network load balancer and forwarding rules fails if the targets are IPs of a K8s node pool.

Expected behavior

Destroy of forwarding rule and NLB is performed correctly since it's not destroying any K8s managed resources.

Environment

Terraform version:

Terraform v1.1.5
on darwin_amd64
+ provider registry.terraform.io/ionos-cloud/ionoscloud v6.1.3

Configuration Files

How to Reproduce

  1. Create K8s node pool with an attached private network
  2. Create network load balancer, with targets of the forwarding rule being the K8s nodes.
  3. terraform apply

Error and Debug Output

ionoscloud_networkloadbalancer_forwardingrule.nlb_fr_01: Destroying... [id=a6f4be09-eb5f-49fb-b951-ec84f71ecf8e]
╷
│ Error: an error occured while deleting a network loadbalancer forwarding rule a6f4be09-eb5f-49fb-b951-ec84f71ecf8e 403 Forbidden {
│   "httpStatus" : 403,
│   "messages" : [ {
│     "errorCode" : "452",
│     "message" : "Access Denied: Volume 0830053e-42ca-4247-822f-cd9a7e0fc099 is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Nic d11e89d3-45c2-49c0-a85b-91666b49293a is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Server 4df2bb73-53d9-4978-b081-85a44a5f6f96 is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Nic 38c3cf73-ef9b-4de1-9489-83204244ade6 is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Volume f70599e1-ff95-4b89-8b69-b049ab123427 is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Nic 346182be-bf7b-46e4-997f-265c7c650a5b is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Server db3e3336-74b8-450b-b45f-c5c72b98d086 is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Nic 7096ac1c-b95b-4646-bd73-5d3dd9f3af0a is managed by k8s."
│   }, {
│     "errorCode" : "452",
│     "message" : "Access Denied: Lan 3 is managed by k8s."
│   } ]
│ }
benschmi commented 2 years ago

Seems to be a Cloud-API issue since I get the same errors when trying to delete the forwarding rules or NLB directly via the API.

oana-ungureanu-ionos commented 2 years ago

Hi Ben! Thanks for the notice, we acknowledged this. Pls open a ticket internally so the Cloud API team can investigate it.