-
Notifications
You must be signed in to change notification settings - Fork 0
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
0d3b866
commit 183be62
Showing
11 changed files
with
372 additions
and
8 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
Empty file.
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
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,15 @@ | ||
|
||
module "vpn_server_configuration" { | ||
source = "sironite/vpn_server_configuration/azurerm" | ||
version = "X.X.X" | ||
|
||
vpn_server_configuration_name = "example-vpn-server-configuration" | ||
resource_group_name = "example-resource-group" | ||
location = "WestEurope" | ||
vpn_authentication_types = "AzureAD" | ||
|
||
audience = "https://example.com" | ||
issuer = "https://example.com" | ||
tenant_id = "00000000-0000-0000-0000-000000000000" | ||
} | ||
|
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,135 @@ | ||
variable "vpn_server_configuration_name" { | ||
type = string | ||
description = "The name of the VPN server configuration." | ||
} | ||
|
||
variable "resource_group_name" { | ||
type = string | ||
description = "The name of the resource group in which to create the VPN server configuration." | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "The location in which to create the VPN server configuration." | ||
|
||
} | ||
|
||
variable "vpn_authentication_types" { | ||
type = string | ||
description = "The type of VPN authentication to use." | ||
default = null | ||
} | ||
|
||
variable "vpn_protocols" { | ||
type = string | ||
description = "The VPN protocols to use." | ||
default = null | ||
} | ||
|
||
variable "audience" { | ||
type = string | ||
description = "The audience for Azure AD authentication." | ||
default = null | ||
} | ||
|
||
variable "issuer" { | ||
type = string | ||
description = "The issuer for Azure AD authentication." | ||
default = null | ||
} | ||
|
||
variable "tenant_id" { | ||
type = string | ||
description = "The tenant ID for Azure AD authentication." | ||
default = null | ||
} | ||
|
||
variable "client_root_certificate_name" { | ||
type = string | ||
description = "The name of the client root certificate." | ||
default = null | ||
} | ||
|
||
variable "public_cert_data" { | ||
type = string | ||
description = "The public certificate data." | ||
default = null | ||
} | ||
|
||
variable "server_adress" { | ||
type = string | ||
description = "The address of the RADIUS server." | ||
default = null | ||
} | ||
|
||
variable "server_secret" { | ||
type = string | ||
description = "The secret for the RADIUS server." | ||
default = null | ||
} | ||
|
||
variable "server_score" { | ||
type = string | ||
description = "The score for the RADIUS server." | ||
default = null | ||
} | ||
|
||
variable "tumbprint" { | ||
type = string | ||
description = "The thumbprint for the client root certificate." | ||
default = null | ||
} | ||
|
||
variable "server_root_certificate_name" { | ||
type = string | ||
description = "The name of the server root certificate." | ||
default = null | ||
} | ||
|
||
variable "dh_group" { | ||
type = string | ||
description = "The Diffie-Hellman group to use." | ||
default = null | ||
} | ||
|
||
variable "ike_encryption" { | ||
type = string | ||
description = "The IKE encryption to use." | ||
default = null | ||
} | ||
|
||
variable "ike_integrity" { | ||
type = string | ||
description = "The IKE integrity to use." | ||
default = null | ||
} | ||
|
||
variable "ipsec_encryption" { | ||
type = string | ||
description = "The IPSec encryption to use." | ||
default = null | ||
} | ||
|
||
variable "ipsec_integrity" { | ||
type = string | ||
description = "The IPSec integrity to use." | ||
default = null | ||
} | ||
|
||
variable "pfs_group" { | ||
type = string | ||
description = "The Perfect Forward Secrecy group to use." | ||
default = null | ||
} | ||
|
||
variable "sa_data_size_kilobytes" { | ||
type = string | ||
description = "The size of the SA data in kilobytes." | ||
default = null | ||
} | ||
|
||
variable "sa_life_time_seconds" { | ||
type = string | ||
description = "The lifetime of the SA in seconds." | ||
default = null | ||
} |
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,57 @@ | ||
resource "azurerm_vpn_server_configuration" "example" { | ||
name = var.vpn_server_configuration_name | ||
resource_group_name = var.resource_group_name | ||
location = var.location | ||
vpn_authentication_types = var.vpn_authentication_types | ||
vpn_protocols = var.vpn_protocols | ||
|
||
dynamic "azure_active_directory_authentication" { | ||
for_each = var.vpn_authentication_types == "AzureAD" ? [1] : [] | ||
content { | ||
audience = var.audience | ||
issuer = var.issuer | ||
tenant_id = var.tenant_id | ||
} | ||
} | ||
|
||
dynamic "client_root_certificate" { | ||
for_each = var.vpn_authentication_types == "Certificate" ? [1] : [] | ||
content { | ||
name = var.client_root_certificate_name | ||
public_cert_data = var.public_cert_data | ||
} | ||
} | ||
|
||
dynamic "radius" { | ||
for_each = var.vpn_authentication_types == "Radius" ? [1] : [] | ||
content { | ||
radius { | ||
server { | ||
adress = var.server_adress | ||
secret = var.server_secret | ||
score = var.server_score | ||
} | ||
client_root_certificate { | ||
name = var.client_root_certificate_name | ||
tumbprint = var.tumbprint | ||
} | ||
server_root_certificate { | ||
name = var.server_root_certificate_name | ||
public_cert_data = var.public_cert_data | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
ipsec_policy { | ||
dh_group = var.dh_group | ||
ike_encryption = var.ike_encryption | ||
ike_integrity = var.ike_integrity | ||
ipsec_encryption = var.ipsec_encryption | ||
ipsec_integrity = var.ipsec_integrity | ||
pfs_group = var.pfs_group | ||
sa_data_size_kilobytes = var.sa_data_size_kilobytes | ||
sa_life_time_seconds = var.sa_life_time_seconds | ||
} | ||
} |
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,9 @@ | ||
output "vpn_server_configuration_id" { | ||
description = "The ID of the VPN server configuration." | ||
value = azurerm_vpn_server_configuration.example.id | ||
} | ||
|
||
output "vpn_server_configuration_name" { | ||
description = "The name of the VPN server configuration." | ||
value = azurerm_vpn_server_configuration.example.name | ||
} |
Oops, something went wrong.