updating terraform

This commit is contained in:
comerford0
2025-10-02 09:59:10 +00:00
parent c12311ab9f
commit af6e73101f
4 changed files with 21 additions and 7 deletions
+9 -7
View File
@@ -14,13 +14,8 @@ 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
resource_group_name = var.resource_group_name
allocation_method = "Static"
depends_on = [azurerm_network_security_group.vm_nsg]
}
resource "azurerm_network_security_group" "vm_nsg" {
@@ -36,11 +31,18 @@ resource "azurerm_network_security_group" "vm_nsg" {
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "22"
source_address_prefix = "81.78.69.107"
source_address_prefix = var.ex_ip
destination_address_prefix = "*"
}
}
resource "azurerm_public_ip" "vm_public" {
name = "example-pip"
location = var.location
resource_group_name = var.resource_group_name
allocation_method = "Static"
}
resource "azurerm_linux_virtual_machine" "vm" {
name = "example-vm"
resource_group_name = var.resource_group_name
+1
View File
@@ -4,3 +4,4 @@ variable "subnet_id" { type = string }
variable "vm_size" { type = string }
variable "admin_username" { type = string }
variable "ssh_public_key" { type = string }
variable "ex_ip" { type = string }