-
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.
- Loading branch information
1 parent
efb6039
commit 542da7c
Showing
10 changed files
with
113 additions
and
23 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 @@ | ||
# GraphDB NAT Module |
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,38 @@ | ||
locals { | ||
# TODO: Is it okay to take the first one ? | ||
nat_zone = var.zones[0] | ||
} | ||
|
||
resource "azurerm_public_ip" "graphdb-nat-ip-address" { | ||
name = "${var.resource_name_prefix}-nat-gateway" | ||
resource_group_name = var.resource_group_name | ||
location = var.location | ||
|
||
sku = "Standard" | ||
allocation_method = "Static" | ||
zones = [local.nat_zone] | ||
|
||
tags = var.tags | ||
} | ||
|
||
resource "azurerm_nat_gateway" "graphdb" { | ||
name = var.resource_name_prefix | ||
resource_group_name = var.resource_group_name | ||
location = var.location | ||
zones = [local.nat_zone] | ||
|
||
sku_name = "Standard" | ||
idle_timeout_in_minutes = 10 # TODO: ???? 120 is the max in the portal | ||
|
||
tags = var.tags | ||
} | ||
|
||
resource "azurerm_nat_gateway_public_ip_association" "graphdb-nat" { | ||
nat_gateway_id = azurerm_nat_gateway.graphdb.id | ||
public_ip_address_id = azurerm_public_ip.graphdb-nat-ip-address.id | ||
} | ||
|
||
resource "azurerm_subnet_nat_gateway_association" "graphdb-nat" { | ||
nat_gateway_id = azurerm_nat_gateway.graphdb.id | ||
subnet_id = var.nat_subnet_id | ||
} |
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,34 @@ | ||
# General configurations | ||
|
||
variable "resource_name_prefix" { | ||
description = "Resource name prefix used for tagging and naming Azure resources" | ||
type = string | ||
} | ||
|
||
variable "location" { | ||
description = "Azure geographical location where resources will be deployed" | ||
type = string | ||
} | ||
|
||
variable "zones" { | ||
description = "Availability zones to use for resource deployment and HA" | ||
type = list(number) | ||
} | ||
|
||
variable "tags" { | ||
description = "Common resource tags." | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
variable "resource_group_name" { | ||
description = "Name of the resource group where GraphDB will be deployed." | ||
type = string | ||
} | ||
|
||
# Networking | ||
|
||
variable "nat_subnet_id" { | ||
description = "Identifier of the subnet to which the NAT will be associated" | ||
type = 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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
output "public_address_fqdn" { | ||
description = "External FQDN address for GraphDB" | ||
value = module.address.public_ip_address_fqdn | ||
} | ||
#output "public_address_fqdn" { | ||
# description = "External FQDN address for GraphDB" | ||
# value = module.address.public_ip_address_fqdn | ||
#} |
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