https://github.com/libre-devops/terraform-azurerm-dev-center
A module used to deploy Azure Dev Center
https://github.com/libre-devops/terraform-azurerm-dev-center
Last synced: about 1 month ago
JSON representation
A module used to deploy Azure Dev Center
- Host: GitHub
- URL: https://github.com/libre-devops/terraform-azurerm-dev-center
- Owner: libre-devops
- License: mit
- Created: 2024-09-26T22:31:03.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-08T22:56:05.000Z (about 2 months ago)
- Last Synced: 2025-03-08T23:25:58.017Z (about 2 months ago)
- Language: PowerShell
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
```hcl
# Dev Center Resource
resource "azurerm_dev_center" "dev_centers" {
for_each = { for dc in var.dev_centers : dc.name => dc }
location = each.value.location
name = each.value.name
resource_group_name = each.value.rg_name
tags = each.value.tagsdynamic "identity" {
for_each = each.value.identity_type == "SystemAssigned" ? [each.value.identity_type] : []
content {
type = each.value.identity_type
}
}dynamic "identity" {
for_each = each.value.identity_type == "SystemAssigned, UserAssigned" ? [each.value.identity_type] : []
content {
type = each.value.identity_type
identity_ids = try(each.value.identity_ids, [])
}
}dynamic "identity" {
for_each = each.value.identity_type == "UserAssigned" ? [each.value.identity_type] : []
content {
type = each.value.identity_type
identity_ids = length(try(each.value.identity_ids, [])) > 0 ? each.value.identity_ids : []
}
}
}# Network Connection Resource
resource "azurerm_dev_center_network_connection" "network_connections" {
for_each = { for dc in var.dev_centers : dc.name => dc if contains(keys(dc), "network_connection") && dc.network_connection != null }name = each.value.network_connection.name != null ? each.value.network_connection.name : "netcon-${each.key}"
resource_group_name = azurerm_dev_center.dev_centers[each.key].resource_group_name
location = azurerm_dev_center.dev_centers[each.key].location
domain_join_type = each.value.network_connection.domain_join_type
subnet_id = each.value.network_connection.subnet_id# Optional attributes
domain_name = try(each.value.network_connection.domain_name, null)
domain_password = try(each.value.network_connection.domain_password, null)
domain_username = try(each.value.network_connection.domain_username, null)
organization_unit = try(each.value.network_connection.organization_unit, null)tags = azurerm_dev_center.dev_centers[each.key].tags
}resource "azurerm_dev_center_project" "projects" {
for_each = {
for dc in var.dev_centers : dc.name => dc
if lookup(dc, "create_project", false) == true
}dev_center_id = azurerm_dev_center.dev_centers[each.key].id
location = azurerm_dev_center.dev_centers[each.key].location
name = each.value.project.name != null ? each.value.project.name : "proj-${each.key}"
resource_group_name = azurerm_dev_center.dev_centers[each.key].resource_group_name
description = try(each.value.project.description, "Default project description for ${each.key}")
maximum_dev_boxes_per_user = try(each.value.project.maximum_dev_boxes_per_user, null)
tags = try(each.value.project.tags, azurerm_dev_center.dev_centers[each.key].tags)
}
```
## RequirementsNo requirements.
## Providers
| Name | Version |
|------|---------|
| [azurerm](#provider\_azurerm) | n/a |## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [azurerm_dev_center.dev_centers](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/dev_center) | resource |
| [azurerm_dev_center_network_connection.network_connections](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/dev_center_network_connection) | resource |
| [azurerm_dev_center_project.projects](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/dev_center_project) | resource |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [dev\_centers](#input\_dev\_centers) | List of Dev Centers to create, along with optional compute gallery configuration |list(object({| n/a | yes |
name = string
location = optional(string, "uksouth")
rg_name = string
tags = optional(map(string))
identity_type = optional(string)
identity_ids = optional(list(string))
# Network connection related fields
network_connection = optional(object({
name = optional(string)
domain_join_type = optional(string, "AzureADJoin")
subnet_id = string
domain_name = optional(string)
domain_password = optional(string)
domain_username = optional(string)
organization_unit = optional(string)
tags = optional(map(string))
}))
create_project = optional(bool, false) # Flag to create a Dev Center project
project = optional(object({
name = optional(string)
description = optional(string)
maximum_dev_boxes_per_user = optional(number, 0)
tags = optional(map(string))
}))
}))## Outputs
| Name | Description |
|------|-------------|
| [dev\_center\_identities](#output\_dev\_center\_identities) | The identities of the Dev Centers |
| [dev\_center\_ids](#output\_dev\_center\_ids) | The IDs of the Dev Centers |
| [dev\_center\_names](#output\_dev\_center\_names) | The default name of the Dev Centers |
| [dev\_center\_network\_connection\_ids](#output\_dev\_center\_network\_connection\_ids) | The IDs of the Dev Center Network Connections |
| [dev\_center\_project\_id](#output\_dev\_center\_project\_id) | The ID of the created Dev Center Project |
| [dev\_center\_project\_location](#output\_dev\_center\_project\_location) | The location of the created Dev Center Project |
| [dev\_center\_project\_max\_dev\_boxes](#output\_dev\_center\_project\_max\_dev\_boxes) | The maximum dev boxes per user for the created Dev Center Project |
| [dev\_center\_project\_name](#output\_dev\_center\_project\_name) | The name of the created Dev Center Project |
| [dev\_center\_project\_resource\_group](#output\_dev\_center\_project\_resource\_group) | The resource group of the created Dev Center Project |
| [dev\_center\_project\_uri](#output\_dev\_center\_project\_uri) | The URI of the created Dev Center Project |
| [dev\_center\_tags](#output\_dev\_center\_tags) | The tags of the Dev Centers |
| [dev\_center\_uri](#output\_dev\_center\_uri) | The URI of the Dev Centers |