Updated paths, standarised naming, deleted data.tf

This commit is contained in:
Luke Devonshire 2020-06-08 11:40:26 +01:00
Родитель 44eedd2184
Коммит 028110679e
6 изменённых файлов: 23 добавлений и 14 удалений

Просмотреть файл

@ -3,11 +3,12 @@ provider "azurerm" {
features {}
}
resource "random_string" "random_name" {
length = 5
special = false
lower = true
min_lower = 5
locals {
unique_name_stub = substr(module.naming.unique-seed, 0, 5)
}
module "naming" {
source = "git::https://github.com/Azure/terraform-azurerm-naming"
}
module "networking" {
@ -15,10 +16,10 @@ module "networking" {
}
module "firewall" {
source = "../"
source = "../../"
resource_group_name = module.networking.virtual_network_resource_group_name
virtual_network = module.networking.virtual_network
prefix = [random_string.random_name.result]
suffix = [random_string.random_name.result]
prefix = [local.unique_name_stub]
suffix = [local.unique_name_stub]
public_ip_sku = "Standard"
}

Просмотреть файл

@ -3,12 +3,16 @@ provider "azurerm" {
features {}
}
locals {
unique_name_stub = substr(module.naming.unique-seed, 0, 5)
}
module "naming" {
source = "git@github.com:Azure/terraform-azurerm-naming"
source = "git::https://github.com/Azure/terraform-azurerm-naming"
}
resource "azurerm_resource_group" "test_group" {
name = "${module.naming.resource_group.slug}-${module.naming.firewall.slug}-minimal-test-${substr(module.naming.unique-seed, 0, 6)}"
name = "${module.naming.resource_group.slug}-${module.naming.firewall.slug}-max-test-${local.unique_name_stub}"
location = "uksouth"
}

Просмотреть файл

Просмотреть файл

@ -8,7 +8,7 @@ module "networking" {
}
module "firewall" {
source = "../"
source = "../../"
resource_group_name = module.networking.virtual_network_resource_group_name
virtual_network = module.networking.virtual_network
}

Просмотреть файл

@ -4,12 +4,16 @@ provider "azurerm" {
features {}
}
locals {
unique_name_stub = substr(module.naming.unique-seed, 0, 5)
}
module "naming" {
source = "git@github.com:Azure/terraform-azurerm-naming"
source = "git::https://github.com/Azure/terraform-azurerm-naming"
}
resource "azurerm_resource_group" "test_group" {
name = "${module.naming.resource_group.slug}-${module.naming.firewall.slug}-minimal-test-${substr(module.naming.unique-seed, 0, 6)}"
name = "${module.naming.resource_group.slug}-${module.naming.firewall.slug}-min-test-${local.unique_name_stub}"
location = "uksouth"
}

Просмотреть файл

@ -4,7 +4,7 @@ provider "azurerm" {
}
module "naming" {
source = "git@github.com:Azure/terraform-azurerm-naming"
source = "git::https://github.com/Azure/terraform-azurerm-naming"
suffix = var.suffix
prefix = var.prefix
}