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

[Bug] No attribute specified when one (and only one) of │ [provisioning_scheme.azure_machine_config.azure_pvs_config.<.azure_pvs_config,provisioning_scheme.azure_machine_config.azure_pvs_config.<.azure_master_image] is required when creating Azure AD Catalogs #111

Open anandprateek1 opened 2 weeks ago

anandprateek1 commented 2 weeks ago

I'm trying to create EntraID joined machine catalog using terraform provider and have tried several permutations and combinations, but getting below error everytime, I'm not using PVS so not sure why azure_pvs_config is requried

Citrix TF provider version 1.0.1

Error: Invalid Attribute Combination │ │ with citrix_machine_catalog.example-catalog, │ on machine_catalog.tf line 2, in resource "citrix_machine_catalog" "example-catalog": │ 2: resource "citrix_machine_catalog" "example-catalog" { │ │ No attribute specified when one (and only one) of │ [provisioning_scheme.azure_machine_config.azure_pvs_config.<.azure_pvs_config,provisioning_scheme.azure_machine_config.azure_pvs_config.<.azure_master_image] is │ required

Below is my terraform code, request you to review and me know if there's some mistake i might be making here.

resource "citrix_machine_catalog" "example-catalog" {
    name                        = "Terraform-Catalog"
    description                 = "Automated Azure AD Catalog"
    allocation_type             = "Random"
    session_support             = "MultiSession"
    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            = "AzureAD"
        enroll_in_intune         = true
        network_mapping = [ {
          network_device = "VNetName"
          network = "SubnetName"
        } ]
        azure_machine_config     = {
            service_offering     = "Standard_B4ms"
            machine_profile = {

                machine_profile_resource_group = "Demo-RG"
                # machine_profile_vm_name = "Demo-Win11"
                machine_profile_template_spec_name = "Win11AVD"
                machine_profile_template_spec_version = "1.0.0"

            }
            storage_type         = "StandardSSD_LRS"
            use_managed_disks    = true
        }
        number_of_total_machines = 1
        machine_account_creation_rules = {
            naming_scheme = "AAD-AVD#"
            naming_scheme_type = "Numeric"
        }
    }
}
aneeshk-citrix commented 1 week ago

Hi @anandprateek1,

It seems that you are not specifying azure_master_image which is required when creating an Azure MCS Machine Catalog. I understand that the error message is not obvious and we'll take this issue to fix the error messaging.

Please let us know if you are able to move forward after specifying azure_master_image.

Thanks, Aneesh

anandprateek1 commented 1 week ago

Hello @aneeshk-citrix

Thank you for your response, adding azure_master_image worked.

You are correct, the error message is somewhat misleading.