updating terraform

This commit is contained in:
comerford0
2025-10-02 09:17:15 +00:00
parent dfcbe54ebe
commit c12311ab9f
2 changed files with 30 additions and 1 deletions
+23
View File
@@ -11,6 +11,11 @@ resource "azurerm_network_interface" "nic" {
}
}
resource "azurerm_network_interface_security_group_association" "example" {
network_interface_id = azurerm_network_interface.nic.id
network_security_group_id = azurerm_network_security_group.vm_nsg.id
}
resource "azurerm_public_ip" "vm_public" {
name = "example-pip"
location = var.location
@@ -18,6 +23,24 @@ resource "azurerm_public_ip" "vm_public" {
allocation_method = "Static"
}
resource "azurerm_network_security_group" "vm_nsg" {
name = "vm-nsg"
resource_group_name = var.resource_group_name
location = var.location
security_rule {
name = "SSH"
priority = 1001
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "22"
source_address_prefix = "81.78.69.107"
destination_address_prefix = "*"
}
}
resource "azurerm_linux_virtual_machine" "vm" {
name = "example-vm"
resource_group_name = var.resource_group_name