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

azurerm_container_service - master_profile.fqdn and agent_pool_profile.fqdn are not exposed after apply (Kubernetes) #112

Closed
AlexeyAtIgloo opened this issue Jun 19, 2017 · 5 comments · Fixed by #125
Assignees

Comments

@AlexeyAtIgloo
Copy link

Terraform Version

Terraform v0.9.8

Affected Resource(s)

  • azurerm_container_service

Terraform Configuration Files

# VARS

variable auth {
  type = "map"
  default = {
    subscription_id = "<populate>"
    client_id       = "<populate>"
    client_secret   = "<populate>"
    tenant_id       = "<populate>"
  }
}

variable "environment" {
  type    = "string"
  default = "sometestenv"
}

variable "location" {
  type    = "string"
  default = "eastus"
}

variable "keys_k8s" {
  type    = "string"
  default = "<populate>"
}

variable "accounts_k8s_admin_name" {
  type    = "string"
  default = "kubeadm"

}

provider "azurerm" {
  subscription_id = "${var.auth["subscription_id"]}"
  client_id       = "${var.auth["client_id"]}"
  client_secret   = "${var.auth["client_secret"]}"
  tenant_id       = "${var.auth["tenant_id"]}"
}

# Resources

resource "azurerm_resource_group" "k8s" {
  name     = "${var.environment}_k8s_cluster"
  location = "${var.location}"
}

resource "azurerm_container_service" "k8s" {
  name                   = "${var.environment}_k8s_cluster"
  location               = "${azurerm_resource_group.k8s.location}"
  resource_group_name    = "${azurerm_resource_group.k8s.name}"
  orchestration_platform = "Kubernetes"

  master_profile {  
    count      = 3
    dns_prefix = "${var.environment}masters"
  }

  linux_profile {
    admin_username = "${var.accounts_k8s_admin_name}"

    ssh_key {
      key_data = "${var.keys_k8s}"
    }
  }

  agent_pool_profile {
    name       = "default"
    count      = 2
    dns_prefix = "${var.environment}agents"
    vm_size    = "Standard_A0"
  }

  service_principal {
    client_id     = "${var.auth["client_id"]}"
    client_secret = "${var.auth["client_secret"]}"
  }

  diagnostics_profile {
    enabled = false
  }

  tags {
    Environment = "${var.environment}"
    Type        = "k8s"
  }
}

output "k8s_cluster_name" {
  value = "${azurerm_container_service.k8s.name}"
}

output "k8s_rg_name" {
  value = "${azurerm_resource_group.k8s.name}"
}


output "k8s_master_profile_fqdn" {
  value = "${azurerm_container_service.k8s.master_profile.fqdn}"
}

output "k8s_agent_pool_profile_fqdn" {
  value = "${azurerm_container_service.k8s.agent_pool_profile.fqdn}"
}

Expected Behavior

there should be 4 outputs after apply command

Actual Behavior

getting only 2 outputs:

k8s_cluster_name = dev_k8s_cluster
k8s_rg_name = dev_k8s_cluster

Steps to Reproduce

  1. Save provided TF config into file
  2. Replace <populate> with your configuration
  3. Run terraform apply

Important Factoids

Also unable to find this info in state file.
Have tried only with orchestration_platform = "Kubernetes"

@nbering
Copy link

nbering commented Jun 19, 2017

Looks to me like there's something missing here:

https://github.com/terraform-providers/terraform-provider-azurerm/blob/adab32c4dc7d2a9b287a62449a4a217f66049674/azurerm/resource_arm_container_service.go#L343

Rest API should definitely return that field.
https://docs.microsoft.com/en-us/rest/api/compute/containerservices#ContainerServices_Get

@AlexeyAtIgloo
Copy link
Author

I've been playing with Azure Python SDK and can confirm that missing properties are returned by Rest API as per the above doc.

@tombuildsstuff
Copy link
Member

Added via #125

@AlexeyAtIgloo
Copy link
Author

Thanks Guys! That was quick...

@ghost
Copy link

ghost commented Apr 1, 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 Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants