Updated paths, standarised naming, deleted data.tf
This commit is contained in:
Родитель
44eedd2184
Коммит
028110679e
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
2
main.tf
2
main.tf
|
@ -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
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче