-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
164 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
data "azurerm_resource_group" "bastion_host_rg" { | ||
name = var.resource_group_name | ||
} | ||
|
||
data "azurerm_virtual_network" "bastion_host_vnet" { | ||
name = var.virtual_network_name | ||
resource_group_name = var.resource_group_name | ||
} | ||
|
||
resource "azurerm_subnet" "bastion_host_subnet" { | ||
name = "AzureBastionSubnet" # the name of the subnet must be 'AzureBastionSubnet' | ||
resource_group_name = data.azurerm_resource_group.bastion_host_rg.name | ||
virtual_network_name = data.azurerm_virtual_network.bastion_host_vnet.name | ||
address_prefixes = [cidrsubnet(var.subnet_address_prefix, 0, 0)] | ||
} | ||
|
||
resource "azurerm_public_ip" "bastion_host_pip" { | ||
name = var.public_ip_name | ||
location = data.azurerm_resource_group.bastion_host_rg.location | ||
resource_group_name = data.azurerm_resource_group.bastion_host_rg.name | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
tags = var.tags | ||
} | ||
|
||
resource "azurerm_bastion_host" "bastion_host" { | ||
name = var.bastion_host_name | ||
location = data.azurerm_resource_group.bastion_host_rg.location | ||
resource_group_name = data.azurerm_resource_group.bastion_host_rg.name | ||
|
||
ip_configuration { | ||
name = var.ipconfig_name | ||
subnet_id = azurerm_subnet.bastion_host_subnet.id | ||
public_ip_address_id = azurerm_public_ip.bastion_host_pip.id | ||
} | ||
|
||
tags = var.tags | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
variable "resource_group_name" { | ||
description = "The name of the resource group the Bastion Host resides in" | ||
type = string | ||
} | ||
|
||
variable "virtual_network_name" { | ||
description = "The name of the virtual network the Bastion Host resides in" | ||
type = string | ||
} | ||
|
||
variable "bastion_host_name" { | ||
description = "The name of the Bastion Host" | ||
type = string | ||
} | ||
|
||
variable "subnet_address_prefix" { | ||
description = "The address prefix for the Bastion Host (must be a /27 or larger)" | ||
type = string | ||
} | ||
|
||
variable "public_ip_name" { | ||
description = "The name of the Bastion Host public IP address resource" | ||
type = string | ||
} | ||
|
||
variable "ipconfig_name" { | ||
description = "The name of the Bastion Host IP configuration resource" | ||
type = string | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters