Open damienaicheh opened 1 month ago
Example azapi config, if that helps:
resource "azapi_resource" "devbox-networkconnections" {
for_each = azurerm_dev_center.devbox
## one per region
## for_each = local.regions
type = "Microsoft.DevCenter/networkConnections@2023-04-01"
name = "${each.value.name}-network01"
// resource group id for the parent id!!
## parent_id = azurerm_resource_group.devcenter[each.key].id
parent_id = azurerm_resource_group.devcenter-connection[each.key].id
location = each.value.location
body = jsonencode({
properties = {
domainJoinType = "AzureADJoin"
## HybridAzureADJoin needs the following:
## domainName = "string"
## domainPassword = "string"
## domainUsername = "string"
## organizationUnit = "string"
## needs to be new - so cannot already exist, so we let azure manage this itself
## networkingResourceGroupName = "${var.prefix}-devcenter-network-rg"
subnetId = data.azurerm_subnet.lab.id
}
})
tags = each.value.tags
lifecycle {
create_before_destroy = true
}
}
Hi @webstean, thanks for the support.
I saw that we have the ability to create nework connections now with the ressources azurerm_dev_center_network_connection
however we need the az api resource to attach it to the dev center:
resource "azapi_resource" "example" {
type = "Microsoft.DevCenter/devcenters/attachednetworks@2022-11-11-preview"
name = "ExampleNetworkConnection"
parent_id = azurerm_dev_center.this.id
body = jsonencode({
properties = {
networkConnectionId = azurerm_dev_center_network_connection.this.id
}
})
}
To be more precise, this resource is missing @rcskosir
Is there an existing issue for this?
Community Note
Description
Dev Centers needs to be connected to internal networks using Network Connections.
Those 2 elements are missing:
New or Affected Resource(s)/Data Source(s)
azurerm_dev_center
Potential Terraform Configuration
No response
References
https://github.com/hashicorp/terraform-provider-azurerm/issues/23367