SHARE
TWEET

Untitled

a guest Feb 18th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Storage Account
  2. resource "azurerm_storage_account" "tf-sa-cluster-aos" {
  3.   count=5
  4.   name                     = "${lower(var.ax_base_hostname)}${count.index+1}stoacc"
  5.   location                 = "${azurerm_resource_group.tf-rg-cluster-aos.location}"
  6.   resource_group_name      = "${azurerm_resource_group.tf-rg-cluster-aos.name}"
  7.   account_tier             = "${var.sto_acc_tier_std}"
  8.   account_replication_type = "${var.sto_acc_rep_type_lrs}"
  9.  
  10. tags {
  11.   environment = "${var.env}"
  12.      }  
  13. }
  14.  
  15. Optional Managed Data Disk
  16. resource "azurerm_managed_disk" "tf-mdsk-cluster" {
  17.   count                = 5
  18.   name                 = "${var.ax_base_hostname}-DATADISK-${count.index+1}"
  19.   location             = "${azurerm_resource_group.tf-rg-cluster-aos.location}"
  20.   resource_group_name  = "${azurerm_resource_group.tf-rg-cluster-aos.name}"
  21.   storage_account_type = "Standard_LRS"
  22.   create_option        = "Empty"
  23.   disk_size_gb         = "2048"
  24. }
  25. resource "azurerm_virtual_machine" "tf-vm-cluster-aos" {
  26.   count                 = 5
  27.   name                  = "${var.ax_base_hostname}-${count.index+1}"
  28.   location            = "${azurerm_resource_group.tf-rg-cluster-aos.location}"
  29.   resource_group_name = "${azurerm_resource_group.tf-rg-cluster-aos.name}"
  30.   availability_set_id   = "${azurerm_availability_set.tf-as-cluster-aos.id}"
  31.   network_interface_ids = ["${element(azurerm_network_interface.tf-ni-cluster-aos.*.id, count.index+1)}"]
  32.   vm_size               = "${var.ax_vm_size}"
  33.  
  34.  
  35.  storage_data_disk {
  36.    name            = "${element(azurerm_managed_disk.tf-mdsk-cluster.*.name, count.index+1)}"
  37.    managed_disk_id = "${element(azurerm_managed_disk.tf-mdsk-cluster.*.id, count.index+1)}"
  38.    create_option   = "Attach"
  39.    lun             = 0
  40.    disk_size_gb    = "${element(azurerm_managed_disk.tf-mdsk-cluster.*.disk_size_gb, count.index+1)}"
  41.  }
  42.  
  43. }
  44.    
  45. Error: Unknown root level key: Optional
  46.  
  47.  
  48.  
  49. Error: resource 'azurerm_virtual_machine.tf-vm-cluster-aos' config: unknown resource 'azurerm_managed_disk.tf-mdsk-cluster' referenced in variable azu                    rerm_managed_disk.tf-mdsk-cluster.*.id
  50.  
  51.  
  52.  
  53. Error: resource 'azurerm_virtual_machine.tf-vm-cluster-aos' config: unknown resource 'azurerm_managed_disk.tf-mdsk-cluster' referenced in variable azu                    rerm_managed_disk.tf-mdsk-cluster.*.disk_size_gb
  54.  
  55.  
  56.  
  57. Error: resource 'azurerm_virtual_machine.tf-vm-cluster-aos' config: unknown resource 'azurerm_managed_disk.tf-mdsk-cluster' referenced in variable azu                    rerm_managed_disk.tf-mdsk-cluster.*.name
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top