Skip to content

Commit

Permalink
feat: module release
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIronRock95 committed Jul 9, 2023
1 parent 0d3b866 commit 183be62
Show file tree
Hide file tree
Showing 11 changed files with 372 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ content: |-
# Usage - Module
## Network Watcher Flow Log
## VPN Server Configuration
```hcl
{{ include "examples/network-watcher-flow-log-example/main.tf" }}
{{ include "examples/vpn-server-example/main.tf" }}
```
{{ .Providers }}
{{ .Modules }}
Expand Down
4 changes: 2 additions & 2 deletions docs/header-doc.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* # Invullen
* [![Changelog](https://img.shields.io/badge/changelog-release-green.svg)](Invullen) [![Notice](https://img.shields.io/badge/notice-copyright-yellow.svg)](NOTICE) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-orange.svg)](LICENSE) [![TF Registry](https://img.shields.io/badge/terraform-registry-blue.svg)](Invullen)
* ## VPN Server Configuration
* [![Changelog](https://img.shields.io/badge/changelog-release-green.svg)](Invullen) [![Notice](https://img.shields.io/badge/notice-copyright-yellow.svg)](NOTICE) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-orange.svg)](LICENSE) [![TF Registry](https://img.shields.io/badge/terraform-registry-blue.svg)](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/vpn_server_configuration)
*
*
*
Expand Down
Empty file removed examples/example1/main.tf
Empty file.
Empty file removed examples/example1/variables.tf
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Terraform module | AzureRM - Invullen
# Terraform module | AzureRM - VPN Server Configuration

This Terraform module is designed to create a Invullen for Azure.
This Terraform module is designed to create a VPN Server Configuration for Azure.

## Pre-requisites

Expand All @@ -9,7 +9,7 @@ Using the modules requires the following pre-requisites:

## Usage

`Invullen`
`VPN Server Configuration`

```hcl
Expand Down
15 changes: 15 additions & 0 deletions examples/vpn-server-example/main.tf
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"
}

135 changes: 135 additions & 0 deletions examples/vpn-server-example/variables.tf
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
}
57 changes: 57 additions & 0 deletions main.tf
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
}
}
9 changes: 9 additions & 0 deletions outputs.tf
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
}
Loading

0 comments on commit 183be62

Please sign in to comment.