Advertisement
Guest User

Untitled

a guest
Oct 29th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. resource "azurerm_virtual_machine" "k8s-node" {
  2. count = "${var.node_vm_count}"
  3.  
  4. name = "k8s-node-${count.index}"
  5. location = "${var.location}"
  6. resource_group_name = "${var.resource_group}"
  7. network_interface_ids = ["${element(azurerm_network_interface.k8s-node.*.id, count.index)}"]
  8. availability_set_id = "${azurerm_availability_set.k8s-node.id}"
  9. vm_size = "${var.node_vm_size}"
  10. delete_os_disk_on_termination = true
  11. delete_data_disks_on_termination = true
  12.  
  13. storage_image_reference {
  14. publisher = "Canonical"
  15. offer = "UbuntuServer"
  16. sku = "16.04.0-LTS"
  17. version = "latest"
  18. }
  19.  
  20. storage_os_disk {
  21. name = "k8s-nodedisk1"
  22. vhd_uri = "${element(azurerm_storage_account.k8s-node.*.primary_blob_endpoint, count.index)}${element(azurerm_storage_container.k8s-node.*.name, count.index)}/k8s-node-${count.index}disk1.vhd"
  23. caching = "ReadWrite"
  24. create_option = "FromImage"
  25. }
  26.  
  27. os_profile {
  28. computer_name = "k8s-node-${count.index}"
  29. admin_username = "REDACTED"
  30. admin_password = "REDACTED"
  31. }
  32.  
  33. os_profile_linux_config {
  34. disable_password_authentication = true
  35. ssh_keys {
  36. path = "REDACTED"
  37. key_data = "REDACTED"
  38. }
  39. }
  40.  
  41. tags {
  42. environment = "${var.environment}"
  43. version = "${var.version}"
  44. }
  45.  
  46. lifecycle {
  47. ignore_changes = ["storage_data_disk"]
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement