Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Storage Account
- resource "azurerm_storage_account" "tf-sa-cluster-aos" {
- count=5
- name = "${lower(var.ax_base_hostname)}${count.index+1}stoacc"
- location = "${azurerm_resource_group.tf-rg-cluster-aos.location}"
- resource_group_name = "${azurerm_resource_group.tf-rg-cluster-aos.name}"
- account_tier = "${var.sto_acc_tier_std}"
- account_replication_type = "${var.sto_acc_rep_type_lrs}"
- tags {
- environment = "${var.env}"
- }
- }
- Optional Managed Data Disk
- resource "azurerm_managed_disk" "tf-mdsk-cluster" {
- count = 5
- name = "${var.ax_base_hostname}-DATADISK-${count.index+1}"
- location = "${azurerm_resource_group.tf-rg-cluster-aos.location}"
- resource_group_name = "${azurerm_resource_group.tf-rg-cluster-aos.name}"
- storage_account_type = "Standard_LRS"
- create_option = "Empty"
- disk_size_gb = "2048"
- }
- resource "azurerm_virtual_machine" "tf-vm-cluster-aos" {
- count = 5
- name = "${var.ax_base_hostname}-${count.index+1}"
- location = "${azurerm_resource_group.tf-rg-cluster-aos.location}"
- resource_group_name = "${azurerm_resource_group.tf-rg-cluster-aos.name}"
- availability_set_id = "${azurerm_availability_set.tf-as-cluster-aos.id}"
- network_interface_ids = ["${element(azurerm_network_interface.tf-ni-cluster-aos.*.id, count.index+1)}"]
- vm_size = "${var.ax_vm_size}"
- storage_data_disk {
- name = "${element(azurerm_managed_disk.tf-mdsk-cluster.*.name, count.index+1)}"
- managed_disk_id = "${element(azurerm_managed_disk.tf-mdsk-cluster.*.id, count.index+1)}"
- create_option = "Attach"
- lun = 0
- disk_size_gb = "${element(azurerm_managed_disk.tf-mdsk-cluster.*.disk_size_gb, count.index+1)}"
- }
- }
- Error: Unknown root level key: Optional
- 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
- 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
- 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
Add Comment
Please, Sign In to add comment