From b2f1cb9d675868fca52d3478e23eb07d5b5ec863 Mon Sep 17 00:00:00 2001 From: Maciej Michalski <5445923+spy86@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:42:51 +0200 Subject: [PATCH 1/5] Delete examples/route-table/README.md --- examples/route-table/README.md | 70 ---------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 examples/route-table/README.md diff --git a/examples/route-table/README.md b/examples/route-table/README.md deleted file mode 100644 index 09dc2c8..0000000 --- a/examples/route-table/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Terraform Module: Azure Route Table - -This Terraform module creates an Azure Route Table with dynamic route entries. - -## Features - -- **Dynamic Route Entries:** Define dynamic route entries as a list of objects, each representing a route with a name, address prefix, next hop type, and optional next hop IP address. - -- **Tagging:** Automatically tags the created resources with common tags for better organization and management. - -- **BGP Route Propagation:** Option to disable propagation of routes learned by BGP on the route table. - -## Usage - -### Example - -```hcl -provider "azurerm" { -features {} -} - -module "route_table" { - source = "Think-Cube/route-table/azure" - version = "1.0.0" - route_table_name = "routetable" - resource_group_name = "weu-test-rg" - resource_group_location = "West Europe" - environment = "dev" - region = "weu" - route_table = [ - { name = "Route-01", address_prefix = "10.10.0.0/16", next_hop_type = "VirtualAppliance", next_hop_in_ip_address = "10.0.0.12" }, - { name = "Route-02", address_prefix = "10.20.0.0/16", next_hop_type = "VirtualAppliance", next_hop_in_ip_address = "10.0.0.16" }, - { name = "Route-03", address_prefix = "0.0.0.0/0", next_hop_type = "Internet" } - ] - route_table_disable_bgp_route_propagation = "true" - default_tags = { - Administrator = "John Doe" - Department = "IT" - CostCentre = "CC123" - ContactPerson = "Jane Smith" - ManagedByTerraform = "True" -} -} -``` - -### Variables - -- `environment`: Variable that defines the name of the environment. -- `default_tags`: A mapping of tags to assign to the resource. -- `region`: Region in which resources are deployed. -- `resource_group_location`: Specifies the supported Azure location where the resource exists. -- `resource_group_name`: The name of the resource group in which to create the route table. -- `route_table`: The name of the route table. -- `route_table_disable_bgp_route_propagation`: Boolean flag to control propagation of routes learned by BGP on that route table. - -### Outputs - -- `route_table_id`: The Route Table ID. -- `route_table_name`: The name of the route table. -- `route_entries`: Objects representing routes. -- `location`: Azure location where the resource exists. -- `resource_group_name`: The name of the resource group in which the route table was created. - -## License - -This project is licensed under the [MIT License](https://opensource.org/licenses/MIT). - -## Contribution - -Feel free to contribute by opening issues or pull requests. Your feedback and improvements are highly appreciated! From 98c506b6b499a9d823a640aff385a729d4ea762e Mon Sep 17 00:00:00 2001 From: Maciej Michalski <5445923+spy86@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:43:43 +0200 Subject: [PATCH 2/5] Create .terraform-docs.yml --- .terraform-docs.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .terraform-docs.yml diff --git a/.terraform-docs.yml b/.terraform-docs.yml new file mode 100644 index 0000000..db9c29e --- /dev/null +++ b/.terraform-docs.yml @@ -0,0 +1,40 @@ +# .terraform-docs.yaml +formatter: toml # this is required + +version: "" + +header-from: main.tf +footer-from: "variables.tf" + + +content: "" + +output: + file: README.md # output-file + mode: replace + template: |- + + {{ .Content }} + + +output-values: + enabled: false + from: "" + +sort: + enabled: true + by: name + +settings: + anchor: true + color: true + default: true + description: false + escape: true + hide-empty: true + html: true + indent: 4 + lockfile: true + required: true + sensitive: true + type: true From 3f9a0617010cd396101e5397579d8c28a9fe1634 Mon Sep 17 00:00:00 2001 From: Maciej Michalski <5445923+spy86@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:44:03 +0200 Subject: [PATCH 3/5] Update backend.tf --- backend.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend.tf b/backend.tf index 7f32883..ade662d 100644 --- a/backend.tf +++ b/backend.tf @@ -1,9 +1,9 @@ terraform { required_providers { azurerm = { - source = "hashicorp/azurerm" - version = "3.94.0" + source = "hashicorp/azurerm" + version = "3.100.0" } } required_version = ">= 1.6.4" -} \ No newline at end of file +} From f8f057e1c91120eb631bfd89e2ecd46325554220 Mon Sep 17 00:00:00 2001 From: Maciej Michalski <5445923+spy86@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:45:08 +0200 Subject: [PATCH 4/5] Create documentation.yml --- .github/workflows/documentation.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..5a3a19d --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,19 @@ +name: Generate terraform docs +on: + - pull_request +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: Render terraform docs inside the README.md and push changes back to PR branch + uses: terraform-docs/gh-actions@v1.0.0 + with: + github-token: ${{ secrets.GH_TOKEN }} + working-dir: . + output-file: README.md + output-method: replace + config-file: .terraform-docs.yml + git-push: "true" From f51bd83c77a57f9e50dc536dedaee269769042ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Apr 2024 19:46:09 +0000 Subject: [PATCH 5/5] terraform-docs: automated action --- README.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 899aa81..0fb790d 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,26 @@ -## Requirements +#### Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.6.4 | -| [azurerm](#requirement\_azurerm) | 3.94.0 | +| [azurerm](#requirement\_azurerm) | 3.100.0 | -## Providers +#### Providers | Name | Version | |------|---------| -| [azurerm](#provider\_azurerm) | 3.94.0 | +| [azurerm](#provider\_azurerm) | 3.100.0 | -## Modules - -No modules. - -## Resources +#### Resources | Name | Type | |------|------| -| [azurerm_route_table.main](https://registry.terraform.io/providers/hashicorp/azurerm/3.94.0/docs/resources/route_table) | resource | -| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/3.94.0/docs/data-sources/client_config) | data source | -| [azurerm_resource_group.main](https://registry.terraform.io/providers/hashicorp/azurerm/3.94.0/docs/data-sources/resource_group) | data source | +| [azurerm_route_table.main](https://registry.terraform.io/providers/hashicorp/azurerm/3.100.0/docs/resources/route_table) | resource | +| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/3.100.0/docs/data-sources/client_config) | data source | +| [azurerm_resource_group.main](https://registry.terraform.io/providers/hashicorp/azurerm/3.100.0/docs/data-sources/resource_group) | data source | -## Inputs +#### Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| @@ -37,7 +33,7 @@ No modules. | [route\_table\_disable\_bgp\_route\_propagation](#input\_route\_table\_disable\_bgp\_route\_propagation) | Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable. | `bool` | `true` | no | | [route\_table\_name](#input\_route\_table\_name) | The name of the route table. Changing this forces a new resource to be created. | `string` | n/a | yes | -## Outputs +#### Outputs | Name | Description | |------|-------------|