Error: Unsupported block type
│
│ on data.tf line 48:
│ 48: ip_configuration {
│
│ Blocks of type “ip_configuration” are not expected here.
script
data “azurerm_resource_group” “azrg” {
name = “arg”
}
resource “azurerm_managed_disk” “disk” {
name = “manage_disk”
location = “${data.azurerm_resource_group.azrg.location}”
resource_group_name = “${data.azurerm_resource_group.azrg.name}”
storage_account_type = “Standard_LRS”
create_option = “Empty”
disk_size_gb = “10”
tags = {
environment = “staging”
}
}
data “azurerm_virtual_network” “azvnet” {
name = “azvnet”
resource_group_name = “${data.azurerm_resource_group.azrg.name}”
}
data “azurerm_subnet” “azsubnet” {
name = “argsubnet”
virtual_network_name = “${data.azurerm_virtual_network.azvnet.name}”
resource_group_name = “${data.azurerm_resource_group.azrg.name}”
}
resource “azurerm_subnet” “tf-subnetarg” {
name = “tf-subnet”
resource_group_name = “${data.azurerm_resource_group.azrg.name}”
virtual_network_name = “${data.azurerm_virtual_network.azvnet.name}”
address_prefixes = [“10.10.1.0/24”]
}
resource “azurerm_public_ip” “azpublic” {
name = “azpublic-pip”
location = “${data.azurerm_resource_group.azrg.location}”
resource_group_name = “${data.azurerm_resource_group.azrg.name}”
allocation_method = “Dynamic”
}
resource “azurerm_network_interface” “argnic” {
name = “arg-vmnic”
location = “${data.azurerm_resource_group.azrg.location}”
resource_group_name = “${data.azurerm_resource_group.azrg.name}”
}
ip_configuration {
name = “internal”
subnet_id = azurerm_subnet.tf-subnetarg.id
private_ip_address_allocation = “static”
public_ip_address_id = azurerm_public_ip.azpublic.id
}
resource “azurerm_network_security_group” “nsg2” {
name = “tf-nsg2”
location = var.location
resource_group_name = var.resource_group
security_rule {
name = “rdprule2”
priority = 100
direction = “Inbound”
access = “Allow”
protocol = “Tcp”
source_port_range = “"
destination_port_range = "”
source_address_prefix = “"
destination_address_prefix = "”
}
depends_on = [
azurerm_resource_group.rg,
azurerm_virtual_network.network,
]
}
resource “azurerm_network_interface_security_group_association” “nic-link2” {
network_interface_id = azurerm_network_interface.nic2.id
network_security_group_id = azurerm_network_security_group.nsg2.id
depends_on = [
azurerm_resource_group.rg,
azurerm_virtual_network.network,
azurerm_network_interface.nic
]
}
resource “azurerm_windows_virtual_machine” “datasourcevm” {
name = “datawindowsvm”
resource_group_name = var.resource_group
location = var.location
size = “Standard_B2ms”
admin_username =
admin_password =
network_interface_ids = [
azurerm_network_interface.nic2.id,
]
os_disk {
caching = “ReadWrite”
storage_account_type = “Standard_LRS”
}
source_image_reference {
publisher = “MicrosoftWindowsServer”
offer = “WindowsServer”
sku = “2016-Datacenter”
version = “latest”
}
depends_on = [
azurerm_resource_group.rg
]
}