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

[FEATURE] Add data resource for citrix_cloud_resource_location #134

Open
hewozuoai opened this issue Oct 4, 2024 · 3 comments
Open

[FEATURE] Add data resource for citrix_cloud_resource_location #134

hewozuoai opened this issue Oct 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@hewozuoai
Copy link

Describe the feature request

With Citrix Cloud setups there is usually a default resource location, would be nice if we could use a data resource to look it up instead of either importing it or creating a new one (in our case, the default one has the same name so we always have to import).

Summary:
Add data resource for citrix_cloud_resource_location

Is this an enhancement to an existing resource or data source, if so which one?
Currently the data resource for a citrix_cloud_resource_location is not supported.

│ Error: Invalid data source
│
│   on .terraform/modules/citrix_cloud_daas/resource_locations.tf line 1, in data "citrix_cloud_resource_location" "resource_location":
│    1: data "citrix_cloud_resource_location" "resource_location" {
│
│ The provider citrix/citrix does not support data source "citrix_cloud_resource_location".
│
│ Did you intend to use the managed resource type "citrix_cloud_resource_location"? If so, declare this using a "resource" block instead of a "data" block.

If this is a new resource or data source describe what it should do.

# Lookup by resource location name
data "citrix_cloud_resource_location" "resource_location" {
  name  = "XXXXXX"
}

# Lookup by resource location id
data "citrix_cloud_resource_location" "resource_location" {
  id = "XXXX-XXXX-XXXX-XXXXX"
}

Link to any docs that cover this feature:
https://github.com/citrix/terraform-provider-citrix/blob/main/docs/resources/cloud_resource_location.md

@hewozuoai hewozuoai added the enhancement New feature or request label Oct 4, 2024
@zhuolun-citrix
Copy link
Collaborator

zhuolun-citrix commented Oct 4, 2024

Hi @hewozuoai ,

Thank you for your suggestion.

I have a few questions regarding this data source:

  1. Do you use this data source mainly for getting the Resource Location ID by name? If so, how does using data source improve your workflow compared to using Resource Location ID directly?
  2. Do you wish data source to provide more information about the Resource Location other than the ID / Name? If so, what other properties / information you want to be able to retrieve from this data source?
  3. Why are you importing Resource Location created outside of Terraform in your current workflow? How does having Resource Location in Terraform State helps in your use case?

Your response to the questions above will really help us implement the data source in the best way.

Thank you,
Zhuolun

@zhuolun-citrix
Copy link
Collaborator

Hi @hewozuoai ,

Can you provide more information to the questions above?

We are implementing the data source at the moment and would like to know if there is anything else than name and id to add into the data source before we cut the next release. If you have additional request that couldn't make it into the next release, please open a new enhancement issue as this one will be closed once the next release is out.

Thank you,
Zhuolun

@hewozuoai
Copy link
Author

Hi @hewozuoai ,

Thank you for your suggestion.

I have a few questions regarding this data source:

  1. Do you use this data source mainly for getting the Resource Location ID by name? If so, how does using data source improve your workflow compared to using Resource Location ID directly?

Yes - in our case we do not know the resource location ID, only the name

  1. Do you wish data source to provide more information about the Resource Location other than the ID / Name? If so, what other properties / information you want to be able to retrieve from this data source?

Currently we just need the ID to pass through to other resource objects.

  1. Why are you importing Resource Location created outside of Terraform in your current workflow? How does having Resource Location in Terraform State helps in your use case?

In citrix cloud when i remove all resource locations, it automatically re-provisions one using either a default name or previously created resource location name - which is now no longer in terraform state.

We are implementing the data source at the moment and would like to know if there is anything else than name and id to add into the data source before we cut the next release. If you have additional request that couldn't make it into the next release, please open a new enhancement issue as this one will be closed once the next release is out.

Nothing that i can think of at the moment :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants