CiscoISE / terraform-provider-ciscoise

Terraform Provider for Cisco ISE
https://registry.terraform.io/providers/CiscoISE/ciscoise/latest/docs
MIT License
10 stars 4 forks source link

Dynamic urls in provider #16

Closed ragu2k8 closed 2 years ago

ragu2k8 commented 2 years ago

There is few APIs requires different base urls in provider config where it needs to talk to individual nodes directly in cluster(behaviour of product design at this point).. and requiring directory structure and provider config for each node is bit challenging(assuming we have 20+ nodes in a cluster) so is there any better way we can address it? i see terraform does not support dynamic urls in provider config.

Ex: APIs /api/v1/certs/system /api/v1/hotpatch/install /api/v1/patch/install

Data Sources ciscoise_hotpatch ciscoise_hotpatch_install ciscoise_hotpatch_rollback ciscoise_patch ciscoise_patch_install ciscoise_patch_rollback Data Sources ciscoise_system_certificate_import

jbogarin commented 2 years ago

@ragu2k8 let me see if I understand correctly.

What you are saying is that some APIs need to talk directly to the node and not the administration node and that you find the idea of creating a provider for each of those nodes, too cumbersome?

Is that right?

ragu2k8 commented 2 years ago

yes thats correct. @jbogarin

jbogarin commented 2 years ago

Ok, I'll talk to the team, but not sure we can do anything. As you said, it is the way ISE works. I'll check to see if we can do anything to simplify it from within Terraform without adding too much complexity to the code base.

jbogarin commented 2 years ago

Check is this helps.

https://www.terraform.io/language/providers/configuration#alias-multiple-provider-configurations

ragu2k8 commented 2 years ago

@jbogarin sure..i understand. Just wanted to ask and see if there is better way. thanks for looking.

ragu2k8 commented 2 years ago

https://www.terraform.io/language/providers/configuration#alias-multiple-provider-configurations

yes thats one of the option

jbogarin commented 2 years ago

I think that's the best option because any other thing we come out with, we will have to ask the IP/FQDNs for each node and then ask to which node you want to talk to, which will end up being very similar to those aliases.

ragu2k8 commented 2 years ago

I think that's the best option because any other thing we come out with, we will have to ask the IP/FQDNs for each node and then ask to which node you want to talk to, which will end up being very similar to those aliases.

alright @jbogarin thanks for looking.