Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resource "azurerm_virtual_machine" "k8s-node" {
- count = "${var.node_vm_count}"
- name = "k8s-node-${count.index}"
- location = "${var.location}"
- resource_group_name = "${var.resource_group}"
- network_interface_ids = ["${element(azurerm_network_interface.k8s-node.*.id, count.index)}"]
- availability_set_id = "${azurerm_availability_set.k8s-node.id}"
- vm_size = "${var.node_vm_size}"
- delete_os_disk_on_termination = true
- delete_data_disks_on_termination = true
- storage_image_reference {
- publisher = "Canonical"
- offer = "UbuntuServer"
- sku = "16.04.0-LTS"
- version = "latest"
- }
- storage_os_disk {
- name = "k8s-nodedisk1"
- 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"
- caching = "ReadWrite"
- create_option = "FromImage"
- }
- os_profile {
- computer_name = "k8s-node-${count.index}"
- admin_username = "REDACTED"
- admin_password = "REDACTED"
- }
- os_profile_linux_config {
- disable_password_authentication = true
- ssh_keys {
- path = "REDACTED"
- key_data = "REDACTED"
- }
- }
- tags {
- environment = "${var.environment}"
- version = "${var.version}"
- }
- lifecycle {
- ignore_changes = ["storage_data_disk"]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement