From 2ada47557f45fbd428006a7f83cd5ff6791edfa7 Mon Sep 17 00:00:00 2001 From: Abby Artagame Date: Tue, 12 Nov 2024 14:36:40 +1100 Subject: [PATCH] Added catalog, project and gallery --- tf/main.tf | 49 +++++++++++++++++++++++++++++++++++++++++ tf/variables.tf | 8 +++++++ tf/variables/dev.tfvars | 2 ++ 3 files changed, 59 insertions(+) diff --git a/tf/main.tf b/tf/main.tf index a8276a7..93ae781 100644 --- a/tf/main.tf +++ b/tf/main.tf @@ -43,4 +43,53 @@ resource "azurerm_dev_center" "devCenter" { type = "UserAssigned" identity_ids = [azurerm_user_assigned_identity.userIdentity.id] } +} + +# Dev Center +resource "azurerm_dev_center" "devCenter" { + location = data.azurerm_resource_group.rg.location + name = var.devCenterName + resource_group_name = data.azurerm_resource_group.rg.name + identity { + type = "UserAssigned" + identity_ids = [azurerm_user_assigned_identity.userIdentity.id] + } +} + +resource "azurerm_dev_center_catalog" "devCenterCatalogs" { + name = "DevBoxQuickStartTasks" + resource_group_name = data.azurerm_resource_group.rg.name + dev_center_id = azurerm_dev_center.devCenter.id + catalog_github { + branch = "main" + path = "" + uri = "https://github.com/microsoft/devcenter-catalog.git" + key_vault_key_url = "" + } +} + +resource "azurerm_dev_center_catalog" "devCenterCatalogs" { + name = "DevBoxQuickStartTasks" + resource_group_name = data.azurerm_resource_group.rg.name + dev_center_id = azurerm_dev_center.devCenter.id + catalog_github { + branch = "main" + path = "" + uri = "https://github.com/microsoft/devcenter-catalog.git" + key_vault_key_url = "" + } +} + +resource "azurerm_dev_center_project" "devCenterProject" { + dev_center_id = azurerm_dev_center.devCenter.id + location = data.azurerm_resource_group.rg.location + name = var.projectName + resource_group_name = data.azurerm_resource_group.rg.name +} + +resource "azurerm_shared_image_gallery" "azureGallery" { + name = var.galleryName + resource_group_name = data.azurerm_resource_group.rg.name + location = data.azurerm_resource_group.rg.location + description = "Test Gallery" } \ No newline at end of file diff --git a/tf/variables.tf b/tf/variables.tf index f846043..cd38567 100644 --- a/tf/variables.tf +++ b/tf/variables.tf @@ -4,4 +4,12 @@ variable "devCenterUserIdentity" { variable "devCenterName" { type = string +} + +variable "projectName" { + type = string +} + +variable "galleryName" { + type = string } \ No newline at end of file diff --git a/tf/variables/dev.tfvars b/tf/variables/dev.tfvars index 18f9e25..9ad30d8 100644 --- a/tf/variables/dev.tfvars +++ b/tf/variables/dev.tfvars @@ -1,2 +1,4 @@ devCenterUserIdentity = "dev-poc-uid-aue-001" devCenterName = "dev-poc-dc-aue-001" +projectName = "dev-poc-prj-aue-001" +galleryName = "dev-poc-prj-aue-001" \ No newline at end of file