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
35 stars 24 forks source link

apiSubnetAllowList not set - no error message #255

Closed D3N14L closed 2 years ago

D3N14L commented 2 years ago

Description

I tried to set an apiSubnetAllowList via the Terraform provider and it is correctly set in my state, but not on the actual cluster.

# ionoscloud_k8s_cluster.k8s:
resource "ionoscloud_k8s_cluster" "k8s" {
    api_subnet_allow_list     = [
        "xxx.xxx.xxx.xxx/32",
    ]
    id                        = "xxx"
    k8s_version               = "1.22.6"
    name                      = "mycluster"
    public                    = true
    viable_node_pool_versions = [
        "1.21.9",
        "1.21.11",
        "1.22.6",
        "1.22.8",
    ]

    maintenance_window {
        day_of_the_week = "Sunday"
        time            = "20:06:00Z"
    }
} 

But access to the cluster API is still granted from "0.0.0.0/0". If I try to set the apiSubnetAllowList I get an error message:

❯ ionosctl k8s cluster update --api-subnets "xxx.xxx.xxx.xxx/32"  --cluster-id xxx
Error: 422 Unprocessable Entity {
  "httpStatus" : 422,
  "messages" : [ {
    "errorCode" : "439",
    "message" : "[(root).properties.apiSubnetAllowList] The usage of 'apiSubnetAllowList' is not supported in your contract. Please contact support."
  } ]
}

Expected behavior

I would have expected an error message during the terraform apply, if I try to set an unsupported setting.

Environment

Terraform version:

Terraform v1.1.7

Provider version:

+ provider registry.terraform.io/ionos-cloud/ionoscloud v6.1.3

How to Reproduce

Create a cluster with apiSubnetAllowList set with terraform.

Error and Debug Output

Additional Notes

References

iblindu commented 2 years ago

Hi @D3N14L,

Thank you for raising this issue!

I've tested this, with apiSubnetAllowList deactivated from my account, and I receive an error when trying to create a cluster with this argument set.

│ Error: error creating k8s cluster: 422 Unprocessable Entity {
│   "httpStatus" : 422,
│   "messages" : [ {
│     "errorCode" : "439",
│     "message" : "[(root).properties.apiSubnetAllowList] The usage of 'apiSubnetAllowList' is not supported in your contract. Please contact support."
│   } ]
│ }

Could you test it again, maybe it was a temporary problem within the API, and see if it is reproducing? If it is still reproducing we will investigate further within the API to see why this is happening for you account.