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

feat: remove ui support #171

Merged
merged 5 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion templates/basic/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
locals {
starter_location = var.starter_locations[0]
}

module "enterprise_scale" {
source = "Azure/caf-enterprise-scale/azurerm"
version = "~> 6.0.0"

disable_telemetry = true

default_location = var.starter_location
default_location = local.starter_location
root_parent_id = var.root_parent_management_group_id == "" ? data.azurerm_client_config.current.tenant_id : var.root_parent_management_group_id

deploy_corp_landing_zones = true
Expand Down
18 changes: 9 additions & 9 deletions templates/basic/variables.tf
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
variable "starter_location" {
type = string
description = "The location for Azure resources. (e.g 'uksouth')|1|azure_location"
variable "starter_locations" {
type = list(string)
description = "The location for Azure resources. (e.g 'uksouth')|azure_location"
}

variable "subscription_id_connectivity" {
type = string
description = "The identifier of the Connectivity Subscription. (e.g '00000000-0000-0000-0000-000000000000')|3|azure_subscription_id"
description = "The identifier of the Connectivity Subscription. (e.g '00000000-0000-0000-0000-000000000000')|azure_subscription_id"
}

variable "subscription_id_identity" {
type = string
description = "The identifier of the Identity Subscription. (e.g '00000000-0000-0000-0000-000000000000')|4|azure_subscription_id"
description = "The identifier of the Identity Subscription. (e.g '00000000-0000-0000-0000-000000000000')|azure_subscription_id"
}

variable "subscription_id_management" {
type = string
description = "The identifier of the Management Subscription. (e.g 00000000-0000-0000-0000-000000000000)|5|azure_subscription_id"
description = "The identifier of the Management Subscription. (e.g 00000000-0000-0000-0000-000000000000)|azure_subscription_id"
}

variable "root_id" {
type = string
default = "es"
description = "The root id is the identity for the root management group and a prefix applied to all management group identities|6|azure_name"
description = "The root id is the identity for the root management group and a prefix applied to all management group identities|azure_name"
}

variable "root_name" {
type = string
default = "Enterprise-Scale"
description = "The display name for the root management group|7|azure_name"
description = "The display name for the root management group|azure_name"
}

variable "root_parent_management_group_id" {
type = string
default = ""
description = "The parent management group id. Defaults to `Tenant Root Group` if not supplied.|2"
description = "The parent management group id. Defaults to `Tenant Root Group` if not supplied."
}
5 changes: 4 additions & 1 deletion templates/complete/locals.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
locals {
starter_location = var.starter_locations[0]
}
locals {
config_file_extension = replace(lower(element(local.config_file_split, length(local.config_file_split) - 1)), local.const_yml, local.const_yaml)
config_file_name = var.configuration_file_path == "" ? "config.yaml" : basename(var.configuration_file_path)
Expand All @@ -11,7 +14,7 @@ locals {
jsondecode(templatefile("${path.module}/${local.config_file_name}", local.config_template_file_variables))
)
config_template_file_variables = {
starter_location = var.starter_location
starter_location = local.starter_location
default_postfix = var.default_postfix
root_parent_management_group_id = var.root_parent_management_group_id == "" ? data.azurerm_client_config.core.tenant_id : var.root_parent_management_group_id
subscription_id_connectivity = var.subscription_id_connectivity
Expand Down
2 changes: 1 addition & 1 deletion templates/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "enterprise_scale" {
count = length(local.archetypes) > 0 ? 1 : 0

disable_telemetry = try(local.archetypes.disable_telemetry, true)
default_location = try(local.archetypes.default_location, var.starter_location)
default_location = try(local.archetypes.default_location, local.starter_location)
root_parent_id = try(local.archetypes.root_parent_id, data.azurerm_client_config.core.tenant_id)
archetype_config_overrides = try(local.archetypes.archetype_config_overrides, {})
configure_connectivity_resources = try(local.archetypes.configure_connectivity_resources, {})
Expand Down
18 changes: 9 additions & 9 deletions templates/complete/variables.tf
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
variable "starter_location" {
type = string
description = "The location for Azure resources. (e.g 'uksouth')|1|azure_location"
variable "starter_locations" {
type = list(string)
description = "The location for Azure resources. (e.g 'uksouth')|azure_location"
}

variable "subscription_id_connectivity" {
type = string
description = "value of the subscription id for the Connectivity subscription|5|azure_subscription_id"
description = "value of the subscription id for the Connectivity subscription|azure_subscription_id"
}

variable "subscription_id_identity" {
type = string
description = "value of the subscription id for the Identity subscription|6|azure_subscription_id"
description = "value of the subscription id for the Identity subscription|azure_subscription_id"
}

variable "subscription_id_management" {
type = string
description = "value of the subscription id for the Management subscription|4|azure_subscription_id"
description = "value of the subscription id for the Management subscription|azure_subscription_id"
}

variable "configuration_file_path" {
type = string
default = ""
description = "The path of the configuration file|7|configuration_file_path"
description = "The path of the configuration file|configuration_file_path"
}

variable "default_postfix" {
type = string
default = "landing-zone"
description = "The default postfix for Azure resources. (e.g 'landing-zone')|2|azure_name"
description = "The default postfix for Azure resources. (e.g 'landing-zone')|azure_name"
}

variable "root_parent_management_group_id" {
type = string
default = ""
description = "This is the id of the management group that the ALZ hierarchy will be nested under, will default to the Tenant Root Group|3|azure_name"
description = "This is the id of the management group that the ALZ hierarchy will be nested under, will default to the Tenant Root Group|azure_name"
}
14 changes: 7 additions & 7 deletions templates/complete_multi_region/variables.tf
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
variable "starter_locations" {
type = list(string)
description = "The location for Azure resources. (e.g 'uksouth')|1|azure_location"
description = "The location for Azure resources. (e.g 'uksouth')|azure_location"
}

variable "subscription_id_connectivity" {
type = string
description = "value of the subscription id for the Connectivity subscription|5|azure_subscription_id"
description = "value of the subscription id for the Connectivity subscription|azure_subscription_id"
}

variable "subscription_id_identity" {
type = string
description = "value of the subscription id for the Identity subscription|6|azure_subscription_id"
description = "value of the subscription id for the Identity subscription|azure_subscription_id"
}

variable "subscription_id_management" {
type = string
description = "value of the subscription id for the Management subscription|4|azure_subscription_id"
description = "value of the subscription id for the Management subscription|azure_subscription_id"
}

variable "configuration_file_path" {
type = string
default = "config-hub-and-spoke-vnet.yaml"
description = "The path of the configuration file|7|configuration_file_path"
description = "The path of the configuration file|configuration_file_path"
}

variable "default_postfix" {
type = string
default = "landing-zone"
description = "The default postfix for Azure resources. (e.g 'landing-zone')|2|azure_name"
description = "The default postfix for Azure resources. (e.g 'landing-zone')|azure_name"
}

variable "root_parent_management_group_id" {
type = string
default = ""
description = "This is the id of the management group that the ALZ hierarchy will be nested under, will default to the Tenant Root Group|3|azure_name"
description = "This is the id of the management group that the ALZ hierarchy will be nested under, will default to the Tenant Root Group|azure_name"
}
6 changes: 1 addition & 5 deletions templates/complete_vnext/data.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
data "azurerm_client_config" "core" {}

data "azurerm_management_group" "root" {
name = local.root_parent_management_group_id
}
#TODO...
71 changes: 1 addition & 70 deletions templates/complete_vnext/locals.tf
Original file line number Diff line number Diff line change
@@ -1,70 +1 @@
locals {
config_file_extension = replace(lower(element(local.config_file_split, length(local.config_file_split) - 1)), local.const_yml, local.const_yaml)
config_file_name = var.configuration_file_path == "" ? "config.yaml" : basename(var.configuration_file_path)
config_file_split = split(".", local.config_file_name)
const_yaml = "yaml"
const_yml = "yml"
}
locals {
config = (local.config_file_extension == local.const_yaml || local.config_file_extension == local.const_yml ?
yamldecode(templatefile("${path.module}/${local.config_file_name}", local.config_template_file_variables)) :
jsondecode(templatefile("${path.module}/${local.config_file_name}", local.config_template_file_variables))
)
config_template_file_variables = {
default_location = var.default_location
default_postfix = var.default_postfix
root_parent_management_group_id = var.root_parent_management_group_id == "" ? data.azurerm_client_config.core.tenant_id : var.root_parent_management_group_id
subscription_id_connectivity = var.subscription_id_connectivity
subscription_id_identity = var.subscription_id_identity
subscription_id_management = var.subscription_id_management
}
}
locals {
management_group_resource_id_format = "/providers/Microsoft.Management/managementGroups/%s"
management_groups = { for k, v in local.config.management_groups : k => {
id = v.id
display_name = try(v.display_name, v.id)
parent = v.parent
parent_resource_id = v.parent == local.root_parent_management_group_id ? data.azurerm_management_group.root.id : format(local.management_group_resource_id_format, local.config.management_groups[v.parent].id)
base_archetype = v.base_archetype
subscriptions = try(v.subscriptions, [])
is_root = v.parent == local.root_parent_management_group_id
}
}
management_groups_layer_1 = { for k, v in local.management_groups : k => v if v.is_root }
management_groups_layer_2 = { for k, v in local.management_groups : k => v if contains(keys(local.management_groups_layer_1), v.parent) }
management_groups_layer_3 = { for k, v in local.management_groups : k => v if contains(keys(local.management_groups_layer_2), v.parent) }
management_groups_layer_4 = { for k, v in local.management_groups : k => v if contains(keys(local.management_groups_layer_3), v.parent) }
management_groups_layer_5 = { for k, v in local.management_groups : k => v if contains(keys(local.management_groups_layer_4), v.parent) }
management_groups_layer_6 = { for k, v in local.management_groups : k => v if contains(keys(local.management_groups_layer_5), v.parent) }
management_groups_layer_7 = { for k, v in local.management_groups : k => v if contains(keys(local.management_groups_layer_6), v.parent) }
root_parent_management_group_id = local.config_template_file_variables.root_parent_management_group_id
}
locals {
log_analytics_workspace_id = module.management_resources.log_analytics_workspace.id
management = local.config.management
}
locals {
hub_virtual_networks = try(merge(local.config.connectivity.hubnetworking.hub_virtual_networks, {}), {})
module_hubnetworking = {
hub_virtual_networks = {
for key, hub_virtual_network in local.hub_virtual_networks : key => {
for argument, value in hub_virtual_network : argument => value if argument != "virtual_network_gateway"
}
}
}
module_virtual_network_gateway = {
for key, hub_virtual_network in local.hub_virtual_networks : key => merge(
hub_virtual_network.virtual_network_gateway,
{
location = hub_virtual_network.location
virtual_network_id = module.hubnetworking[0].virtual_networks[key].id

}
)
if can(hub_virtual_network.virtual_network_gateway)
}
}
locals {
module_vwan = try(merge(local.config.connectivity.vwan, {}), {})
}
#TODO..
Loading
Loading