Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/clouddrove/terraform-azure-vpn

This terraform module is designed to create Azure VPN resources. Azure VPN Gateway is a service that uses a specific type of virtual network gateway to send encrypted traffic between an Azure virtual network and on-premises locations over the public Internet. You can also use VPN Gateway to send encrypted traffic between Azure virtual networks .
https://github.com/clouddrove/terraform-azure-vpn

azure azure-vpn clouddrove hcl terraform terraform-azure terraform-azurerm terraform-module terraform-modules

Last synced: 3 days ago
JSON representation

This terraform module is designed to create Azure VPN resources. Azure VPN Gateway is a service that uses a specific type of virtual network gateway to send encrypted traffic between an Azure virtual network and on-premises locations over the public Internet. You can also use VPN Gateway to send encrypted traffic between Azure virtual networks .

Awesome Lists containing this project

README

        


Terraform AZURE VPN


Terraform module to create vpn resource on AZURE.


Terraform


Licence












We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy Bigger problems are always solved by breaking them into smaller manageable problems. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller connected yet manageable pieces within the infrastructure.

This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.

We have [*fifty plus terraform modules*][terraform_modules]. A few of them are comepleted and are available for open source usage while a few others are in progress.

## Prerequisites

This module has a few dependencies:

- [Terraform 1.x.x](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Go](https://golang.org/doc/install)
- [github.com/stretchr/testify/assert](https://github.com/stretchr/testify)
- [github.com/gruntwork-io/terratest/modules/terraform](https://github.com/gruntwork-io/terratest)

## Examples

**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-azure-vpn/releases).

Here are some examples of how you can use this module in your inventory structure:
### Default vnet-peering
```hcl
# vpn with azure ad
module "vpn" {
source = "clouddrove/vpn/azure"
version = "1.0.0"
depends_on = [module.vnet]
name = "app"
environment = "test"
label_order = ["name", "environment"]
vpn_ad = true
resource_group_name = module.resource_group.resource_group_name
virtual_network_name = module.vnet.vnet_name[0]
vpn_client_configuration = {
address_space = "172.16.200.0/24"
vpn_client_protocols = ["OpenVPN"]
vpn_auth_types = ["AAD"]
aad_tenant = "https://login.microsoftonline.com/bcffb719XXXXXXXXXXXX7ebfb2f7bdd"
aad_audience = "41b23e61-6c1e-4545-b367-cd054e0ed4b4"
aad_issuer = "https://sts.windows.net/bcffb719XXXXXXXXXXXX7ebfb2f7bdd/"
}
#### enable diagnostic setting
diagnostic_setting_enable = false
log_analytics_workspace_id = ""
}
```
```hcl
# vpn with certificate
module "vpn" {
source = "clouddrove/vpn/azure"
version = "1.0.0"
depends_on = [module.vnet]
name = "app"
environment = "test"
label_order = ["name", "environment"]
vpn_with_certificate = true
resource_group_name = module.resource_group.resource_group_name
virtual_network_name = module.vnet.vnet_name[0]
#### enable diagnostic setting
diagnostic_setting_enable = false
log_analytics_workspace_id = ""
vpn_client_configuration_c = {
address_space = "172.16.201.0/24"
vpn_client_protocols = ["OpenVPN", "IkeV2"]
certificate = <[
"name",
"environment"
] | no |
| local\_bgp\_settings | Local Network Gateway's BGP speaker settings | `list(object({ asn_number = number, peering_address = string, peer_weight = number }))` | `null` | no |
| local\_networks | List of local virtual network connections to connect to gateway | `list(object({ local_gw_name = string, local_gateway_address = string, local_address_space = list(string), shared_key = string }))` | `[]` | no |
| local\_networks\_ipsec\_policy | IPSec policy for local networks. Only a single policy can be defined for a connection. | `any` | `null` | no |
| location | The location/region to keep all your network resources. To get the list of all locations with table format from azure cli, run 'az account list-locations -o table' | `string` | `""` | no |
| log\_analytics\_destination\_type | Possible values are AzureDiagnostics and Dedicated, default to AzureDiagnostics. When set to Dedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table. | `string` | `"AzureDiagnostics"` | no |
| log\_analytics\_workspace\_id | n/a | `string` | `null` | no |
| log\_enabled | Is this Diagnostic Log enabled? Defaults to true. | `string` | `true` | no |
| managedby | ManagedBy, eg ''. | `string` | `""` | no |
| name | Name (e.g. `app` or `cluster`). | `string` | `""` | no |
| peer\_virtual\_network\_gateway\_id | The ID of the peer virtual network gateway when creating a VNet-to-VNet connection | `any` | `null` | no |
| public\_ip\_allocation\_method | Defines the allocation method for this IP address. Possible values are Static or Dynamic. Defaults to Dynamic | `string` | `"Dynamic"` | no |
| public\_ip\_sku | The SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic | `string` | `"Basic"` | no |
| repository | Terraform current module repo | `string` | `""` | no |
| resource\_group\_name | A container that holds related resources for an Azure solution | `string` | `""` | no |
| retention\_policy\_enabled | Is this Retention Policy enabled? | `bool` | `false` | no |
| sku | Configuration of the size and capacity of the virtual network gateway | `string` | `"VpnGw3"` | no |
| storage\_account\_id | The ID of the Storage Account where logs should be sent. | `string` | `null` | no |
| sts\_vpn | Set to false to prevent the module from creating any resources. | `bool` | `false` | no |
| subnet\_id | The ID of the Subnet where this Network Interface should be located in. | `string` | `""` | no |
| tags | A map of tags to add to all resources | `map(string)` | `{}` | no |
| vpn\_ad | Set to false to prevent the module from creating any resources. | `bool` | `false` | no |
| vpn\_client\_configuration | Virtual Network Gateway client configuration to accept IPSec point-to-site connections | `object({ address_space = string, vpn_client_protocols = list(string), aad_tenant = string, aad_audience = string, aad_issuer = string, vpn_auth_types = list(string) })` | `null` | no |
| vpn\_client\_configuration\_c | Virtual Network Gateway client configuration to accept IPSec point-to-site connections | `object({ address_space = string, vpn_client_protocols = list(string), certificate = string })` | `null` | no |
| vpn\_gateway\_name | The name of the Virtual Network Gateway | `string` | `""` | no |
| vpn\_gw\_generation | The Generation of the Virtual Network gateway. Possible values include Generation1, Generation2 or None | `string` | `"Generation2"` | no |
| vpn\_gw\_sku | Configuration of the size and capacity of the virtual network gateway. Valid options are Basic, VpnGw3, VpnGw2, VpnGw3, VpnGw4,VpnGw5, VpnGw3AZ, VpnGw3, VpnGw3AZ,VpnGw4AZ and VpnGw5AZ and depend on the type, vpn\_type and generation arguments | `string` | `"VpnGw3"` | no |
| vpn\_type | The routing type of the Virtual Network Gateway. Valid options are RouteBased or PolicyBased. Defaults to RouteBased | `string` | `"RouteBased"` | no |
| vpn\_with\_certificate | Set to false to prevent the module from creating any resources. | `bool` | `false` | no |

## Outputs

| Name | Description |
|------|-------------|
| local\_network\_gw\_connection\_id | The ID of the Virtual Network Gateway Connection. |
| local\_network\_gw\_id | The ID of the Local Network Gateway. |
| vpn\_gw\_id | The ID of the Virtual Network Gateway. |
| vpn\_gw\_id\_certificate | The ID of the Virtual Network Gateway. |

## Testing
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.

You need to run the following command in the testing folder:
```hcl
go test -run Test
```

## Feedback
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-azure-vpn/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).

If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-azure-vpn)!

## About us

At [CloudDrove][website], we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.

We are The Cloud Experts!




We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.

[website]: https://clouddrove.com
[github]: https://github.com/clouddrove
[linkedin]: https://cpco.io/linkedin
[twitter]: https://twitter.com/clouddrove/
[email]: https://clouddrove.com/contact-us.html
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=