citrix / terraform-provider-citrix

Terraform Provider for Citrix
https://registry.terraform.io/providers/citrix/citrix/latest
Apache License 2.0
45 stars 5 forks source link

changing name in citrix_machine_catalog destroys and recreates the catalog instead of modification of the name #106

Closed anandprateek1 closed 2 months ago

anandprateek1 commented 2 months ago

I'm using below block of code to create a machine catalog

resource "citrix_machine_catalog" "example-catalog" { name = "Catalog1" description = "this is machine catalog" allocation_type = "Static" session_support = "SingleSession" provisioning_type = "MCS" zone = data.citrix_zone.zone.id provisioning_scheme = { hypervisor = data.citrix_hypervisor.azure-hypervisor.id hypervisor_resource_pool = data.citrix_hypervisor_resource_pool.azure-resource-pool.id identity_type = "ActiveDirectory" machine_domain_identity = { domain = "Domain.com" domain_ou = "OU=VDA,DC=domain,DC=com" service_account = "domainadmin@domain.com" service_account_password = "SupeSecret" } azure_machine_config = { service_offering = "Standard_B4ms" azure_master_image = { resource_group = "RG-MCS" master_image = "myOSDisk"

Uncomment if the image is from a subscription outside of the hypervisor's subscription

            # shared_subscription = var.azure_image_subscription
            # For Azure image gallery
            # gallery_image = {
            #     gallery    = var.azure_gallery_name
            #     definition = var.azure_gallery_image_definition
            #     version    = var.azure_gallery_image_version
            # }
        }
        storage_type         = "Standard_LRS"
        use_managed_disks    = true
    }
    number_of_total_machines = 1
    machine_account_creation_rules = {
        naming_scheme = "TF-MCS#"
        naming_scheme_type = "Numeric"
    }
}
depends_on = [null_resource.stop_vm]

}

If I modify the Description, it successfully modifies the description without destroying the catalo, however upon changing the name, it destroys and recrates the catalog.

xushengl commented 2 months ago

Hi @anandprateek1

This is by design. When the name is updated, the machine catalog resource will be replaced (destroy + create with new name). Description can be updated without replacing the entire resource

Best Regards, Xusheng "Fred" Liu

anandprateek1 commented 2 months ago

Hello @xushengl

Thank you for your response. We can rename the catalog using GUI and using PoSH cmdlet Rename-BrokerCatalog without destroying the same, are we planning to release this functionality in next terraform release?

xushengl commented 2 months ago

Hi @anandprateek1

We will add support to update machine catalog name without destroying the existing resource.

Best Regards, Xusheng "Fred" Liu