Skip to content

Think-Cube/terraform-azure-virtual-network-with-bastion-host

Repository files navigation

Requirements

Name Version
terraform >= 1.6.4
azurerm 4.12.0

Providers

Name Version
azurerm 4.12.0

Modules

No modules.

Resources

Name Type
azurerm_bastion_host.main resource
azurerm_public_ip.main resource
azurerm_subnet.main resource
azurerm_virtual_network.main resource
azurerm_client_config.current data source
azurerm_resource_group.bastion data source
azurerm_resource_group.vnet data source
azurerm_subnet.maindata data source

Inputs

Name Description Type Default Required
bastion_host_ip_configuration Block for define Ip configuration for Bastion Host. Changing this forces a new resource to be created. string "bastion_config" no
bastion_hostname Name of the basion host string "test" no
bastion_resource_group_location The location/region where the bastion host is created. Changing this forces a new resource to be created. string "West Europe" no
bastion_resource_group_name The name of the resource group in which to create the bastion host. string n/a yes
default_tags A mapping of tags to assign to the resource. map(any) n/a yes
environment Var used for backend container name key string "dev" no
pubip_allocation_method Defines the allocation method for this IP address. Possible values are Static or Dynamic. string "Static" no
pubip_sku The SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic. string "Standard" no
public_ip_name Specifies the name of the Public IP. Changing this forces a new Public IP to be created. string "bastion_pub_ip" no
region Region in which resources are deployed string "weu" no
subnet_prefix List of subnets with their prefixes and optional service endpoints and delegations
map(object({
name = string
ip = list(string)
service_endpoints = optional(list(object({
service = string
})), [])
delegations = optional(list(object({
name = string
service_name = string
actions = list(string)
})), [])
private_endpoint_network_policies = optional(string, null)
private_link_service_network_policies_enabled = optional(string, null)
}))
{
"example-subnet-1": {
"delegations": [
{
"actions": [
"Microsoft.Network/virtualNetworks/subnets/action"
],
"name": "delegation1",
"service_name": "Microsoft.Web/serverFarms"
}
],
"ip": [
"10.0.1.0/24"
],
"name": "subnet-1",
"private_endpoint_network_policies": "Disabled",
"private_link_service_network_policies_enabled": false,
"service_endpoints": [
{
"service": "Microsoft.Storage"
},
{
"service": "Microsoft.Sql"
}
]
},
"example-subnet-2": {
"delegations": [
{
"actions": [
"Microsoft.Network/virtualNetworks/subnets/action"
],
"name": "delegation2",
"service_name": "Microsoft.Web/serverFarms"
}
],
"ip": [
"10.0.2.0/24"
],
"name": "subnet-2",
"private_endpoint_network_policies": "Disabled",
"private_link_service_network_policies_enabled": false,
"service_endpoints": [
{
"service": "Microsoft.Storage"
}
]
}
}
no
vnet_address_space The address space that is used the virtual network. You can supply more than one address space. string "10.0.0.0/16" no
vnet_name The name of the virtual network. Changing this forces a new resource to be created. string "VirtualNetwork1" no
vnet_resource_group_location The location/region where the virtual network is created. Changing this forces a new resource to be created. string "West Europe" no
vnet_resource_group_name The name of the resource group in which to create the virtual network. string n/a yes

Outputs

Name Description
address_space The list of address spaces used by the virtual network.
bastion_pubip List the public IP of the bastion server
id The virtual NetworkConfiguration ID.
location The location/region where the virtual network is created.
name The name of the virtual network.
resource_group_name The name of the resource group in which to create the virtual network.