-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbastion.tf
48 lines (40 loc) · 1.63 KB
/
bastion.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Bastion Resources
# RG
resource "azurerm_resource_group" "bastion_rg" {
name = "rg-bastion-${local.region_map[var.region1]}"
location = var.region1
}
resource "azurerm_virtual_network" "bastion_vnet" {
name = "vnet-bastion-${local.region_map[var.region1]}-01"
resource_group_name = azurerm_resource_group.bastion_rg.name
location = azurerm_resource_group.bastion_rg.location
address_space = ["10.50.0.0/16"]
subnet {
name = "AzureBastionSubnet"
address_prefix = "10.50.0.0/24"
}
}
resource "azurerm_virtual_hub_connection" "bastion_hub_connection" {
name = "vwan-hub-connection-bastion-${local.region_map[var.region1]}"
virtual_hub_id = module.secured_hub_region1.virtual_hub_id
remote_virtual_network_id = azurerm_virtual_network.bastion_vnet.id
}
resource "azurerm_public_ip" "bastion_pip" {
name = "bastion-pip"
location = azurerm_resource_group.bastion_rg.location
resource_group_name = azurerm_resource_group.bastion_rg.name
allocation_method = "Static"
sku = "Standard"
}
resource "azurerm_bastion_host" "bastion_uks" {
name = "bastion-${local.region_map[var.region1]}-std"
location = azurerm_resource_group.bastion_rg.location
resource_group_name = azurerm_resource_group.bastion_rg.name
sku = "Standard"
ip_connect_enabled = true
ip_configuration {
name = "bastion-ipconfig"
public_ip_address_id = azurerm_public_ip.bastion_pip.id
subnet_id = azurerm_virtual_network.bastion_vnet.subnet.*.id[0]
}
}