-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Ontotext-AD/TES-347_Bastion
Added Bastion Module
- Loading branch information
Showing
5 changed files
with
107 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
data "azurerm_resource_group" "graphdb" { | ||
name = var.resource_group_name | ||
} | ||
|
||
data "azurerm_virtual_network" "graphdb" { | ||
name = var.virtual_network_name | ||
resource_group_name = data.azurerm_resource_group.graphdb.name | ||
} | ||
|
||
resource "azurerm_subnet" "subnet" { | ||
name = "AzureBastionSubnet" | ||
resource_group_name = data.azurerm_resource_group.graphdb.name | ||
virtual_network_name = data.azurerm_virtual_network.graphdb.name | ||
address_prefixes = var.bastion_subnet_address_prefix | ||
} | ||
|
||
resource "azurerm_public_ip" "publicIP" { | ||
name = "${var.resource_name_prefix}_bastion_publicIP" | ||
location = data.azurerm_resource_group.graphdb.location | ||
resource_group_name = data.azurerm_resource_group.graphdb.name | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
tags = var.tags | ||
} | ||
|
||
resource "azurerm_bastion_host" "bastionHost" { | ||
name = "${var.resource_name_prefix}_bastion" | ||
location = data.azurerm_resource_group.graphdb.location | ||
resource_group_name = data.azurerm_resource_group.graphdb.name | ||
tags = var.tags | ||
|
||
ip_configuration { | ||
name = "configuration" | ||
subnet_id = azurerm_subnet.subnet.id | ||
public_ip_address_id = azurerm_public_ip.publicIP.id | ||
} | ||
} |
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,30 @@ | ||
# Common configurations | ||
|
||
variable "resource_group_name" { | ||
description = "Name of the resource group where Bastion will be deployed." | ||
type = string | ||
} | ||
|
||
variable "resource_name_prefix" { | ||
description = "Resource name prefix" | ||
type = string | ||
} | ||
|
||
variable "tags" { | ||
description = "Common resource tags." | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
# Networking | ||
|
||
variable "virtual_network_name" { | ||
description = "Virtual network where Bastion will be deployed" | ||
type = string | ||
} | ||
|
||
variable "bastion_subnet_address_prefix" { | ||
description = "Bastion subnet address prefix" | ||
type = list(string) | ||
default = ["10.0.3.0/27"] | ||
} |
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,10 @@ | ||
terraform { | ||
required_version = ">= 1.3.1" | ||
|
||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = ">=3.71.0" | ||
} | ||
} | ||
} |
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