Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: code style unification #24

Merged
merged 6 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/appgw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Providers used in this module:
Modules used in this module:
Name | Version | Source | Description
--- | --- | --- | ---
`vnet` | - | ../../modules/vnet | Manage the network required for the topology.
`appgw` | - | ../../modules/appgw | Create Application Gateway
`vnet` | - | ../../modules/vnet |
`appgw` | - | ../../modules/appgw |


Resources used in this module:
Expand Down Expand Up @@ -349,7 +349,8 @@ Example:
name_prefix = "test-"
```

NOTICE. This prefix is not applied to existing resources. If you plan to reuse i.e. a VNET please specify it's full name,
**Note!** \
This prefix is not applied to existing resources. If you plan to reuse i.e. a VNET please specify it's full name,
even if it is also prefixed with the same value as the one in this property.


Expand All @@ -375,5 +376,4 @@ Default value: `true`




<!-- END_TF_DOCS -->
7 changes: 4 additions & 3 deletions examples/appgw/example.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# --- GENERAL --- #
### GENERAL ###
sebastianczech marked this conversation as resolved.
Show resolved Hide resolved

location = "North Europe"
resource_group_name = "appgw-example"
name_prefix = "fosix-"
Expand All @@ -7,8 +8,8 @@ tags = {
"CreatedWith" = "Terraform"
}

### NETWORK ###

# --- VNET PART --- #
vnets = {
transit = {
name = "transit"
Expand Down Expand Up @@ -36,7 +37,7 @@ vnets = {
}
}

# --- APPGW PART --- #
### LOAD BALANCING ###

appgws = {
"public-empty" = {
Expand Down
20 changes: 13 additions & 7 deletions examples/appgw/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Create or source the Resource Group.
### Create or source a Resource Group ###
acelebanski marked this conversation as resolved.
Show resolved Hide resolved

# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group
resource "azurerm_resource_group" "this" {
count = var.create_resource_group ? 1 : 0
Expand All @@ -18,7 +19,8 @@ locals {
resource_group = var.create_resource_group ? azurerm_resource_group.this[0] : data.azurerm_resource_group.this[0]
}

# Create public IP in order to reuse it in 1 of the application gateways
### Create a public IP in order to reuse it in one of the Application Gateways ###

# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip
resource "azurerm_public_ip" "this" {
name = "pip-existing"
Expand All @@ -31,7 +33,8 @@ resource "azurerm_public_ip" "this" {
tags = var.tags
}

# Manage the network required for the topology.
### Manage the network required for the topology ###

module "vnet" {
source = "../../modules/vnet"

Expand All @@ -47,15 +50,18 @@ module "vnet" {
create_subnets = each.value.create_subnets
subnets = each.value.subnets

network_security_groups = { for k, v in each.value.network_security_groups : k => merge(v, { name = "${var.name_prefix}${v.name}" })
network_security_groups = {
for k, v in each.value.network_security_groups : k => merge(v, { name = "${var.name_prefix}${v.name}" })
}
route_tables = { for k, v in each.value.route_tables : k => merge(v, { name = "${var.name_prefix}${v.name}" })
route_tables = {
for k, v in each.value.route_tables : k => merge(v, { name = "${var.name_prefix}${v.name}" })
}

tags = var.tags
}

# Create Application Gateway
### Create Application Gateways ###

module "appgw" {
source = "../../modules/appgw"

Expand Down Expand Up @@ -90,4 +96,4 @@ module "appgw" {

tags = var.tags
depends_on = [module.vnet, azurerm_public_ip.this]
}
}
4 changes: 2 additions & 2 deletions examples/appgw/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ variable "name_prefix" {
name_prefix = "test-"
```

NOTICE. This prefix is not applied to existing resources. If you plan to reuse i.e. a VNET please specify it's full name,
**Note!** \
This prefix is not applied to existing resources. If you plan to reuse i.e. a VNET please specify it's full name,
even if it is also prefixed with the same value as the one in this property.
EOF
default = ""
Expand Down Expand Up @@ -68,7 +69,6 @@ variable "vnets" {
- `route_tables` - (`map`, optional) map of Route Tables to create, for details see
[VNET module documentation](../../modules/vnet/README.md#route_tables)
EOF

type = map(object({
name = string
create_virtual_network = optional(bool, true)
Expand Down
Loading