Skip to content

Commit

Permalink
Merge pull request #2 from sironite/task/firstrelease
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
- Module release
  • Loading branch information
TheIronRock95 authored Jul 7, 2023
2 parents 33d426a + 1d8abef commit be07952
Show file tree
Hide file tree
Showing 13 changed files with 266 additions and 34 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
##Connection for a Virtual Hub
```hcl
{{ include "examples/network-watcher-flow-log-example/main.tf" }}
{{ include "examples/virtual-hub-connection-example/main.tf" }}
```
{{ .Providers }}
{{ .Modules }}
Expand Down
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!-- BEGIN_TF_DOCS -->
## Connection for a Virtual Hub
[![Changelog](https://img.shields.io/badge/changelog-release-green.svg)](https://github.com/sironite/terraform-azurerm-virtual_hub_connection/releases/latest) [![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/virtual_hub_connection)

# Usage - Module

##Connection for a Virtual Hub

```hcl
module "virtual_hub_connection" {
source = "sironite/virtual_hub_connection/azurerm"
version = "x.x.x"
name = "example-vhub"
virtual_hub_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Network/virtualHubs/example-vhub"
remote_virtual_network_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Network/virtualNetworks/example-vnet"
internet_security_enabled = true
}
```

## Providers

| Name | Version |
|------|---------|
| azurerm | >=2.0.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [azurerm_virtual_hub_connection.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub_connection) | resource |

## Inputs

| Name | Description | Type | Required |
|------|-------------|------|:--------:|
| remote\_virtual\_network\_id | The ID of the remote virtual network. | `string` | yes |
| virtual\_hub\_connection\_name | The name of the virtual hub connection. | `string` | yes |
| virtual\_hub\_id | The ID of the virtual hub. | `string` | yes |
| address\_prefixes | The address prefixes for the static VNet route. | `list(string)` | no |
| associated\_route\_table\_id | The ID of the associated route table. | `string` | no |
| internet\_security\_enabled | Whether or not internet security is enabled. | `bool` | no |
| labels | The labels for the propagated route table. | `list(string)` | no |
| next\_hop\_type | The next hop type for the static VNet route. | `string` | no |
| route\_table\_ids | The IDs of the propagated route tables. | `list(string)` | no |
| static\_vnet\_route\_name | The name of the static VNet route. | `string` | no |

## Outputs

| Name | Description |
|------|-------------|
| virtual\_hub\_connection\_id | The ID of the virtual hub connection. |
| virtual\_hub\_connection\_name | The name of the virtual hub connection. |

## Related documentation
<!-- END_TF_DOCS -->
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)
* ## Connection for a Virtual Hub
* [![Changelog](https://img.shields.io/badge/changelog-release-green.svg)](https://github.com/sironite/terraform-azurerm-virtual_hub_connection/releases/latest) [![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/virtual_hub_connection)
*
*
*
Expand Down
29 changes: 0 additions & 29 deletions examples/example1/README.md

This file was deleted.

Empty file removed examples/example1/main.tf
Empty file.
Empty file removed examples/example1/variables.tf
Empty file.
37 changes: 37 additions & 0 deletions examples/virtual-hub-connection-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Terraform module | AzureRM - Connection for a Virtual Hub

This Terraform module is designed to create a Connection for a Virtual Hub for Azure.

## Pre-requisites

Using the modules requires the following pre-requisites:
* Active Azure account and subscription

## Usage

`azurerm_virtual_hub_connection`

```hcl
module "virtual_hub_connection" {
source = "sironite/virtual_hub_connection/azurerm"
version = "x.x.x"
name = "example-vhub"
virtual_hub_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Network/virtualHubs/example-vhub"
remote_virtual_network_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Network/virtualNetworks/example-vnet"
internet_security_enabled = true
}
```

## Authors

The module is maintained by [Sironite](https://github.com/sironite)

## Documentation

> product: https://azure.microsoft.com/en-us/
>
> Provider: https://registry.terraform.io/providers/hashicorp/azurerm/latest
>
> Documentation: https://learn.microsoft.com/en-us/azure/?product=popular
9 changes: 9 additions & 0 deletions examples/virtual-hub-connection-example/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module "virtual_hub_connection" {
source = "sironite/virtual_hub_connection/azurerm"
version = "x.x.x"

name = "example-vhub"
virtual_hub_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Network/virtualHubs/example-vhub"
remote_virtual_network_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Network/virtualNetworks/example-vnet"
internet_security_enabled = true
}
56 changes: 56 additions & 0 deletions examples/virtual-hub-connection-example/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
variable "virtual_hub_connection_name" {
type = string
description = "The name of the virtual hub connection."
}

variable "virtual_hub_id" {
type = string
description = "The ID of the virtual hub."
}

variable "remote_virtual_network_id" {
type = string
description = "The ID of the remote virtual network."
}

variable "internet_security_enabled" {
type = bool
description = "Whether or not internet security is enabled."
default = true
}

variable "associated_route_table_id" {
type = string
description = "The ID of the associated route table."
default = null
}

variable "labels" {
type = list(string)
description = "The labels for the propagated route table."
default = []
}

variable "route_table_ids" {
type = list(string)
description = "The IDs of the propagated route tables."
default = []
}

variable "static_vnet_route_name" {
type = string
description = "The name of the static VNet route."
default = null
}

variable "address_prefixes" {
type = list(string)
description = "The address prefixes for the static VNet route."
default = []
}

variable "next_hop_type" {
type = string
description = "The next hop type for the static VNet route."
default = null
}
20 changes: 20 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "azurerm_virtual_hub_connection" "this" {
name = var.virtual_hub_connection_name
virtual_hub_id = var.virtual_hub_id
remote_virtual_network_id = var.remote_virtual_network_id
internet_security_enabled = var.internet_security_enabled

routing {
associated_route_table_id = var.associated_route_table_id
propagated_route_table {
labels = var.labels
route_table_ids = var.route_table_ids
}

static_vnet_route {
name = var.static_vnet_route_name
address_prefixes = var.address_prefixes
next_hop_type = var.next_hop_type
}
}
}
10 changes: 10 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
output "virtual_hub_connection_id" {
description = "The ID of the virtual hub connection."
value = azurerm_virtual_hub_connection.this.id
}

output "virtual_hub_connection_name" {
description = "The name of the virtual hub connection."
value = azurerm_virtual_hub_connection.this.name
}

56 changes: 56 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
variable "virtual_hub_connection_name" {
type = string
description = "The name of the virtual hub connection."
}

variable "virtual_hub_id" {
type = string
description = "The ID of the virtual hub."
}

variable "remote_virtual_network_id" {
type = string
description = "The ID of the remote virtual network."
}

variable "internet_security_enabled" {
type = bool
description = "Whether or not internet security is enabled."
default = true
}

variable "associated_route_table_id" {
type = string
description = "The ID of the associated route table."
default = null
}

variable "labels" {
type = list(string)
description = "The labels for the propagated route table."
default = []
}

variable "route_table_ids" {
type = list(string)
description = "The IDs of the propagated route tables."
default = []
}

variable "static_vnet_route_name" {
type = string
description = "The name of the static VNet route."
default = null
}

variable "address_prefixes" {
type = list(string)
description = "The address prefixes for the static VNet route."
default = []
}

variable "next_hop_type" {
type = string
description = "The next hop type for the static VNet route."
default = null
}
12 changes: 12 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Specify the required version of Terraform
terraform {
required_version = ">= 1.0.0"

# Specify the required version of the azurerm provider
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=2.0.0"
}
}
}

0 comments on commit be07952

Please sign in to comment.