From 208d6b6a5b76c6ba935e767c09f147ebbf2e2b41 Mon Sep 17 00:00:00 2001 From: Artem Vovchenko Date: Thu, 5 Dec 2024 13:59:10 +0200 Subject: [PATCH] feat: add managed devops pool and dev center --- main.tf | 15 ++++++++++++++- outputs.tf | 33 +++++++++++++++++++++++++++++++++ variables.tf | 18 ++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index f3ba019..58adf52 100644 --- a/main.tf +++ b/main.tf @@ -15,7 +15,7 @@ locals { network_security_group = substr(join("-", compact(["nsg", var.project, var.environment, var.location, var.instance_number])), 0, 80) network_security_groups = { for item in var.network_security_groups : item => substr(join("-", compact(["nsg", var.project, item, var.environment, var.location, var.instance_number])), 0, 80) } - # Application Security Groups + # Application Security Groups application_security_group = substr(join("-", compact(["asg", var.project, var.environment, var.location, var.instance_number])), 0, 80) application_security_groups = { for item in var.application_security_groups : item => substr(join("-", compact(["asg", var.project, item, var.environment, var.location, var.instance_number])), 0, 80) } @@ -102,6 +102,19 @@ locals { # User Assigned Identity user_assigned_identity = substr(join("-", compact(["id", var.project, var.environment, var.location, var.instance_number])), 0, 63) user_assigned_identities = { for item in var.user_assigned_identities : item => substr(join("-", compact(["id", var.project, item, var.environment, var.location, var.instance_number])), 0, 63) } + + # Dev Center + dev_center = substr(join("-", compact(["dc", var.project, var.environment, + var.location, var.instance_number])), 0, 26) + dev_centers = { for item in var.dev_centers : item => substr(join("-", compact(["dc", var.project, item, var.environment, var.location, var.instance_number])), 0, 26) } + + # Dev Center Project + dev_center_project = substr(join("-", compact(["dcp", var.project, var.environment, var.location, var.instance_number])), 0, 63) + dev_center_projects = { for item in var.dev_center_projects : item => substr(join("-", compact(["dcp", var.project, item, var.environment, var.location, var.instance_number])), 0, 63) } + + # Managed DevOps Pool + managed_devops_pool = substr(join("-", compact(["mdp", var.project, var.environment, var.location, var.instance_number])), 0, 63) + managed_devops_pools = { for item in var.managed_devops_pools : item => substr(join("-", compact(["mdp", var.project, item, var.environment, var.location, var.instance_number])), 0, 63) } } locals { diff --git a/outputs.tf b/outputs.tf index 75f5a64..ddaa829 100644 --- a/outputs.tf +++ b/outputs.tf @@ -283,3 +283,36 @@ output "user_assigned_identities" { description = "Built name of multiple User Assigned Identities with unique particle" value = local.user_assigned_identities } + +# Dev Center +output "dev_center" { + description = "Built name of single Dev Center" + value = local.dev_center +} + +output "dev_centers" { + description = "Built name of multiple Dev Centers with unique particle" + value = local.dev_centers +} + +# Dev Center Project +output "dev_center_project" { + description = "Built name of single Dev Center Project" + value = local.dev_center_project +} + +output "dev_center_projects" { + description = "Built name of multiple Dev Center Projects with unique particle" + value = local.dev_center_projects +} + +# Managed DevOps Pool +output "managed_devops_pool" { + description = "Built name of single Managed DevOps pool" + value = local.managed_devops_pool +} + +output "managed_devops_pools" { + description = "Built name of multiple Managed DevOps Pools with unique particle" + value = local.managed_devops_pools +} diff --git a/variables.tf b/variables.tf index 29884e1..24a6e0b 100644 --- a/variables.tf +++ b/variables.tf @@ -174,3 +174,21 @@ variable "application_security_groups" { description = "Set of unique strings to create Application Security Groups full names" default = [] } + +variable "dev_centers" { + type = set(string) + description = "Set of unique strings to create Dev Center full names" + default = [] +} + +variable "dev_center_projects" { + type = set(string) + description = "Set of unique strings to create Dev Center Project full names" + default = [] +} + +variable "managed_devops_pools" { + type = set(string) + description = "Set of unique strings to create Managed DevOps Pool full names" + default = [] +}