Created
February 23, 2018 21:33
-
-
Save lenadroid/f0022ad3d7a656ac1e2cce87296d170f to your computer and use it in GitHub Desktop.
Managed Kubernetes Service Terraform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_resource_group" "KubeTerraform" { | |
name = "${var.rg_name}" | |
location = "${var.region}" | |
} | |
resource "azurerm_kubernetes_cluster" "KubeTerraform" { | |
name = "${var.cluster_name}" | |
location = "${azurerm_resource_group.KubeTerraform.location}" | |
resource_group_name = "${azurerm_resource_group.KubeTerraform.name}" | |
kubernetes_version = "1.8.2" | |
dns_prefix = "aksdnsprfxtest" | |
linux_profile { | |
admin_username = "azureuser" | |
ssh_key { | |
key_data = "${var.ssh_key_data}" | |
} | |
} | |
agent_pool_profile { | |
name = "default" | |
count = 3 | |
vm_size = "Standard_D2_v2" | |
os_type = "Linux" | |
} | |
service_principal { | |
client_id = "${var.service_principal_id}" | |
client_secret = "${var.service_principal_password}" | |
} | |
tags { | |
Environment = "Production" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service_principal_id="" | |
service_principal_password="" | |
ssh_key_data="" | |
rg_name="" | |
cluster_name="" | |
region="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// General Variables | |
variable "service_principal_id" { | |
type = "string" | |
} | |
variable "service_principal_password" { | |
type = "string" | |
} | |
variable "ssh_key_data" { | |
type = "string" | |
} | |
variable "rg_name" { | |
type = "string" | |
} | |
variable "region" { | |
type = "string" | |
} | |
variable "cluster_name" { | |
type = "string" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment