terraform fmt
This commit is contained in:
parent
91b12bb8b9
commit
057a0330ca
@ -1,104 +1,104 @@
|
|||||||
resource "azurerm_public_ip" "azure_bastion" {
|
resource "azurerm_public_ip" "azure_bastion" {
|
||||||
name = "pip-azure-bastion"
|
name = "pip-azure-bastion"
|
||||||
location = azurerm_resource_group.default.location
|
location = azurerm_resource_group.default.location
|
||||||
resource_group_name = azurerm_resource_group.default.name
|
resource_group_name = azurerm_resource_group.default.name
|
||||||
allocation_method = "Static"
|
allocation_method = "Static"
|
||||||
sku = "Standard"
|
sku = "Standard"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_network_security_group" "bastion_nsg" {
|
resource "azurerm_network_security_group" "bastion_nsg" {
|
||||||
name = "nsg-bastion"
|
name = "nsg-bastion"
|
||||||
location = azurerm_resource_group.default.location
|
location = azurerm_resource_group.default.location
|
||||||
resource_group_name = azurerm_resource_group.default.name
|
resource_group_name = azurerm_resource_group.default.name
|
||||||
|
|
||||||
security_rule {
|
security_rule {
|
||||||
name = "AllowHTTPSInbound"
|
name = "AllowHTTPSInbound"
|
||||||
priority = 100
|
priority = 100
|
||||||
direction = "Inbound"
|
direction = "Inbound"
|
||||||
access = "Allow"
|
access = "Allow"
|
||||||
protocol = "Tcp"
|
protocol = "Tcp"
|
||||||
source_port_range = "*"
|
source_port_range = "*"
|
||||||
destination_port_range = "443"
|
destination_port_range = "443"
|
||||||
source_address_prefix = "Internet"
|
source_address_prefix = "Internet"
|
||||||
destination_address_prefix = "*"
|
destination_address_prefix = "*"
|
||||||
}
|
}
|
||||||
security_rule {
|
security_rule {
|
||||||
name = "AllowGatewayManagerInbound"
|
name = "AllowGatewayManagerInbound"
|
||||||
priority = 200
|
priority = 200
|
||||||
direction = "Inbound"
|
direction = "Inbound"
|
||||||
access = "Allow"
|
access = "Allow"
|
||||||
protocol = "Tcp"
|
protocol = "Tcp"
|
||||||
source_port_range = "*"
|
source_port_range = "*"
|
||||||
destination_port_range = "443"
|
destination_port_range = "443"
|
||||||
source_address_prefix = "GatewayManager"
|
source_address_prefix = "GatewayManager"
|
||||||
destination_address_prefix = "*"
|
destination_address_prefix = "*"
|
||||||
}
|
}
|
||||||
security_rule {
|
security_rule {
|
||||||
name = "AllowAzureLBInbound"
|
name = "AllowAzureLBInbound"
|
||||||
priority = 300
|
priority = 300
|
||||||
direction = "Inbound"
|
direction = "Inbound"
|
||||||
access = "Allow"
|
access = "Allow"
|
||||||
protocol = "Tcp"
|
protocol = "Tcp"
|
||||||
source_port_range = "*"
|
source_port_range = "*"
|
||||||
destination_port_range = "443"
|
destination_port_range = "443"
|
||||||
source_address_prefix = "AzureLoadBalancer"
|
source_address_prefix = "AzureLoadBalancer"
|
||||||
destination_address_prefix = "*"
|
destination_address_prefix = "*"
|
||||||
}
|
}
|
||||||
security_rule {
|
security_rule {
|
||||||
name = "AllowBastionHostCommunication"
|
name = "AllowBastionHostCommunication"
|
||||||
priority = 400
|
priority = 400
|
||||||
direction = "Inbound"
|
direction = "Inbound"
|
||||||
access = "Allow"
|
access = "Allow"
|
||||||
protocol = "*"
|
protocol = "*"
|
||||||
source_port_range = "*"
|
source_port_range = "*"
|
||||||
destination_port_ranges = ["5701","8080"]
|
destination_port_ranges = ["5701", "8080"]
|
||||||
source_address_prefix = "VirtualNetwork"
|
source_address_prefix = "VirtualNetwork"
|
||||||
destination_address_prefix = "VirtualNetwork"
|
destination_address_prefix = "VirtualNetwork"
|
||||||
}
|
}
|
||||||
security_rule {
|
security_rule {
|
||||||
name = "AllowRdpSshOutbound"
|
name = "AllowRdpSshOutbound"
|
||||||
priority = 100
|
priority = 100
|
||||||
direction = "Outbound"
|
direction = "Outbound"
|
||||||
access = "Allow"
|
access = "Allow"
|
||||||
protocol = "Tcp"
|
protocol = "Tcp"
|
||||||
source_port_range = "*"
|
source_port_range = "*"
|
||||||
destination_port_ranges = ["22", "3389"]
|
destination_port_ranges = ["22", "3389"]
|
||||||
source_address_prefix = "*"
|
source_address_prefix = "*"
|
||||||
destination_address_prefix = "VirtualNetwork"
|
destination_address_prefix = "VirtualNetwork"
|
||||||
}
|
}
|
||||||
security_rule {
|
security_rule {
|
||||||
name = "AllowBastionHostCommunicationOutbound"
|
name = "AllowBastionHostCommunicationOutbound"
|
||||||
priority = 110
|
priority = 110
|
||||||
direction = "Outbound"
|
direction = "Outbound"
|
||||||
access = "Allow"
|
access = "Allow"
|
||||||
protocol = "Tcp"
|
protocol = "Tcp"
|
||||||
source_port_range = "*"
|
source_port_range = "*"
|
||||||
destination_port_ranges = ["5701", "8080"]
|
destination_port_ranges = ["5701", "8080"]
|
||||||
source_address_prefix = "VirtualNetwork"
|
source_address_prefix = "VirtualNetwork"
|
||||||
destination_address_prefix = "VirtualNetwork"
|
destination_address_prefix = "VirtualNetwork"
|
||||||
|
}
|
||||||
|
security_rule {
|
||||||
|
name = "AllowAzureCloudOutbound"
|
||||||
|
priority = 120
|
||||||
|
direction = "Outbound"
|
||||||
|
access = "Allow"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_ranges = ["443"]
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = "AzureCloud"
|
||||||
|
}
|
||||||
|
security_rule {
|
||||||
|
name = "AllowGetSessionInformation"
|
||||||
|
priority = 130
|
||||||
|
direction = "Outbound"
|
||||||
|
access = "Allow"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_ranges = ["80"]
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = "Internet"
|
||||||
}
|
}
|
||||||
security_rule {
|
|
||||||
name = "AllowAzureCloudOutbound"
|
|
||||||
priority = 120
|
|
||||||
direction = "Outbound"
|
|
||||||
access = "Allow"
|
|
||||||
protocol = "Tcp"
|
|
||||||
source_port_range = "*"
|
|
||||||
destination_port_ranges = ["443"]
|
|
||||||
source_address_prefix = "*"
|
|
||||||
destination_address_prefix = "AzureCloud"
|
|
||||||
}
|
|
||||||
security_rule {
|
|
||||||
name = "AllowGetSessionInformation"
|
|
||||||
priority = 130
|
|
||||||
direction = "Outbound"
|
|
||||||
access = "Allow"
|
|
||||||
protocol = "Tcp"
|
|
||||||
source_port_range = "*"
|
|
||||||
destination_port_ranges = ["80"]
|
|
||||||
source_address_prefix = "*"
|
|
||||||
destination_address_prefix = "Internet"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,19 +107,19 @@ resource "azurerm_subnet_network_security_group_association" "bastion_nsg_assoc"
|
|||||||
network_security_group_id = azurerm_network_security_group.bastion_nsg.id
|
network_security_group_id = azurerm_network_security_group.bastion_nsg.id
|
||||||
depends_on = [
|
depends_on = [
|
||||||
azurerm_bastion_host.azure_bastion_instance
|
azurerm_bastion_host.azure_bastion_instance
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
resource "azurerm_bastion_host" "azure_bastion_instance" {
|
resource "azurerm_bastion_host" "azure_bastion_instance" {
|
||||||
name = "bas-${var.name}-${var.environment}"
|
name = "bas-${var.name}-${var.environment}"
|
||||||
location = azurerm_resource_group.default.location
|
location = azurerm_resource_group.default.location
|
||||||
resource_group_name = azurerm_resource_group.default.name
|
resource_group_name = azurerm_resource_group.default.name
|
||||||
|
|
||||||
ip_configuration {
|
ip_configuration {
|
||||||
name = "configuration"
|
name = "configuration"
|
||||||
subnet_id = azurerm_subnet.azure_bastion.id
|
subnet_id = azurerm_subnet.azure_bastion.id
|
||||||
public_ip_address_id = azurerm_public_ip.azure_bastion.id
|
public_ip_address_id = azurerm_public_ip.azure_bastion.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
resource "azurerm_network_interface" "dsvm" {
|
resource "azurerm_network_interface" "dsvm" {
|
||||||
name = "nic-${var.dsvm_name}"
|
name = "nic-${var.dsvm_name}"
|
||||||
location = azurerm_resource_group.default.location
|
location = azurerm_resource_group.default.location
|
||||||
resource_group_name = azurerm_resource_group.default.name
|
resource_group_name = azurerm_resource_group.default.name
|
||||||
|
|
||||||
ip_configuration {
|
ip_configuration {
|
||||||
name = "configuration"
|
name = "configuration"
|
||||||
subnet_id = azurerm_subnet.snet-dsvm.id
|
subnet_id = azurerm_subnet.snet-dsvm.id
|
||||||
private_ip_address_allocation = "Dynamic"
|
private_ip_address_allocation = "Dynamic"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_windows_virtual_machine" "dsvm" {
|
resource "azurerm_windows_virtual_machine" "dsvm" {
|
||||||
name = var.dsvm_name
|
name = var.dsvm_name
|
||||||
location = azurerm_resource_group.default.location
|
location = azurerm_resource_group.default.location
|
||||||
resource_group_name = azurerm_resource_group.default.name
|
resource_group_name = azurerm_resource_group.default.name
|
||||||
network_interface_ids = [
|
network_interface_ids = [
|
||||||
azurerm_network_interface.dsvm.id
|
azurerm_network_interface.dsvm.id
|
||||||
]
|
]
|
||||||
size = "Standard_DS3_v2"
|
size = "Standard_DS3_v2"
|
||||||
|
|
||||||
source_image_reference {
|
source_image_reference {
|
||||||
publisher = "microsoft-dsvm"
|
publisher = "microsoft-dsvm"
|
||||||
@ -27,22 +27,22 @@ resource "azurerm_windows_virtual_machine" "dsvm" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
os_disk {
|
os_disk {
|
||||||
name = "osdisk-${var.dsvm_name}"
|
name = "osdisk-${var.dsvm_name}"
|
||||||
caching = "ReadWrite"
|
caching = "ReadWrite"
|
||||||
storage_account_type = "Premium_LRS"
|
storage_account_type = "Premium_LRS"
|
||||||
}
|
}
|
||||||
|
|
||||||
identity {
|
identity {
|
||||||
type = "SystemAssigned"
|
type = "SystemAssigned"
|
||||||
}
|
}
|
||||||
computer_name = var.dsvm_name
|
computer_name = var.dsvm_name
|
||||||
admin_username = var.dsvm_admin_username
|
admin_username = var.dsvm_admin_username
|
||||||
admin_password = var.dsvm_host_password
|
admin_password = var.dsvm_host_password
|
||||||
|
|
||||||
provision_vm_agent = true
|
provision_vm_agent = true
|
||||||
|
|
||||||
timeouts {
|
timeouts {
|
||||||
create = "60m"
|
create = "60m"
|
||||||
delete = "2h"
|
delete = "2h"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,10 @@ resource "azurerm_subnet" "snet-dsvm" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_subnet" "azure_bastion" {
|
resource "azurerm_subnet" "azure_bastion" {
|
||||||
name = "AzureBastionSubnet"
|
name = "AzureBastionSubnet"
|
||||||
resource_group_name = azurerm_resource_group.default.name
|
resource_group_name = azurerm_resource_group.default.name
|
||||||
virtual_network_name = azurerm_virtual_network.default.name
|
virtual_network_name = azurerm_virtual_network.default.name
|
||||||
address_prefixes = var.bastion_subnet_address_space
|
address_prefixes = var.bastion_subnet_address_space
|
||||||
}
|
}
|
||||||
|
|
||||||
# Private DNS Zones
|
# Private DNS Zones
|
||||||
|
Loading…
x
Reference in New Issue
Block a user