Skip to content

Commit

Permalink
feat: add managed devops pool and dev center
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Vovchenko committed Dec 5, 2024
1 parent e045608 commit 208d6b6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
15 changes: 14 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down Expand Up @@ -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 {
Expand Down
33 changes: 33 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
}

0 comments on commit 208d6b6

Please sign in to comment.