updating terraform
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user