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

Feature Request: azurerm_kubernetes_cluster: Make linux_profile optional #896

Closed
jambt opened this issue Feb 27, 2018 · 2 comments
Closed

Comments

@jambt
Copy link

jambt commented Feb 27, 2018

Hi,

I ran into an inconsistency between required arguments of azurerm_kubernetes_cluster and the Azure CLI version created by that resource.

Terraform Version

Terraform v0.11.3

  • provider.azurerm v1.1.2

Affected Resource(s)

  • azurerm_kubernetes_cluster

Terraform Configuration Files

resource "azurerm_kubernetes_cluster" "aks_container" {
  name = "${var.name}"
  location = "${var.location}"
  resource_group_name = "${var.resource_group}"
  kubernetes_version = "1.8.7"
  dns_prefix = "default"

  linux_profile {
    admin_username = "custom_admin"
    ssh_key {
      key_data = "${file("~/.ssh/id_rsa.pub")}"
    }
  }

  agent_pool_profile {
    name = "agentpool"
    count = "${var.node_count}"
    vm_size = "${var.node_vm_size}"
    os_type = "Linux"
  }

  service_principal {
    client_id = "${var.client_id}"
    client_secret = "${var.client_secret}"
  }
}

Expected Behavior

Since az aks create can create a cluster without a linux_profile (admin username and key), I believe that this section should be optional.

Actual Behavior

The linux_profile is required.

Related (but different) problem:

By specifying an empty admin_username and ssh_key as an empty list, terraform crashes on apply. I can open a new ticket with detailed information, but am unsure which bug tracker is the right place. Advice would be welcome.

@katbyte
Copy link
Collaborator

katbyte commented Feb 28, 2018

Hello @jambt,

Thank you for the suggestion, but I don't believe we can make it optional at the moment. While the cli az aks create command works, if omitted in the go api the following error is returned:

* azurerm_kubernetes_cluster.aks_container: containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InternalOperationError" Message="An error has occurred in subscription c0a607b2-6372-4ef3-abdb-dbe52a7b56ba, resourceGroup: kt.20180227-akc2 request: missing Properties.LinuxProfile."

As this seems to be a limitation in the API I am going to close this issue

I verified that an empty admin_username does not crash terraform, however an empty ssh_key does and that is a bug in the provider. It should be a separate issue in this repository however as I'm about to fix it I will create the issue myself.

@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants