Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to lookup data resource citrix_admin_scope using name for type tenant #157

Closed
hewozuoai opened this issue Nov 15, 2024 · 2 comments · Fixed by #160
Closed
Labels
bug Something isn't working 🔧

Comments

@hewozuoai
Copy link

hewozuoai commented Nov 15, 2024

Describe the bug

trying to use data resource for citrix_admin_scope for a type tenant scope;

data "citrix_admin_scope" "test_scope_by_name" {
    name = "Testing"
}

│ Error: Error listing AdminScope: Testing
│
│   with module.citrix_cloud_daas.data.citrix_admin_scope.testing_scope[0],
│   on .terraform/modules/citrix_cloud_daas/machine_catalogs.tf line 6, in data "citrix_admin_scope" "testing_scope":
│    6: data "citrix_admin_scope" "testing_scope" {
│
│ Error message: Object does not exist.

In Citrix DaaS there is a scope with the name Testing with type Tenant that exists (scope name is unable to be changed).

I did a little digging around and found that for type tenant scopes, the backend stores the CCID as the 'name' and the displayed name is the 'tenant_name'.

For example;

The output in DaaS shows

Name Description Type
All All Objects -
Testing - Tenant
# GET https://[CCID].xendesktop.net/citrix/orchestration/api/[CCID]/XXXXXXXXXXXXXXXXXXX/Admin/Scopes
{
    "Items": [
        {
            "Id": "00000000-0000-0000-0000-000000000000",
            "Uid": null,
            "Name": "All",
            "Description": "All objects",
            "IsBuiltIn": true,
            "IsAllScope": true,
            "IsTenantScope": false,
            "TenantId": null,
            "TenantName": null
        },
        {
            "Id": "XXXXXXXXXXXXXXXXXXXX",
            "Uid": null,
            "Name": "[CCID here]",
            "Description": "",
            "IsBuiltIn": false,
            "IsAllScope": false,
            "IsTenantScope": true,
            "TenantId": "[CCID here],
            "TenantName": "Testing"
        },
}

Should the data resource lookup the name regardless of the type or should tenant_name parameter be available to lookup on ?

Resource impacted:
citrix_admin_scope

Versions

Use the terraform -v command to find the Terraform and Citrix Provider versions.
Terraform: 1.5.0
citrix/citrix provider: 1.0.7
Operation system: Windows 11 (WSL)

CitrixIssueId: 59144

@hewozuoai hewozuoai added the bug Something isn't working label Nov 15, 2024
@hewozuoai
Copy link
Author

Just to add, I have confirmed that if you use the CCID for a tenant type scope as name, the lookup works.

@sourav-citrix
Copy link
Collaborator

Hi @hewozuoai,

Thank you for reporting this issue.
To use the scopes data source for the tenant type, please either use the id field or use the tenant customer Id as the name.
We will update the docs from our end for better clarification.

@yashbhokare-citrix yashbhokare-citrix linked a pull request Dec 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🔧
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants