Azure Bastion – Terraform

Bu örnek, bir hedef sanal ağa bir Azure Bastion Ana Host Instance’ı dağıtmak için Terraform kodunu içermektedir.

resource "azurerm_resource_group" "msazureturkey" {
  name     = "msazureturkey-resources"
  location = "North Europe"
}

resource "azurerm_virtual_network" "msazureturkey" {
  name                = "msazureturkeyvnet"
  address_space       = ["192.168.1.0/24"]
  location            = azurerm_resource_group.msazureturkey.location
  resource_group_name = azurerm_resource_group.msazureturkey.name
}

resource "azurerm_subnet" "example" {
  name                 = "AzureBastionSubnet"
  resource_group_name  = azurerm_resource_group.msazureturkey.name
  virtual_network_name = azurerm_virtual_network.msazureturkey.name
  address_prefixes     = ["192.168.1.224/27"]
}

resource "azurerm_public_ip" "msazureturkey" {
  name                = "msazureturkeypip"
  location            = azurerm_resource_group.msazureturkey.location
  resource_group_name = azurerm_resource_group.msazureturkey.name
  allocation_method   = "Static"
  sku                 = "Standard"
}

resource "azurerm_bastion_host" "msazureturkey" {
  name                = "msazureturkeybastion"
  location            = azurerm_resource_group.msazureturkey.location
  resource_group_name = azurerm_resource_group.msazureturkey.name

  ip_configuration {
    name                 = "configuration"
    subnet_id            = azurerm_subnet.msazureturkey.id
    public_ip_address_id = azurerm_public_ip.msazureturkey.id
  }
}

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.